pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:19:   #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.150 2002/08/06 13:50:54 grubba Exp $"); + RCSID("$Id: encode.c,v 1.151 2002/08/15 14:49:20 marcus 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:258:   {    one_more_type:    if (t->type == T_MANY) {    addchar(T_FUNCTION);    addchar(T_MANY);    } else if (t->type != PIKE_T_NAME) {    addchar(t->type);    }    switch(t->type) {    default: -  fatal("error in type tree: %d.\n", t->type); +  Pike_fatal("error in type tree: %d.\n", t->type);    /*NOTREACHED*/       break;       case PIKE_T_NAME:    /* Strip the name. */    t=t->cdr;    goto one_more_type;       case T_ASSIGN:    if (((ptrdiff_t)t->car < 0) || ((ptrdiff_t)t->car > 9)) { -  fatal("Bad assign marker: %ld\n", (long)(ptrdiff_t)t->car); +  Pike_fatal("Bad assign marker: %ld\n", (long)(ptrdiff_t)t->car);    }    addchar('0' + (ptrdiff_t)t->car);    t = t->cdr;    goto one_more_type;       case T_FUNCTION:    while(t->type == T_FUNCTION) {    encode_type(t->car, data);    t = t->cdr;    }
pike.git/src/encode.c:405:    p->inherits[e].prog=0;    }    }    }   }      static void encode_value2(struct svalue *val, struct encode_data *data)      #ifdef PIKE_DEBUG   #undef encode_value2 - #define encode_value2(X,Y) do { struct svalue *_=Pike_sp; encode_value2_(X,Y); if(Pike_sp!=_) fatal("encode_value2 failed!\n"); } while(0) + #define encode_value2(X,Y) do { struct svalue *_=Pike_sp; encode_value2_(X,Y); if(Pike_sp!=_) Pike_fatal("encode_value2 failed!\n"); } while(0)   #endif      {    static struct svalue dested = {    T_INT, NUMBER_DESTRUCTED,   #ifdef HAVE_UNION_INIT    {0}, /* Only to avoid warnings. */   #endif    };    INT32 i;
pike.git/src/encode.c:958: Inside #if defined(ENCODE_PROGRAM)
     #ifdef ENCODE_PROGRAM   #ifdef PIKE_DEBUG    {    ptrdiff_t bufpos = data->buf.s.len;   #endif /* PIKE_DEBUG */    ENCODE_PROGRAM(p, &(data->buf));   #ifdef PIKE_DEBUG    if (p->num_program * sizeof(p->program[0]) !=    data->buf.s.len - bufpos) { -  fatal("ENCODE_PROGRAM() failed:\n" +  Pike_fatal("ENCODE_PROGRAM() failed:\n"    "Encoded data len: %ld\n"    "Expected data len: %ld\n",    DO_NOT_WARN((long)(p->num_program * sizeof(p->program[0]))),    DO_NOT_WARN((long)(data->buf.s.len - bufpos)));    }    }   #endif /* PIKE_DEBUG */   #else /* !ENCODE_PROGRAM */    adddata2(p->program, p->num_program);   #endif /* ENCODE_PROGRAM */
pike.git/src/encode.c:1095: Inside #if defined(ENCODE_PROGRAM)
   /* program */   #ifdef ENCODE_PROGRAM   #ifdef PIKE_DEBUG    {    ptrdiff_t bufpos = data->buf.s.len;   #endif /* PIKE_DEBUG */    ENCODE_PROGRAM(p, &(data->buf));   #ifdef PIKE_DEBUG    if (p->num_program * sizeof(p->program[0]) !=    data->buf.s.len - bufpos) { -  fatal("ENCODE_PROGRAM() failed:\n" +  Pike_fatal("ENCODE_PROGRAM() failed:\n"    "Encoded data len: %ld\n"    "Expected data len: %ld\n",    DO_NOT_WARN((long)(p->num_program * sizeof(p->program[0]))),    DO_NOT_WARN((long)(data->buf.s.len - bufpos)));    }    }   #endif /* PIKE_DEBUG */   #else /* !ENCODE_PROGRAM */    adddata2(p->program, p->num_program);   #endif /* ENCODE_PROGRAM */
pike.git/src/encode.c:1759:         static void restore_type_stack(struct pike_type **old_stackp)   {   #if 0    fprintf(stderr, "Restoring type-stack: %p => %p\n",    Pike_compiler->type_stackp, old_stackp);   #endif /* 0 */   #ifdef PIKE_DEBUG    if (old_stackp > Pike_compiler->type_stackp) { -  fatal("type stack out of sync!\n"); +  Pike_fatal("type stack out of sync!\n");    }   #endif /* PIKE_DEBUG */    while(Pike_compiler->type_stackp > old_stackp) {    free_type(*(Pike_compiler->type_stackp--));    }   }      static void restore_type_mark(struct pike_type ***old_type_mark_stackp)   {   #if 0    fprintf(stderr, "Restoring type-mark: %p => %p\n",    Pike_compiler->pike_type_mark_stackp, old_type_mark_stackp);   #endif /* 0 */   #ifdef PIKE_DEBUG    if (old_type_mark_stackp > Pike_compiler->pike_type_mark_stackp) { -  fatal("type Pike_interpreter.mark_stack out of sync!\n"); +  Pike_fatal("type Pike_interpreter.mark_stack out of sync!\n");    }   #endif /* PIKE_DEBUG */    Pike_compiler->pike_type_mark_stackp = old_type_mark_stackp;   }      static void low_decode_type(struct decode_data *data)   {    /* FIXME: Probably ought to use the tag encodings too. */       int tmp;
pike.git/src/encode.c:1970:   #define decode_type(X,data) do { \    type_stack_mark(); \    low_decode_type(data); \    (X)=pop_unfinished_type(); \   } while(0)      static void decode_value2(struct decode_data *data)      #ifdef PIKE_DEBUG   #undef decode_value2 - #define decode_value2(X) do { struct svalue *_=Pike_sp; decode_value2_(X); if(Pike_sp!=_+1) fatal("decode_value2 failed!\n"); } while(0) + #define decode_value2(X) do { struct svalue *_=Pike_sp; decode_value2_(X); if(Pike_sp!=_+1) Pike_fatal("decode_value2 failed!\n"); } while(0)   #endif         {    INT32 what, e, num, numh;    struct svalue tmp, *tmp2;      #ifdef ENCODE_DEBUG    data->depth += 2;   #endif
pike.git/src/encode.c:2801:    }    dmalloc_touch_svalue(Pike_sp);    getdata3(p->constants[d].name);    }      #ifdef PIKE_DEBUG    {    int q;    for(q=0;q<p->num_inherits;q++)    if(!p->inherits[q].prog) -  fatal("FOOBAR!@!!!\n"); +  Pike_fatal("FOOBAR!@!!!\n");    }   #endif       if(placeholder && data->pass == 1)    {    if(!p || (placeholder->storage))    {    Pike_error("Placeholder already has storage!\n");    } else {    placeholder->storage=p->storage_needed ?
pike.git/src/encode.c:3571:    } else {    struct decode_data *d;    for (d = current_decode; d; d=d->next) {    if (d->next == data) {    d->next = d->next->next;    break;    }    }   #ifdef PIKE_DEBUG    if (!d) { -  fatal("Decode data fell off the stack!\n"); +  Pike_fatal("Decode data fell off the stack!\n");    }   #endif /* PIKE_DEBUG */    }          delay=unlink_current_supporter(&data->supporter);    call_dependants(& data->supporter, 1);       if(delay)    {    debug_malloc_touch(data);    /* We have been delayed */    return;    }       free_mapping(data->decoded);      #ifdef PIKE_DEBUG    if(data->unfinished_programs) -  fatal("We have unfinished programs left in decode()!\n"); +  Pike_fatal("We have unfinished programs left in decode()!\n");    if(data->unfinished_objects) -  fatal("We have unfinished objects left in decode()!\n"); +  Pike_fatal("We have unfinished objects left in decode()!\n");   #endif       while(data->unfinished_programs)    {    struct unfinished_prog_link *tmp=data->unfinished_programs;    data->unfinished_programs=tmp->next;    free((char *)tmp);    }       while(data->unfinished_objects)