pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:12:   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"   #include "bignum.h"   #include "interpret.h"   #include "operators.h"   #include "pike_float.h"   #include "pike_types.h"   #include "block_allocator.h"   #include "whitespace.h" - #include "stuff.h" +       #include <errno.h>      #define SET_HSIZE(X) htable_mask=(htable_size=(X))-1   #define HMODULO(X) ((X) & (htable_mask))      static unsigned INT32 htable_mask;      #if (SIZEOF_LONG == 4) && defined(_LP64)   /* Kludge for gcc and the system header files not using the same model... */
pike.git/src/stralloc.c:2277:   {    switch(ptr.shift)    {    case eightbit: return MKPCHARP(memchr(ptr.ptr,chr,len),0);    case sixteenbit: return MKPCHARP(MEMCHR1((p_wchar1 *)ptr.ptr,chr,len),1);    case thirtytwobit: return MKPCHARP(MEMCHR2((p_wchar2 *)ptr.ptr,chr,len),2);    }    UNREACHABLE(MKPCHARP(0,0));   }    + const unsigned char hexdecode[256] = + { +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  +  /* '0' - '9' */ +  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, +  +  16,16,16,16,16,16,16, +  +  /* 'A' - 'F' */ +  10, 11, 12, 13, 14, 15, +  +  16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16, +  +  /* 'a' - 'f' */ +  10, 11, 12, 13, 14, 15, +  +  16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + }; +    #define DIGIT(x) ( (x)<256 ? hexdecode[x] : 16 )   #define MBASE ('z' - 'a' + 1 + 10)      PMOD_EXPORT long STRTOL_PCHARP(PCHARP str, PCHARP *ptr, int base)   {    /* Note: Code duplication in pcharp_to_svalue_inumber. */       unsigned long val, mul_limit;    int c;    int xx, neg = 0, add_limit, overflow = 0;