/[ascend]/trunk/tcltk98/generic/interface/old_utils.c
ViewVC logotype

Diff of /trunk/tcltk98/generic/interface/old_utils.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 89 by johnpye, Wed Dec 7 15:44:43 2005 UTC revision 114 by jds, Fri Dec 16 00:20:44 2005 UTC
# Line 66  Line 66 
66  /*int g_check_dimensions_noisy=1;*/  /*int g_check_dimensions_noisy=1;*/
67  #define GCDN g_check_dimensions_noisy  #define GCDN g_check_dimensions_noisy
68    
69  static char *write_char(str,slim,c)  static char *write_char(char *str, char *slim, int c)
 char *str,*slim;  
 int c;  
70  {  {
71     if( str < slim ) *(str++) = c;     if( str < slim ) *(str++) = c;
72     return(str);     return(str);
73  }  }
74    
75  static char *write_string(str,slim,s)  static char *write_string(char *str, char *slim, char *s)
 char *str,*slim;  
 char *s;  
76  {  {
77     for( ; *s != '\0' ; ++s )     for( ; *s != '\0' ; ++s )
78        str = write_char(str,slim,*s);        str = write_char(str,slim,*s);
# Line 143  char *asc_make_dimensions(const dim_type Line 139  char *asc_make_dimensions(const dim_type
139  #ifdef THIS_MAY_BE_UNUSED_CODE  #ifdef THIS_MAY_BE_UNUSED_CODE
140  /* commenting out unused functions  mthomas.96.09.20 */  /* commenting out unused functions  mthomas.96.09.20 */
141  /* dim checking stuff invokable at any time. */  /* dim checking stuff invokable at any time. */
142  static double frac_to_real(frac)  static double frac_to_real(struct fraction frac)
 struct fraction frac;  
143  {  {
144     return( (double)Numerator(frac) / (double)Denominator(frac) );     return( (double)Numerator(frac) / (double)Denominator(frac) );
145  }  }
146  #endif  #endif
147    
148  #define START 10000  /* largest power of 10 held by a short */  #define START 10000  /* largest power of 10 held by a short */
149  static struct fraction real_to_frac(real)  static struct fraction real_to_frac(double real)
 double real;  
150  {  {
151     short  num, den;     short  num, den;
152     for( den=START; den>1 && fabs(real)*den>SHRT_MAX; den /= 10 ) ;     for( den=START; den>1 && fabs(real)*den>SHRT_MAX; den /= 10 ) ;
# Line 163  double real; Line 157  double real;
157  #undef START  #undef START
158    
159    
160  static int nargs(type)  static int nargs(enum Expr_enum type)
 enum Expr_enum type;  
161  {  {
162     switch(type) {     switch(type) {
163     case e_int:     case e_int:
# Line 207  static int IsZero(struct dimnode *node) Line 200  static int IsZero(struct dimnode *node)
200  }  }
201    
202    
203  static void apply_term_dimensions(struct relation *rel,  static void apply_term_dimensions(CONST struct relation *rel,
204                                    struct relation_term *rt,                                    struct relation_term *rt,
205                                    struct dimnode *first,                                    struct dimnode *first,
206                                    struct dimnode *second,                                    struct dimnode *second,
# Line 521  static void apply_term_dimensions(struct Line 514  static void apply_term_dimensions(struct
514  }  }
515    
516    
517  int asc_check_dimensions(rel,dimens)  int asc_check_dimensions(CONST struct relation *rel, dim_type *dimens)
 struct relation *rel;  
 dim_type *dimens;  
518  {  {
519     struct dimnode *stack, *sp;     struct dimnode *stack, *sp;
520     boolean consistent = TRUE;     boolean consistent = TRUE;

Legend:
Removed from v.89  
changed lines
  Added in v.114

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22