pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:18:   #include "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.62 2000/07/07 19:27:12 grubba Exp $"); + RCSID("$Id: encode.c,v 1.63 2000/08/10 09:01:00 grubba Exp $");      /* #define ENCODE_DEBUG */      #ifdef ENCODE_DEBUG   #define EDB(X) X   #else   #define EDB(X)   #endif      /* The sp macro conflicts with Solaris 2.5.1's <sys/conf.h>. */
pike.git/src/encode.c:179:   /* NOTE: Fix when type encodings change. */   static int type_to_tag(int type)   {    if (type == T_FLOAT) return TAG_FLOAT;    if (type == T_TYPE) return TAG_TYPE;    return type;   }   static int (*tag_to_type)(int) = type_to_tag;      /* Let's cram those bits... */ - static void code_entry(int tag, INT32 num, struct encode_data *data) + static void code_entry(int tag, ptrdiff_t num, struct encode_data *data)   {    int t;    EDB( -  fprintf(stderr,"encode: code_entry(tag=%d (%s), num=%d)\n", +  fprintf(stderr,"encode: code_entry(tag=%d (%s), num=%ld)\n",    tag,    get_name_of_type(tag_to_type(tag)), -  num) ); +  (long)num) );    if(num<0)    {    tag |= TAG_NEG;    num = ~num;    }       if(num < MAX_SMALL)    {    tag |= TAG_SMALL | (num << SIZE_SHIFT);    addchar(tag);
pike.git/src/encode.c:222:       switch(t)    {    case 3: addchar((num >> 24)&0xff);    case 2: addchar((num >> 16)&0xff);    case 1: addchar((num >> 8)&0xff);    case 0: addchar(num&0xff);    }   }    - static void code_number(INT32 num, struct encode_data *data) + static void code_number(ptrdiff_t num, struct encode_data *data)   {    code_entry(num & 15, num >> 4, data);   }      #ifdef _REENTRANT   static void do_enable_threads(void)   {    exit_threads_disable(NULL);   }   #endif
pike.git/src/encode.c:1595:   /* Compatibilidy decoder */      static unsigned char extract_char(char **v, INT32 *l)   {    if(!*l) error("Format error, not enough place for char.\n");    else (*l)--;    (*v)++;    return ((unsigned char *)(*v))[-1];   }    - static INT32 extract_int(char **v, INT32 *l) + static ptrdiff_t extract_int(char **v, INT32 *l)   { -  INT32 j,i; +  INT32 j; +  ptrdiff_t i;       j=extract_char(v,l);    if(j & 0x80) return (j & 0x7f);       if((j & ~8) > 4)    error("Format Error: Error in format string, invalid integer.\n");    i=0;    while(j & 7) { i=(i<<8) | extract_char(v,l); j--; }    if(j & 8) return -i;    return i;