/[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 17 by aw0a, Tue Dec 7 17:37:58 2004 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 85  char *s; Line 81  char *s;
81    
82  #define SIZE_INCREMENT 16  #define SIZE_INCREMENT 16
83  #define ROOM_FOR_INT  11    /* a 32-bit int, that is */  #define ROOM_FOR_INT  11    /* a 32-bit int, that is */
84  char *asc_make_dimensions(dim)  char *asc_make_dimensions(const dim_type *dim)
 dim_type *dim;  
85  {  {
86     boolean first;     boolean first;
87     char *dimens;     char *dimens;
# Line 144  dim_type *dim; Line 139  dim_type *dim;
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 164  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 208  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 276  static void apply_term_dimensions(struct Line 268  static void apply_term_dimensions(struct
268      case F_LN:      case F_LN:
269      case F_LNM:      case F_LNM:
270      case F_LOG:      case F_LOG:
271      case F_ERF:  #ifdef HAVE_ERF
272        case F_ERF:
273    #endif
274      case F_SINH:      case F_SINH:
275      case F_COSH:      case F_COSH:
276      case F_TANH:      case F_TANH:
# Line 520  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.17  
changed lines
  Added in v.114

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