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.115 2001/07/20 16:21:31 grubba Exp $"); + RCSID("$Id: encode.c,v 1.116 2001/07/22 21:16:21 grubba Exp $");      /* #define ENCODE_DEBUG */      #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 if (data->debug>=N) {X;} while (0)   #else   #define EDB(N,X) do {} while (0)   #endif
pike.git/src/encode.c:908:    else    push_int(0);    encode_value2(Pike_sp-1,data);    pop_stack();      #define FOO(X,Y,Z) \    code_number( p->PIKE_CONCAT(num_,Z), data);   #include "program_areas.h"      #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" +  "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 */   #ifdef PIKE_USE_MACHINE_CODE    adddata2(p->relocations, p->num_relocations);   #endif /* PIKE_USE_MACHINE_CODE */       adddata2(p->linenumbers, p->num_linenumbers);       for(d=0;d<p->num_identifier_index;d++)