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.148 2001/02/20 15:59:50 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.149 2001/02/23 14:44:20 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:3441:    free_type(mapping_type_string);    free_type(type_type_string);    free_type(mixed_type_string);    free_type(void_type_string);    free_type(zero_type_string);    free_type(any_type_string);    free_type(weak_type_string);   }       - int type_may_overload(char *type, int lfun) + static int low_type_may_overload(char *type, int lfun)   {    switch(EXTRACT_UCHAR(type++))    {    case T_ASSIGN: -  return type_may_overload(type+1,lfun); +  return low_type_may_overload(type+1,lfun);       case T_FUNCTION:    case T_ARRAY:    /* might want to check for `() */       default:    return 0;       case T_OR: -  return type_may_overload(type,lfun) || -  type_may_overload(type+type_length(type),lfun); +  return low_type_may_overload(type,lfun) || +  low_type_may_overload(type+type_length(type),lfun);       case T_AND: -  return type_may_overload(type,lfun) && -  type_may_overload(type+type_length(type),lfun); +  return low_type_may_overload(type,lfun) && +  low_type_may_overload(type+type_length(type),lfun);       case T_NOT: -  return !type_may_overload(type,lfun); +  return !low_type_may_overload(type,lfun);       case T_MIXED:    return 1;       case T_OBJECT:    {    struct program *p=id_to_program(extract_type_int(type+1));    if(!p) return 1;    return FIND_LFUN(p, lfun)!=-1;    }    }   }    -  + int type_may_overload(struct pike_type *type, int lfun) + { +  return low_type_may_overload(type->str, lfun); + }      void yyexplain_nonmatching_types(struct pike_type *type_a,    struct pike_type *type_b,    int flags)   {    implements_a=0;    implements_b=0;       match_types(type_a,type_b);   
pike.git/src/pike_types.c:3520:    yyexplain_not_implements(implements_a,implements_b,flags);   }         struct pike_type *make_pike_type(char *t)   {    return make_shared_binary_string(t, type_length(t));   }       - int pike_type_allow_premature_toss(char *type) + static int low_pike_type_allow_premature_toss(char *type)   {    again:    switch(EXTRACT_UCHAR(type++))    {    case T_NOT: -  return !pike_type_allow_premature_toss(type); +  return !low_pike_type_allow_premature_toss(type);       case T_OBJECT:    case T_MIXED:    case T_FUNCTION:    return 0;       case T_SCOPE:    case T_ASSIGN:    type++;    goto again;       case T_OR:    case T_MAPPING: -  if(!pike_type_allow_premature_toss(type)) return 0; +  if(!low_pike_type_allow_premature_toss(type)) return 0;    case T_AND:    type+=type_length(type);    case T_ARRAY:    case T_MULTISET:    goto again;       case T_PROGRAM:    case T_INT:    case T_FLOAT:    case T_STRING:    return 1;    }    /* NOT_REACHED */    return 0;   } -  +  + int pike_type_allow_premature_toss(struct pike_type *type) + { +  return low_pike_type_allow_premature_toss(type->str); + }