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.205 2003/11/26 09:43:43 grubba Exp $ + || $Id: encode.c,v 1.206 2003/12/11 17:16:58 grubba 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:25:   #include "fsort.h"   #include "threads.h"   #include "stuff.h"   #include "version.h"   #include "bignum.h"   #include "pikecode.h"   #include "pike_types.h"   #include "opcodes.h"   #include "peep.h"    - RCSID("$Id: encode.c,v 1.205 2003/11/26 09:43:43 grubba Exp $"); + RCSID("$Id: encode.c,v 1.206 2003/12/11 17:16:58 grubba 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:3740:    "Bad function type (not a type): ");    }       /* func_flags (aka identifier_flags) */    decode_number(func_flags, data);       /* func */    decode_number(func.offset, data);    if (bytecode_method == PIKE_BYTECODE_PORTABLE &&    func.offset != -1) { + #ifdef ENCODE_DEBUG +  int old_a_flag; + #endif    EDB(2, -  +  {    fprintf(stderr, "%*sDecoding portable bytecode.\n", -  data->depth, "")); +  data->depth, ""); +  old_a_flag = a_flag; +  a_flag = (a_flag > (data->debug-1))?a_flag:(data->debug-1); +  });    func.offset = decode_portable_bytecode(func.offset); -  +  EDB(2, a_flag = old_a_flag);    }       /* opt_flags */    decode_number(opt_flags, data);       /* FIXME:    * Verify validity of func_flags, func.offset & opt_flags    */       /* Expected identifier offset */
pike.git/src/encode.c:4037:       /* Decode the actual constants    *    * This must be done after the program has been ended.    */    for (e=0; e<local_num_constants; e++) {    struct program_constant *constant = p->constants+e;    if ((constant->sval.type != T_INT) ||    (constant->sval.subtype != NUMBER_UNDEFINED)) {    /* Already initialized. */ +  EDB(5, +  fprintf(stderr, "%*sskipping constant %d\n", +  data->depth, "", e));    continue;    }    /* value */    decode_value2(data);    /* name */    decode_value2(data);    if (Pike_sp[-1].type == T_STRING) {    constant->name = Pike_sp[-1].u.string;    } else if ((Pike_sp[-1].type == T_INT) &&    !Pike_sp[-1].u.integer) {    constant->name = NULL;    } else {    ref_push_program (p);    decode_error(Pike_sp - 1, Pike_sp - 2,    "Name of constant is not a string: ");    }    constant->sval = Pike_sp[-2];    dmalloc_touch_svalue(Pike_sp-1);    dmalloc_touch_svalue(Pike_sp-2);    Pike_sp -= 2; -  +  EDB(5, +  fprintf(stderr, "%*sDecoded constant %d to a %s\n", +  data->depth, "", +  e, get_name_of_type(constant->sval.type)));    }       data->pickyness--;       /* The program should be consistent now. */    p->flags &= ~PROGRAM_AVOID_CHECK;       EDB(5, fprintf(stderr, "%*sProgram flags: 0x%04x\n",    data->depth, "", p->flags));