pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:18:   #include "pike_error.h"   #include "operators.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "fsort.h"   #include "threads.h"   #include "stuff.h"   #include "version.h"   #include "bignum.h"    - RCSID("$Id: encode.c,v 1.94 2001/03/28 15:07:39 grubba Exp $"); + RCSID("$Id: encode.c,v 1.95 2001/03/29 02:54:10 per Exp $");      /* #define ENCODE_DEBUG */      #ifdef ENCODE_DEBUG   #define EDB(X) X   #else   #define EDB(X)   #endif      /* The sp macro conflicts with Solaris 2.5.1's <sys/conf.h>. */
pike.git/src/encode.c:357: Inside #if defined(USE_PIKE_TYPE)
   case T_VOID:    case PIKE_T_UNKNOWN:    break;       case T_OBJECT:    {    addchar((ptrdiff_t)t->car);       if(t->cdr)    { +  int id = (int)(ptrdiff_t)t->cdr; +  if( id >= 65536 ) +  {    struct program *p=id_to_program((ptrdiff_t)t->cdr);    if(p)    {    ref_push_program(p);    }else{    push_int(0);    } -  +  } else +  push_int( id );    }else{    push_int(0);    }    encode_value2(Pike_sp-1, data);    pop_stack();    break;    }    }   }   #else /* !USE_PIKE_TYPE */
pike.git/src/encode.c:445:    case T_VOID:    case PIKE_T_UNKNOWN:    break;       case T_OBJECT:    {    INT32 x;    addchar(EXTRACT_UCHAR(t++));    x=EXTRACT_INT(t);    t+=sizeof(INT32); -  if(x) +  if(x >= 65536)    {    struct program *p=id_to_program(x);    if(p)    {    ref_push_program(p);    }else{    push_int(0);    }    }else{ -  push_int(0); +  push_int(x);    }    encode_value2(Pike_sp-1, data);    pop_stack();    break;    }    }    return t-q;   }      static void encode_type(struct pike_type *t, struct encode_data *data)
pike.git/src/encode.c:749:    Pike_error("Canonical encoding of programs not supported.\n");    check_stack(1);    push_svalue(val);    apply(data->codec,"nameof", 1);    if(Pike_sp[-1].type == val->type)    Pike_error("Error in master()->nameof(), same type returned.\n");    if(Pike_sp[-1].type == T_INT && Pike_sp[-1].subtype == NUMBER_UNDEFINED)    {    INT32 e;    struct program *p=val->u.program; -  if(p->event_handler || (p->flags & PROGRAM_HAS_C_METHODS)) +  if( p->event_handler ) +  Pike_error("Cannot encode programs with event handlers.\n"); +  if( (p->flags & PROGRAM_HAS_C_METHODS) )    Pike_error("Cannot encode C programs.\n");    code_entry(type_to_tag(val->type), 1,data);    f_version(0);    encode_value2(Pike_sp-1,data);    pop_stack();    code_number(p->flags,data);    code_number(p->storage_needed,data);    code_number(p->alignment_needed,data);    code_number(p->timestamp.tv_sec,data);    code_number(p->timestamp.tv_usec,data);
pike.git/src/encode.c:1269:       case T_OBJECT:    {    INT32 x;    int flag = GETC();       decode_value2(data);    switch(Pike_sp[-1].type)    {    case T_INT: -  push_object_type_backwards(flag, 0); +  push_object_type_backwards(flag, Pike_sp[-1].u.integer );    break;       case T_PROGRAM:    push_object_type_backwards(flag, Pike_sp[-1].u.program->id);    break;       case T_FUNCTION:    {    struct program *prog;    if (Pike_sp[-1].subtype == FUNCTION_BUILTIN) {