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.116 1999/12/31 14:50:16 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.117 2000/01/02 23:36:44 mast 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:478:    internal_parse_type(_s); /* return type */    type_stack_reverse();    if(**s != ')') error("Missing ')' in function type.\n");    ++*s;    type_stack_reverse();    }else{    push_type(T_VOID);    push_type(T_MIXED);    push_type(T_OR);    push_type(T_VOID); -  push_type(T_MIXED); +  push_type(T_ZERO);    push_type(T_OR);    push_type(T_MANY);    }    push_type(T_FUNCTION);    break;    }    if(!strcmp(buf,"float")) { push_type(T_FLOAT); break; }    goto bad_type;       case 'o':
pike.git/src/pike_types.c:885:    /* Prog id */    break;    case T_STRING: my_strcat("string"); break;    case T_TYPE: my_strcat("type"); break;       case T_FUNCTION:    {    int s;    my_strcat("function");    if(EXTRACT_UCHAR(t) == T_MANY && -  (EXTRACT_UCHAR(t+1) == T_MIXED && +  ((EXTRACT_UCHAR(t+1) == T_ZERO &&    EXTRACT_UCHAR(t+2) == T_OR &&    ((EXTRACT_UCHAR(t+3) == T_MIXED && EXTRACT_UCHAR(t+4) == T_VOID) ||    (EXTRACT_UCHAR(t+4) == T_MIXED && EXTRACT_UCHAR(t+3) == T_VOID)))    ||    (EXTRACT_UCHAR(t+1) == T_OR    && -  ((EXTRACT_UCHAR(t+2) == T_MIXED && EXTRACT_UCHAR(t+3) == T_VOID) || -  (EXTRACT_UCHAR(t+3) == T_MIXED && EXTRACT_UCHAR(t+2) == T_VOID)) +  ((EXTRACT_UCHAR(t+2) == T_ZERO && EXTRACT_UCHAR(t+3) == T_VOID) || +  (EXTRACT_UCHAR(t+3) == T_ZERO && EXTRACT_UCHAR(t+2) == T_VOID))    &&    EXTRACT_UCHAR(t+4) == T_OR    &&    ((EXTRACT_UCHAR(t+5) == T_MIXED && EXTRACT_UCHAR(t+6) == T_VOID) || -  (EXTRACT_UCHAR(t+6) == T_MIXED && EXTRACT_UCHAR(t+5) == T_VOID)))) +  (EXTRACT_UCHAR(t+6) == T_MIXED && EXTRACT_UCHAR(t+5) == T_VOID)))))    {    /* done */ -  if (EXTRACT_UCHAR(t+1) == T_MIXED) { -  /* function(mixed...:mixed|void) */ +  if (EXTRACT_UCHAR(t+1) == T_ZERO) { +  /* function(zero...:mixed|void) */    t += 5;    } else { -  /* function(mixed|void...mixed|void) */ +  /* function(zero|void...mixed|void) */    t += 7;    }    } else {    my_strcat("(");    s=0;    while(EXTRACT_UCHAR(t) != T_MANY)    {    if(s++) my_strcat(", ");    t=low_describe_type(t);    }
pike.git/src/pike_types.c:3153:    a+=type_length(a);    }    a++;    push_type(T_MANY);    type_stack_mark();    push_unfinished_type(a);    type_stack_reverse();    type_stack_reverse();    push_type(T_FUNCTION);    return pop_unfinished_type(); +  +  case T_ARRAY: +  return zzap_function_return(a+1,id);    }   /* This error is bogus /Hubbe    fatal("zzap_function_return() called with unexpected value: %d\n",    EXTRACT_UCHAR(a));   */    return NULL;   }      struct pike_string *get_type_of_svalue(struct svalue *s)   {
pike.git/src/pike_types.c:3282:    return ret;       case T_PROGRAM:    {    char *a;    struct pike_string *tmp;    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((tmp=zzap_function_return(a, s->u.program->id)))    return tmp; -  +  tmp=describe_type(ID_FROM_INT(s->u.program, id)->type); +  yywarning ("zzap_function_return() failed on the create() type: %s", +  tmp->str); +  free_string(tmp); +  }    -  a=function_type_string->str; +  a=tFunc(tVoid,tObj);    if((tmp=zzap_function_return(a, s->u.program->id)))    return tmp;       fatal("Completely failed to zzap function return!\n");    }       default:    type_stack_mark();    push_type(s->type);    return pop_unfinished_type();