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.85 2000/07/28 17:16:55 hubbe Exp $"); + RCSID("$Id: stralloc.c,v 1.86 2000/08/03 16:30:16 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:404:    if(old_base)    free((char *)old_base);   }         /*** Make new strings ***/      /* note that begin_shared_string expects the _exact_ size of the string,    * not the maximum size    */ - PMOD_EXPORT struct pike_string *debug_begin_shared_string(int len) + PMOD_EXPORT struct pike_string *debug_begin_shared_string(size_t len)   {    struct pike_string *t;   #ifdef PIKE_DEBUG    extern int d_flag;    if(d_flag>10)    verify_shared_strings_tables();   #endif    t=(struct pike_string *)xalloc(len + sizeof(struct pike_string));    t->str[len]=0;    t->len=len;
pike.git/src/stralloc.c:464: Inside #if undefined(HASH_PREFIX)
      tmp2->next=base_table[h2]; /* and re-hash */    base_table[h2]=tmp2;    }    }    full_hash_value=save_full_hash_value;    }   #endif   }    - PMOD_EXPORT struct pike_string *debug_begin_wide_shared_string(int len, int shift) + PMOD_EXPORT struct pike_string *debug_begin_wide_shared_string(size_t len, int shift)   {    struct pike_string *t;   #ifdef PIKE_DEBUG    extern int d_flag;    if(d_flag>10)    verify_shared_strings_tables();   #endif    t=(struct pike_string *)xalloc((len<<shift) + sizeof(struct pike_string));    t->len=len;    t->size_shift=shift;
pike.git/src/stralloc.c:558:    }    break;       case 0: break;    }       return low_end_shared_string(s);   }       - PMOD_EXPORT struct pike_string * debug_make_shared_binary_string(const char *str,int len) + PMOD_EXPORT struct pike_string * debug_make_shared_binary_string(const char *str,size_t len)   {    struct pike_string *s;    int h=StrHash(str,len);       s = internal_findstring(str,len,0,h);    if (!s)    {    s=begin_shared_string(len);    MEMCPY(s->str, str, len);    link_pike_string(s, h);    }       add_ref(s);       return s;   }    - PMOD_EXPORT struct pike_string * debug_make_shared_binary_pcharp(const PCHARP str,int len) + PMOD_EXPORT struct pike_string * debug_make_shared_binary_pcharp(const PCHARP str,size_t len)   {    switch(str.shift)    {    case 0:    return make_shared_binary_string((char *)(str.ptr), len);    case 1:    return make_shared_binary_string1((p_wchar1 *)(str.ptr), len);    case 2:    return make_shared_binary_string2((p_wchar2 *)(str.ptr), len);    default:
pike.git/src/stralloc.c:598:    }    /* NOT REACHED */    return NULL; /* Keep the compiler happy */   }      PMOD_EXPORT struct pike_string * debug_make_shared_pcharp(const PCHARP str)   {    return debug_make_shared_binary_pcharp(str, pcharp_strlen(str));   }    - PMOD_EXPORT struct pike_string * debug_make_shared_binary_string0(const p_wchar0 *str,int len) + PMOD_EXPORT struct pike_string * debug_make_shared_binary_string0(const p_wchar0 *str,size_t len)   {    return debug_make_shared_binary_string((const char *)str, len);   }    - PMOD_EXPORT struct pike_string * debug_make_shared_binary_string1(const p_wchar1 *str,int len) + PMOD_EXPORT struct pike_string * debug_make_shared_binary_string1(const p_wchar1 *str,size_t len)   {    struct pike_string *s;    int h;       if(!find_magnitude1(str,len))    {    /* Wrong size, convert */    s=begin_shared_string(len);    convert_1_to_0(STR0(s),str,len);    return end_shared_string(s);
pike.git/src/stralloc.c:631:    s=begin_wide_shared_string(len,1);    MEMCPY(s->str, str, len<<1);    link_pike_string(s, h);    }       add_ref(s);       return s;   }    - PMOD_EXPORT struct pike_string * debug_make_shared_binary_string2(const p_wchar2 *str,int len) + PMOD_EXPORT struct pike_string * debug_make_shared_binary_string2(const p_wchar2 *str,size_t len)   {    struct pike_string *s;    int h;       switch(find_magnitude2(str,len))    {    case 0:    /* Wrong size, convert */    s=begin_shared_string(len);    convert_2_to_0(STR0(s),str,len);