pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:18:      #include <errno.h>   #include <float.h>   #include <ctype.h>   #include <math.h>      #ifndef HUGE   #define HUGE HUGE_VAL   #endif /*!HUGE*/    - RCSID("$Id: stralloc.c,v 1.87 2000/08/04 14:49:59 grubba Exp $"); + RCSID("$Id: stralloc.c,v 1.88 2000/08/04 18:07:51 grubba Exp $");      #define BEGIN_HASH_SIZE 997   #define MAX_AVG_LINK_LENGTH 3      /* Experimental dynamic hash length */   #ifndef HASH_PREFIX   static unsigned int HASH_PREFIX=64;   static unsigned int need_more_hash_prefix=0;   #endif   
pike.git/src/stralloc.c:84:    return 0;   }      static INLINE int min_magnitude(const unsigned INT32 c)   {    if(c<256) return 0;    if(c<65536) return 1;    return 2;   }    - static INLINE unsigned INT32 generic_extract (const void *str, int size, int pos) + static INLINE unsigned INT32 generic_extract (const void *str, int size, ptrdiff_t pos)   {    switch(size)    {    case 0: return ((unsigned char *)str)[pos];    case 1: return ((unsigned INT16 *)str)[pos];    case 2: return ((unsigned INT32 *)str)[pos];    }    fatal("Illegal shift size!\n");    return 0;   }    - PMOD_EXPORT INLINE unsigned INT32 index_shared_string(struct pike_string *s, int pos) + PMOD_EXPORT INLINE unsigned INT32 index_shared_string(struct pike_string *s, ptrdiff_t pos)   {   #ifdef PIKE_DEBUG    if(pos > s->len || pos<0) {    if (s->len) {    fatal("String index %d is out of range [0 - %d]!\n", pos, s->len-1);    } else {    fatal("Attempt to index the empty string with %d!\n", pos);    }    }   #endif