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.278 2008/06/11 17:25:10 grubba Exp $ + || $Id: encode.c,v 1.279 2008/06/11 18:18:39 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:219:       if(num < MAX_SMALL)    {    tag |= TAG_SMALL | (num << SIZE_SHIFT);    addchar((char)tag);    return;    }else{    num -= MAX_SMALL;    }    -  for(t = 0; (size_t)t < 7; t++) +  /* NB: There's only space for two bits of length info. */ +  for(t = 0; (size_t)t < 3; t++)    {    if(num >= (((INT64)256) << (t<<3)))    num -= (((INT64)256) << (t<<3));    else    break;    }       tag |= t << SIZE_SHIFT;    addchar((char)tag);       switch(t)    { -  + #if 0    case 7: addchar(DO_NOT_WARN((char)((num >> 56)&0xff)));    case 6: addchar(DO_NOT_WARN((char)((num >> 48)&0xff)));    case 5: addchar(DO_NOT_WARN((char)((num >> 40)&0xff)));    case 4: addchar(DO_NOT_WARN((char)((num >> 32)&0xff))); -  + #endif /* 0 */    case 3: addchar(DO_NOT_WARN((char)((num >> 24)&0xff)));    case 2: addchar(DO_NOT_WARN((char)((num >> 16)&0xff)));    case 1: addchar(DO_NOT_WARN((char)((num >> 8)&0xff)));    case 0: addchar(DO_NOT_WARN((char)(num&0xff)));    }   }      static void code_number(ptrdiff_t num, struct encode_data *data)   {    EDB(5, fprintf(stderr, "%*scode_number(%d)\n",
pike.git/src/encode.c:1126:    code_number(p->inherits[d].identifier_level,data);    code_number(p->inherits[d].parent_offset,data);    code_number(p->inherits[d].parent_identifier,data);    code_number(p->inherits[d].storage_offset,data);       if(p->inherits[d].parent)    {    ref_push_function(p->inherits[d].parent,    p->inherits[d].parent_identifier);    EDB(3,fprintf(stderr,"INHERIT%x coded as func { %p, %d }\n", -  p->id, p->inherits[d].parent, p->inherits[d].parent_identifier);); +  p->id, p->inherits[d].parent, +  p->inherits[d].parent_identifier););    }else if(p->inherits[d].prog){    ref_push_program(p->inherits[d].prog);    }else{    Pike_error("Failed to encode inherit #%d\n", d);    push_int(0);    }    encode_value2(Pike_sp-1,data, 1);    pop_stack();       adddata3(p->inherits[d].name);