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.26 1997/09/29 00:57:55 hubbe Exp $"); + RCSID("$Id: pike_types.c,v 1.27 1998/01/13 22:56:48 hubbe 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:708:    switch(EXTRACT_TWOT(a,b))    {    case TWOT(T_PROGRAM, T_FUNCTION):    case TWOT(T_FUNCTION, T_PROGRAM):    return a;    case TWOT(T_OBJECT, T_FUNCTION):    {    struct program *p;    if((p=id_to_program(EXTRACT_INT(a+1))))    { -  int i=p->lfuns[LFUN_CALL]; +  int i=FIND_LFUN(p,LFUN_CALL);    if(i == -1) return 0;    return low_match_types(ID_FROM_INT(p, i)->type->str, b, flags);    }    return a;    }       case TWOT(T_FUNCTION, T_OBJECT):    {    struct program *p;    if((p=id_to_program(EXTRACT_INT(b+1))))    { -  int i=p->lfuns[LFUN_CALL]; +  int i=FIND_LFUN(p,LFUN_CALL);    if(i == -1) return 0;    return low_match_types(a, ID_FROM_INT(p, i)->type->str, flags);    }    return a;    }    }       if(EXTRACT_UCHAR(a) != EXTRACT_UCHAR(b)) return 0;       ret=a;
pike.git/src/pike_types.c:920:   {    switch(EXTRACT_UCHAR(t++))    {    case T_OBJECT:    {    struct program *p=id_to_program(EXTRACT_INT(t));    if(p)    {    if(n->token == F_ARROW)    { -  if(p->lfuns[LFUN_ARROW] != -1 || p->lfuns[LFUN_ASSIGN_ARROW] != -1) +  if(FIND_LFUN(p,LFUN_ARROW)!=-1 || FIND_LFUN(p,LFUN_ASSIGN_ARROW)!=-1)    {    reference_shared_string(mixed_type_string);    return mixed_type_string;    }    }else{ -  if(p->lfuns[LFUN_INDEX] != -1 || p->lfuns[LFUN_ASSIGN_INDEX] != -1) +  if(FIND_LFUN(p,LFUN_INDEX) != -1 || FIND_LFUN(p,LFUN_ASSIGN_INDEX) != -1)    {    reference_shared_string(mixed_type_string);    return mixed_type_string;    }    }    if(CDR(n)->token == F_CONSTANT && CDR(n)->u.sval.type==T_STRING)    {    INT32 i;    i=find_shared_string_identifier(CDR(n)->u.sval.u.string, p);    if(i==-1)
pike.git/src/pike_types.c:1039:    case T_STRING:    return !!low_match_types(int_type_string->str, index_type,0);       case T_OBJECT:    {    struct program *p=id_to_program(EXTRACT_INT(type));    if(p)    {    if(n->token == F_ARROW)    { -  if(p->lfuns[LFUN_ARROW] != -1 || p->lfuns[LFUN_ASSIGN_ARROW] != -1) +  if(FIND_LFUN(p,LFUN_ARROW) != -1 || FIND_LFUN(p,LFUN_ASSIGN_ARROW) != -1)    return 1;    }else{ -  if(p->lfuns[LFUN_INDEX] != -1 || p->lfuns[LFUN_ASSIGN_INDEX] != -1) +  if(FIND_LFUN(p,LFUN_INDEX) != -1 || FIND_LFUN(p,LFUN_ASSIGN_INDEX) != -1)    return 1;    }    return !!low_match_types(string_type_string->str, index_type,0);    }else{    return 1;    }    }       case T_MULTISET:    case T_MAPPING:
pike.git/src/pike_types.c:1181:    ret=int_type_string;    }else{    ret=mixed_type_string;    }    reference_shared_string(ret);    return ret;       case T_PROGRAM:    {    char *a; -  int id=s->u.program->lfuns[LFUN_CREATE]; +  int id=FIND_LFUN(s->u.program,LFUN_CREATE);    if(id>=0)    {    a=ID_FROM_INT(s->u.program, id)->type->str;    }else{    a=function_type_string->str;    }    if(EXTRACT_UCHAR(a)==T_FUNCTION)    {    type_stack_mark();    push_type_int(s->u.program->id);