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.164 2001/03/18 14:32:16 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.165 2001/03/18 19:46:52 per 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:410:    (void *)(ptrdiff_t)level,    *Pike_compiler->type_stackp,    PT_COPY_CDR);       TYPE_STACK_DEBUG("push_scope_type");   }      void push_assign_type(int marker)   {    marker -= '0'; - #ifdef PIKE_DEBUG */ + #ifdef PIKE_DEBUG    if ((marker < 0) || (marker > 9)) {    fatal("Bad assign marker: %ld\n", marker);    }   #endif /* PIKE_DEBUG */       *Pike_compiler->type_stackp = mk_type(T_ASSIGN,    (void *)(ptrdiff_t)marker,    *Pike_compiler->type_stackp,    PT_COPY_CDR);    TYPE_STACK_DEBUG("push_assign_type");
pike.git/src/pike_types.c:792:    push_type(T_MANY);    }    break;    }    if(!strcmp(buf,"float")) { push_type(T_FLOAT); break; }    goto bad_type;       case 'o':    if(!strcmp(buf,"object"))    { +  while(ISSPACE(**s)) ++*s; +  if(**s == '(') /* object({is,implements} id) */ +  { +  int is = 1, id; +  ++*s; +  if( **s != 'i' ) +  goto bad_type; +  ++*s; +  if( **s == 'm' ) +  is = 0; +  while( isidchar( **s ) ) ++*s; +  while( ISSPACE(**s) ) ++*s; +  if( !**s ) +  goto bad_type; +  id = atoi( *s ); +  while( **s >= '0' && **s <= '9' ) +  ++*s; +  while(ISSPACE(**s)) ++*s; +  if( !**s || **s != ')' ) +  goto bad_type; +  ++*s; +  push_object_type(is, id); +  } +  else    push_object_type(0, 0);    break;    }    goto bad_type;          case 'p':    if(!strcmp(buf,"program")) { push_type(T_PROGRAM); break; }    goto bad_type;   
pike.git/src/pike_types.c:4095:    case T_PROGRAM:    case T_STRING:    case T_FLOAT:    case T_ZERO:    case T_VOID:    case T_MIXED:    my_putchar(t->type);    break;       case T_OBJECT: -  if (t->car || t->cdr) { -  Pike_error("Not supported yet!\n"); -  } else { -  my_strcat(tObj); +  { +  INT32 i; +  my_putchar(T_OBJECT); +  i = (INT32)(ptrdiff_t)t->car; +  my_putchar( i ); +  i = (INT32)(ptrdiff_t)t->cdr; +  +  if( i > 65535 ) i = 0; /* Not constant between recompilations */ +  +  my_putchar((i >> 24) & 0xff); +  my_putchar((i >> 16) & 0xff); +  my_putchar((i >> 8) & 0xff); +  my_putchar(i & 0xff);    }    break;       case T_INT:    {    INT32 i;    my_putchar(T_INT);    i = (INT32)(ptrdiff_t)t->car;    my_putchar((i >> 24) & 0xff);    my_putchar((i >> 16) & 0xff);
pike.git/src/pike_types.c:4551:    }    push_type(T_FUNCTION);    break;    }    if(!strcmp(buf,"float")) { push_type(T_FLOAT); break; }    goto bad_type;       case 'o':    if(!strcmp(buf,"object"))    { +  while(ISSPACE(**s)) ++*s; +  if(**s == '(') /* object({is,implements} id) */ +  { +  int is = 1, id; +  ++*s; +  if( **s != 'i' ) +  goto bad_type; +  ++*s; +  if( **s == 'm' ) +  is = 0; +  while( isidchar( **s ) ) ++*s; +  while( ISSPACE(**s) ) ++*s; +  if( !**s ) +  goto bad_type; +  id = atoi( *s ); +  while( **s >= '0' && **s <= '9' ) +  ++*s; +  while(ISSPACE(**s)) ++*s; +  if( !**s || **s != ')' ) +  goto bad_type; +  ++*s; +  push_object_type(is, id); +  } +  else    push_object_type(0, 0);    break;    }    goto bad_type;    -  +     case 'p':    if(!strcmp(buf,"program")) { push_type(T_PROGRAM); break; }    goto bad_type;          case 's':    if(!strcmp(buf,"string")) { push_type(T_STRING); break; }    goto bad_type;       case 'v':