pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: encode.c,v 1.189 2003/06/12 18:42:56 mast Exp $ + || $Id: encode.c,v 1.190 2003/06/30 17:06:08 mast Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "mapping.h"
pike.git/src/encode.c:20:   #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"   #include "pikecode.h"    - RCSID("$Id: encode.c,v 1.189 2003/06/12 18:42:56 mast Exp $"); + RCSID("$Id: encode.c,v 1.190 2003/06/30 17:06:08 mast Exp $");      /* #define ENCODE_DEBUG */      /* Use the old encoding method for programs. */   /* #define OLD_PIKE_ENCODE_PROGRAM */      #ifdef ENCODE_DEBUG   /* Pass a nonzero integer as the third arg to encode_value,    * encode_value_canonic and decode_value to activate this debug. */   #define EDB(N,X) do { debug_malloc_touch(data); if (data->debug>=N) {X;} } while (0)
pike.git/src/encode.c:289:    sval.subtype = 0;    sval.u.string = (void *)t->car;       encode_value2(&sval, data, 0);    }    t=t->cdr;    goto one_more_type;       case T_ASSIGN:    { -  ptrdiff_t marker = ((char *)t->car)-(char *)0; +  ptrdiff_t marker = CAR_TO_INT(t);    if ((marker < 0) || (marker > 9)) {    Pike_fatal("Bad assign marker: %ld\n",    (long)marker);    }    addchar('0' + marker);    t = t->cdr;    }    goto one_more_type;       case T_FUNCTION:
pike.git/src/encode.c:330:    case T_ARRAY:    case T_MULTISET:    case T_NOT:    t = t->car;    goto one_more_type;       case T_INT:    {    ptrdiff_t val;    -  val = ((char *)t->car)-(char *)0; +  val = CAR_TO_INT(t);    addchar((val >> 24)&0xff);    addchar((val >> 16)&0xff);    addchar((val >> 8)&0xff);    addchar(val & 0xff); -  val = ((char *)t->cdr)-(char *)0; +  val = CDR_TO_INT(t);    addchar((val >> 24)&0xff);    addchar((val >> 16)&0xff);    addchar((val >> 8)&0xff);    addchar(val & 0xff);    }    break;       case '0':    case '1':    case '2':
pike.git/src/encode.c:363:    case T_FLOAT:    case T_STRING:    case T_MIXED:    case T_ZERO:    case T_VOID:    case PIKE_T_UNKNOWN:    break;       case T_OBJECT:    { -  addchar(((char *)t->car)-(char *)0); +  addchar(CAR_TO_INT(t));       if(t->cdr)    { -  ptrdiff_t id = ((char *)t->cdr)-(char *)0; +  ptrdiff_t id = CAR_TO_INT(t);    if( id >= PROG_DYNAMIC_ID_START )    {    struct program *p=id_to_program(id);    if(p)    {    ref_push_program(p);    }else{    push_int(0);    }    } else
pike.git/src/encode.c:3011:       if(placeholder && data->pass == 1)    {    if(placeholder->storage)    {    ref_push_program (p);    decode_error(Pike_sp - 1, NULL, "Placeholder already has storage!\n");    } else {    placeholder->storage=p->storage_needed ?    (char *)xalloc(p->storage_needed) : -  (char *)0; +  (char *)NULL;    call_c_initializers(placeholder);    }    }       data->pickyness--;       if(placeholder)    {    free_object(placeholder);    UNSET_ONERROR(err4);    }    UNSET_ONERROR(err3);       ref_push_program(p);       if(!(p->flags & PROGRAM_FINISHED) &&    !data->supporter.depends_on)    {    /* Logic for the PROGRAM_FINISHED flag:    * The purpose of this code is to make sure that the PROGRAM_FINISHED -  * flat is not set on the program until all inherited programs also +  * flag is not set on the program until all inherited programs also    * have that flag. -Hubbe    */    for(d=1;d<p->num_inherits;d++)    if(! (p->inherits[d].prog->flags & PROGRAM_FINISHED))    break;       if(d == p->num_inherits)    {    p->flags &=~ PROGRAM_AVOID_CHECK;    p->flags |= PROGRAM_FINISHED;