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.99 1999/12/15 19:42:09 hubbe Exp $"); + RCSID("$Id: pike_types.c,v 1.100 1999/12/16 23:59:45 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"   #include "main.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, int array_cnt);      #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:2262:       if(EXTRACT_UCHAR(b)==T_MANY)    {    b_tmp=b+1;    }else{    b_tmp=b;    b+=type_length(b);    }       if (EXTRACT_UCHAR(a_tmp) != T_VOID) { -  /* if (EXTRACT_UCHAR(b_tmp) == T_VOID) return 0; */ +  if ((EXTRACT_UCHAR(b_tmp) == T_VOID) && +  (a_tmp != a+1)) { +  /* a is not a many arg */ +  return 0; +  }    if (!low_pike_types_le(b_tmp, a_tmp, 0)) return 0;    }    }    /* check the 'many' type */    a++;    b++;    if (EXTRACT_UCHAR(a) != T_VOID) {    if (!low_pike_types_le(b, a, 0))    return 0;    }