pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: pike_types.c,v 1.77 1999/11/25 19:27:07 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.78 1999/11/25 20:04:53 grubba Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"   #include "constants.h"   #include "object.h"   #include "multiset.h"   #include "mapping.h"   #include "pike_macros.h"   #include "error.h"   #include "las.h"   #include "language.h"   #include "lex.h"   #include "pike_memory.h"   #include "bignum.h"    - /* #define PIKE_TYPE_DEBUG */ + #define PIKE_TYPE_DEBUG      int max_correct_args;      static void internal_parse_type(char **s);   static int type_length(char *t);   static int low_pike_types_le(char *a, char *b);      #define TWOT(X,Y) (((X) << 8)+(Y))   #define EXTRACT_TWOT(X,Y) TWOT(EXTRACT_UCHAR(X), EXTRACT_UCHAR(Y))   
pike.git/src/pike_types.c:1689:    * zero    *    * void    *    * Note that non-destructive operations are assumed.    * ie it's assumed that calling a function(mapping(string|int:string|int):void)    * with a mapping(int:int) won't change the type of the mapping after the    * operation.    */   static int low_pike_types_le(char *a,char *b) + #ifdef PIKE_TYPE_DEBUG   { -  +  int e; +  char *s; +  int low_pike_types_le2(char *a,char *b); +  int res; +  +  init_buf(); +  for(e=0;e<indent;e++) my_strcat(" "); +  my_strcat("low_pike_types_le("); +  low_describe_type(a); +  if(type_length(a) + type_length(b) > 10) +  { +  my_strcat(",\n"); +  for(e=0;e<indent;e++) my_strcat(" "); +  my_strcat(" "); +  low_describe_type(b); +  }else{ +  my_strcat(", "); +  low_describe_type(b); +  } +  my_strcat(");\n"); +  fprintf(stderr,"%s",(s=simple_free_buf())); +  free(s); +  indent++; +  +  res=low_pike_types_le2(a,b); +  +  indent--; +  +  for(e=0;e<indent;e++) fprintf(stderr, " "); +  fprintf(stderr, "= %d\n", res); +  +  return res; + } +  + static int low_pike_types_le2(char *a,char *b) + #endif /* PIKE_TYPE_DEBUG */ +  + {    int ret;    if(a == b) return 1;       switch(EXTRACT_UCHAR(a))    {    case T_AND:    /* OK if either of the parts is a subset. */    /* FIXME: What if b also contains an AND? */    a++;    ret = low_pike_types_le(a,b);