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.129 2000/03/26 14:16:11 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.130 2008/09/14 07:26:12 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"
pike.git/src/pike_types.c:643:    bad_type:    error("Couldn't parse type. (%s)\n",buf);    }       while(ISSPACE(**s)) ++*s;   }         static void internal_parse_typeB(char **s)   { -  while(ISSPACE(**((unsigned char **)s))) ++*s; +  while(ISSPACE(*((unsigned char *)*s))) ++*s;    switch(**s)    {    case '!':    ++*s;    internal_parse_typeB(s);    push_type(T_NOT);    break;       case '(':    ++*s;    internal_parse_type(s); -  while(ISSPACE(**((unsigned char **)s))) ++*s; +  while(ISSPACE(*((unsigned char *)*s))) ++*s;    if(**s != ')') error("Expecting ')'.\n");    ++*s;    break;       default:       internal_parse_typeA(s);    }   }      static void internal_parse_typeCC(char **s)   {    internal_parse_typeB(s);    -  while(ISSPACE(**((unsigned char **)s))) ++*s; +  while(ISSPACE(*((unsigned char *)*s))) ++*s;       while(**s == '*')    {    ++*s; -  while(ISSPACE(**((unsigned char **)s))) ++*s; +  while(ISSPACE(*((unsigned char *)*s))) ++*s;    push_type(T_ARRAY);    }   }      static void internal_parse_typeC(char **s)   {    type_stack_mark();       type_stack_mark();    internal_parse_typeCC(s);    type_stack_reverse();    -  while(ISSPACE(**((unsigned char **)s))) ++*s; +  while(ISSPACE(*((unsigned char *)*s))) ++*s;       if(**s == '&')    {    ++*s;    type_stack_mark();    internal_parse_typeC(s);    type_stack_reverse();    type_stack_reverse();    push_type(T_AND);    }else{    type_stack_reverse();    }   }      static void internal_parse_type(char **s)   {    internal_parse_typeC(s);    -  while(ISSPACE(**((unsigned char **)s))) ++*s; +  while(ISSPACE(*((unsigned char *)*s))) ++*s;       while(**s == '|')    {    ++*s;    internal_parse_typeC(s);    push_type(T_OR);    }   }      /* This function is used when adding simul efuns so that
pike.git/src/pike_types.c:1450:         #ifdef PIKE_TYPE_DEBUG   static int indent=0;   #endif      /*    * match two type strings, return zero if they don't match, and return    * the part of 'a' that _did_ match if it did.    */ + static char *low_match_types2(char *a,char *b, int flags);   static char *low_match_types(char *a,char *b, int flags)   #ifdef PIKE_TYPE_DEBUG   {    int e;    char *s; -  static char *low_match_types2(char *a,char *b, int flags); +        if (l_flag>2) {    init_buf();    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("low_match_types(");    low_describe_type(a);    if(type_length(a) + type_length(b) > 10)    {    my_strcat(",\n");    for(e=0;e<indent;e++) my_strcat(" ");
pike.git/src/pike_types.c:1968:    *    * 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_le2(char *a, char *b, +  int array_cnt, unsigned int flags);   static int low_pike_types_le(char *a, char *b,    int array_cnt, unsigned int flags)   #ifdef PIKE_TYPE_DEBUG   {    int e;    char *s; -  static int low_pike_types_le2(char *a, char *b, -  int array_cnt, unsigned int flags); +     int res;    char buf[50];       if (l_flag>2) {    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)    {