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.97 2001/04/10 09:51:42 hubbe Exp $"); + RCSID("$Id: encode.c,v 1.98 2001/04/14 09:44:19 hubbe 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:790:    Pike_error("Cannot encode programs with event handlers.\n");    Pike_error("Cannot encode C programs.\n");    }    /*FIXME: save p->parent!! */    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->xstorage,data); +  code_number(p->parent_info_storage,data); +     code_number(p->alignment_needed,data);    code_number(p->timestamp.tv_sec,data);    code_number(p->timestamp.tv_usec,data);    -  +  if(p->parent) +  ref_push_program(p->parent); +  else +  push_int(0); +  encode_value2(Pike_sp-1,data); +  pop_stack(); +    #define FOO(X,Y,Z) \    code_number( p->num_##Z, data);   #include "program_areas.h"       adddata2(p->program, p->num_program);    adddata2(p->linenumbers, p->num_linenumbers);       for(d=0;d<p->num_identifier_index;d++)    code_number(p->identifier_index[d],data);   
pike.git/src/encode.c:1428:    EDB(fprintf(stderr, "Exponent: %d\n", num));       push_float(LDEXP(res, num));    break;    }       case TAG_TYPE:    {    struct pike_type *t;    -  /* FIXME: Should check that num is 0 here. */ -  +     decode_type(t, data);    check_type_string(t);    push_type_value(t);       tmp.type = T_INT;    tmp = data->counter;    data->counter.u.integer++;    }    break;   
pike.git/src/encode.c:1701:    decode_value2(data);    f_version(0);    if(!is_eq(Pike_sp-1,Pike_sp-2))    Pike_error("Cannot decode programs encoded with other pike version.\n");    pop_n_elems(2);       decode_number(p->flags,data);    p->flags &= ~(PROGRAM_FINISHED | PROGRAM_OPTIMIZED);    p->flags |= PROGRAM_AVOID_CHECK;    decode_number(p->storage_needed,data); +  decode_number(p->xstorage,data); +  decode_number(p->parent_info_storage,data);    decode_number(p->alignment_needed,data);    decode_number(p->timestamp.tv_sec,data);    decode_number(p->timestamp.tv_usec,data);    -  +  decode_value2(data); +  switch(Pike_sp[-1].type) +  { +  case T_INT: +  p->parent=0; +  break; +  case T_PROGRAM: +  p->parent=Pike_sp[-1].u.program; +  break; +  case T_FUNCTION: +  p->parent=program_from_svalue(Pike_sp-1); +  break; +  default: +  Pike_error("Program decode failed!\n"); +  } +  if(p->parent) add_ref(p->parent); +  pop_stack(); +    #define FOO(X,Y,Z) \    decode_number( p->num_##Z, data);   #include "program_areas.h"      #define FOO(NUMTYPE,TYPE,NAME) \    size=DO_ALIGN(size, ALIGNOF(TYPE)); \    size+=p->PIKE_CONCAT(num_,NAME)*sizeof(p->NAME[0]);   #include "program_areas.h"       dat=xalloc(size);