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.162 2003/01/26 11:09:01 mirar Exp $ + || $Id: encode.c,v 1.163 2003/01/26 16:22:50 mirar 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.162 2003/01/26 11:09:01 mirar Exp $"); + RCSID("$Id: encode.c,v 1.163 2003/01/26 16:22:50 mirar 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:466:    }    fputc('\n', stderr););    mapping_insert(data->encoded, val, &data->counter);    data->counter.u.integer++;    }          switch(val->type)    {    case T_INT: -  /* FIXME: -  * if INT_TYPE is larger than 32 bits (not currently happening) -  * then this must be fixed to encode numbers over 32 bits as -  * Gmp.mpz objects -  * -  * (Is too, --with-long-long-int. /Mirar) -  */ +     /* FIXME: Doesn't encode NUMBER_UNDEFINED et al. */ -  +  + #if SIZEOF_INT_TYPE > 4 +  { +  INT_TYPE i=val->u.integer; +  if (i != (INT32)i) +  { +  push_int(i); +  convert_stack_top_to_bignum(); +  encode_value2(Pike_sp-1,data); +  pop_stack(); +  return; +  } +  else +  code_entry(TAG_INT, i,data); +  } + #else    code_entry(TAG_INT, val->u.integer,data); -  + #endif    break;       case T_STRING:    adddata(val->u.string);    break;       case T_TYPE:    /* NOTE: Types are added to the encoded mapping AFTER they have    * been encoded, to simplify decoding.    */