pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:20:      #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.142 2002/05/31 22:41:26 nilsson Exp $"); + RCSID("$Id: stralloc.c,v 1.143 2002/08/15 14:49:25 marcus Exp $");      /* #define STRALLOC_USE_PRIMES */      #ifdef STRALLOC_USE_PRIMES      #define SET_HSIZE(X) htable_size=hashprimes[(X)]   #define HMODULO(X) ((X) % htable_size)      #else   
pike.git/src/stralloc.c:144:   }      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"); +  Pike_fatal("Illegal shift size!\n");    return 0;   }      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 %ld is out of range [0 - %ld]!\n", +  Pike_fatal("String index %ld is out of range [0 - %ld]!\n",    DO_NOT_WARN((long)pos),    DO_NOT_WARN((long)s->len-1));    } else { -  fatal("Attempt to index the empty string with %ld!\n", +  Pike_fatal("Attempt to index the empty string with %ld!\n",    DO_NOT_WARN((long)pos));    }    }   #endif    return generic_extract(s->str,s->size_shift,pos);   }      PMOD_EXPORT INLINE void low_set_index(struct pike_string *s, ptrdiff_t pos,    int value)   {   #ifdef PIKE_DEBUG    if(pos > s->len || pos<0) -  fatal("string index out of range!\n"); +  Pike_fatal("string index out of range!\n");       if(pos == s->len && value) -  fatal("string zero termination foul!\n"); +  Pike_fatal("string zero termination foul!\n");   #endif    switch(s->size_shift)    {    case 0: STR0(s)[pos]=value; break;    case 1: STR1(s)[pos]=value; break;    case 2: STR2(s)[pos]=value; break;    default: -  fatal("Illegal shift size!\n"); +  Pike_fatal("Illegal shift size!\n");    }   }      #ifdef PIKE_DEBUG   PMOD_EXPORT INLINE struct pike_string *debug_check_size_shift(struct pike_string *a,int shift)   {    if(a->size_shift != shift) -  fatal("Wrong STRX macro used!\n"); +  Pike_fatal("Wrong STRX macro used!\n");    return a;   }   #endif      #define CONVERT(FROM,TO) \   INLINE void PIKE_CONCAT4(convert_,FROM,_to_,TO)(PIKE_CONCAT(p_wchar,TO) *to, const PIKE_CONCAT(p_wchar,FROM) *from, ptrdiff_t len) \   { while(--len>=0) *(to++)=*(from++); } \   INLINE INT32 PIKE_CONCAT4(compare_,FROM,_to_,TO)(const PIKE_CONCAT(p_wchar,TO) *to, const PIKE_CONCAT(p_wchar,FROM) *from, ptrdiff_t len) \   { int tmp; while(--len>=0) if((tmp=*(to++)-*(from++))) return tmp; return 0; }   
pike.git/src/stralloc.c:234:    }   }         PMOD_EXPORT void generic_memcpy(PCHARP to,    PCHARP from,    ptrdiff_t len)   {   #ifdef PIKE_DEBUG    if(len<0) -  fatal("Cannot copy %ld bytes!\n", +  Pike_fatal("Cannot copy %ld bytes!\n",    DO_NOT_WARN((long)len));   #endif       switch(TWO_SIZES(from.shift,to.shift))    {    case TWO_SIZES(0,0):    convert_0_to_0((p_wchar0 *)to.ptr,(p_wchar0 *)from.ptr,len);    break;    case TWO_SIZES(0,1):    convert_0_to_1((p_wchar1 *)to.ptr,(p_wchar0 *)from.ptr,len);
pike.git/src/stralloc.c:360:    size_t h;    LOCK_BUCKET(hval);    h=HMODULO(hval);    for(base = prev = base_table + h;( curr=*prev ); prev=&curr->next)    {   #ifdef PIKE_DEBUG    if(curr->refs<1)    {    debug_dump_pike_string(curr, 70);    locate_problem(has_zero_refs); -  fatal("String with no references.\n"); +  Pike_fatal("String with no references.\n");    }   #endif    debug_malloc_touch(curr);       if (hval == curr->hval &&    len==curr->len &&    size_shift==curr->size_shift &&    ( curr->str == s ||    !MEMCMP(curr->str, s,len<<size_shift))) /* found it */    {
pike.git/src/stralloc.c:429:    *prev=curr->next;    curr->next=*base;    *base=curr;    return curr;    }   #ifdef PIKE_DEBUG    if(curr->refs<1)    {    debug_dump_pike_string(curr, 70);    locate_problem(has_zero_refs); -  fatal("String with no references.\n"); +  Pike_fatal("String with no references.\n");    }   #endif    }    return 0; /* not found */   }      /*** rehash ***/      static void rehash_string_backwards(struct pike_string *s)   {
pike.git/src/stralloc.c:523:   BLOCK_ALLOC(short_pike_string1, SHORT_STRING_BLOCK)   BLOCK_ALLOC(short_pike_string2, SHORT_STRING_BLOCK)      #define really_free_short_pike_string(s) do { \    if (!s->size_shift) { \    really_free_short_pike_string0((struct short_pike_string0 *)s); \    } else if (s->size_shift == 1) { \    really_free_short_pike_string1((struct short_pike_string1 *)s); \    DO_IF_DEBUG( \    } else if (s->size_shift != 2) { \ -  fatal("Unsupported string shift: %d\n", s->size_shift); \ +  Pike_fatal("Unsupported string shift: %d\n", s->size_shift); \    ) \    } else { \    really_free_short_pike_string2((struct short_pike_string2 *)s); \    } \    } while(0)      #define really_free_pike_string(s) do { \    if (s->len <= SHORT_STRING_THRESHOLD) { \    really_free_short_pike_string(s); \    } else { \
pike.git/src/stralloc.c:637: Inside #if defined(PIKE_DEBUG)
   if(d_flag>10)    verify_shared_strings_tables();   #endif    if (len <= SHORT_STRING_THRESHOLD) {    if (!shift) {    t = (struct pike_string *)alloc_short_pike_string0();    } else if (shift == 1) {    t = (struct pike_string *)alloc_short_pike_string1();   #ifdef PIKE_DEBUG    } else if (shift != 2) { -  fatal("Unsupported string shift: %d\n", shift); +  Pike_fatal("Unsupported string shift: %d\n", shift);   #endif /* PIKE_DEBUG */    } else {    t = (struct pike_string *)alloc_short_pike_string2();    }    } else {    t=(struct pike_string *)xalloc((len<<shift) + sizeof(struct pike_string));    }    t->len=len;    t->size_shift=shift;    low_set_index(t,len,0);
pike.git/src/stralloc.c:666:   {    ptrdiff_t len;    size_t h;    struct pike_string *s2;       len = s->len;    h = do_hash(s);    s2 = internal_findstring(s->str, len, s->size_shift, h);   #ifdef PIKE_DEBUG    if(s2==s) -  fatal("end_shared_string called twice! (or something like that)\n"); +  Pike_fatal("end_shared_string called twice! (or something like that)\n");   #endif       if(s2)    {    really_free_pike_string(s);    s = s2;    }else{    link_pike_string(s, h);    }    add_ref(s);
pike.git/src/stralloc.c:693:    * This function checks if the shift size can be decreased before    * entering the string in the shared string table    */   PMOD_EXPORT struct pike_string *end_shared_string(struct pike_string *s)   {    struct pike_string *s2;       switch(s->size_shift)    {    default: -  fatal("ARGHEL! size_shift:%d\n", s->size_shift); +  Pike_fatal("ARGHEL! size_shift:%d\n", s->size_shift);       case 2:    switch(find_magnitude2(STR2(s),s->len))    {    case 0:    s2=begin_shared_string(s->len);    convert_2_to_0(STR0(s2),STR2(s),s->len);    really_free_pike_string(s);    s=s2;    break;
pike.git/src/stralloc.c:735:    }       return low_end_shared_string(s);   }      PMOD_EXPORT struct pike_string *end_and_resize_shared_string(struct pike_string *str, ptrdiff_t len)   {    struct pike_string *tmp;   #ifdef PIKE_DEBUG    if(len > str->len) -  fatal("Cannot extend string here!\n"); +  Pike_fatal("Cannot extend string here!\n");   #endif    if( str->len <= SHORT_STRING_THRESHOLD ?    (len <= SHORT_STRING_THRESHOLD) :    (len > SHORT_STRING_THRESHOLD) && str->len > len/2 )    {    str->len=len;    str->str[len]=0;    return end_shared_string(str);    }    tmp = make_shared_binary_pcharp(MKPCHARP_STR(str),len);
pike.git/src/stralloc.c:780:   {    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: -  fatal("Unknown string width!\n"); +  Pike_fatal("Unknown string width!\n");    }    /* 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));   }   
pike.git/src/stralloc.c:893:   /*** Free strings ***/      PMOD_EXPORT void unlink_pike_string(struct pike_string *s)   {    size_t h;    LOCK_BUCKET(s->hval);    h= HMODULO(s->hval);    propagate_shared_string(s,h);   #ifdef PIKE_DEBUG    if (base_table[h] != s) { -  fatal("propagate_shared_string() failed. Probably got bogus pike_string.\n"); +  Pike_fatal("propagate_shared_string() failed. Probably got bogus pike_string.\n");    }   #endif /* PIKE_DEBUG */    base_table[h]=s->next;   #ifdef PIKE_DEBUG    s->next=(struct pike_string *)(ptrdiff_t)-1;   #endif    num_strings--;    UNLOCK_BUCKET(s->hval);   }   
pike.git/src/stralloc.c:928:    if (s)    really_free_pike_string(s);   }      PMOD_EXPORT void really_free_string(struct pike_string *s)   {   #ifdef PIKE_DEBUG    extern int d_flag;    if (d_flag) {    if (s->refs) { -  fatal("Freeing string with references!\n"); +  Pike_fatal("Freeing string with references!\n");    }    if(d_flag > 2)    {    if(s->next == (struct pike_string *)(ptrdiff_t)-1) -  fatal("Freeing shared string again!\n"); +  Pike_fatal("Freeing shared string again!\n");       if(((ptrdiff_t)s->next) & 1) -  fatal("Freeing shared string again, memory corrupt or other bug!\n"); +  Pike_fatal("Freeing shared string again, memory corrupt or other bug!\n");    }    }    if ((s->size_shift < 0) || (s->size_shift > 2)) { -  fatal("Freeing string with bad shift (0x%08x); could it be a type?\n", +  Pike_fatal("Freeing string with bad shift (0x%08x); could it be a type?\n",    s->size_shift);    }   #endif    unlink_pike_string(s);    really_free_pike_string(s);    GC_FREE_SIMPLE_BLOCK(s);   }      PMOD_EXPORT void debug_free_string(struct pike_string *s)   {
pike.git/src/stralloc.c:1022: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG      static long last_stralloc_verify=0;   extern long current_do_debug_cycle;      PMOD_EXPORT void check_string(struct pike_string *s)   {    if(current_do_debug_cycle == last_stralloc_verify)    {    if(debug_findstring(s) !=s) -  fatal("Shared string not shared.\n"); +  Pike_fatal("Shared string not shared.\n");    }else{    if(do_hash(s) != s->hval)    {    locate_problem(wrong_hash); -  fatal("Hash value changed?\n"); +  Pike_fatal("Hash value changed?\n");    }       if(debug_findstring(s) !=s) -  fatal("Shared string not shared.\n"); +  Pike_fatal("Shared string not shared.\n");       if(index_shared_string(s,s->len))    {    locate_problem(improper_zero_termination); -  fatal("Shared string is not zero terminated properly.\n"); +  Pike_fatal("Shared string is not zero terminated properly.\n");    }    }   }      PMOD_EXPORT void verify_shared_strings_tables(void)   {    unsigned INT32 e, h, num=0;    struct pike_string *s;       last_stralloc_verify=current_do_debug_cycle;
pike.git/src/stralloc.c:1058: Inside #if defined(PIKE_DEBUG)
   for(e=0;e<htable_size;e++)    {    h=0;    LOCK_BUCKET(e);    for(s=base_table[e];s;s=s->next)    {    num++;    h++;       if (bad_pointer(s)) { -  fatal("Odd string pointer in string table!\n"); +  Pike_fatal("Odd string pointer in string table!\n");    }       if(s->len < 0) -  fatal("Shared string shorter than zero bytes.\n"); +  Pike_fatal("Shared string shorter than zero bytes.\n");       if(s->refs <= 0)    {    locate_problem(has_zero_refs); -  fatal("Shared string had too few references.\n"); +  Pike_fatal("Shared string had too few references.\n");    }       if(index_shared_string(s,s->len))    {    locate_problem(improper_zero_termination); -  fatal("Shared string didn't end with a zero.\n"); +  Pike_fatal("Shared string didn't end with a zero.\n");    }       if(do_hash(s) != s->hval) -  fatal("Shared string hashed to other number.\n"); +  Pike_fatal("Shared string hashed to other number.\n");       if(HMODULO(s->hval) != e)    {    locate_problem(wrong_hash); -  fatal("Shared string hashed to wrong place.\n"); +  Pike_fatal("Shared string hashed to wrong place.\n");    }       if(h>10000)    {    struct pike_string *s2;    for(s2=s;s2;s2=s2->next)    if(s2 == s) -  fatal("Shared string table is cyclic.\n"); +  Pike_fatal("Shared string table is cyclic.\n");    h=0;    }    }    UNLOCK_BUCKET(e);    }    if(num != num_strings) -  fatal("Num strings is wrong %d!=%d\n",num,num_strings); +  Pike_fatal("Num strings is wrong %d!=%d\n",num,num_strings);   }      PMOD_EXPORT int safe_debug_findstring(struct pike_string *foo)   {    unsigned INT32 e;    if(!base_table) return 0;    for(e=0;e<htable_size;e++)    {    struct pike_string *p;    LOCK_BUCKET(e);
pike.git/src/stralloc.c:1438:    * Phew, this function become complicated when I inserted magic for wide    * characters...    */   PMOD_EXPORT struct pike_string *modify_shared_string(struct pike_string *a,    INT32 index,    INT32 c)   {    INT32 old_value;   #ifdef PIKE_DEBUG    if(index<0 || index>=a->len) -  fatal("Index out of range in modify_shared_string()\n"); +  Pike_fatal("Index out of range in modify_shared_string()\n");   #endif          old_value=index_shared_string(a,index);    if(old_value==c) return a;       /* First test if the string needs to be grown:    * ie; the new value does not fit in the char size of    * the old string    */
pike.git/src/stralloc.c:1479:    return end_shared_string(b);       case TWO_SIZES(2,1):    b=begin_wide_shared_string(a->len,2);    convert_1_to_2(STR2(b),STR1(a),a->len);    STR2(b)[index]=c;    free_string(a);    return end_shared_string(b);       default: -  fatal("Odd wide string conversion!\n"); +  Pike_fatal("Odd wide string conversion!\n");    }    }          /* Next we test if the new string can be shrunk    * if all characters in the new string can fit in a string    * of a lower magnitude, it must be shrunk    */       if(min_magnitude(old_value) == a->size_shift &&    min_magnitude(c) < min_magnitude(old_value))    {    /* We *might* need to shrink the string */    struct pike_string *b;    int size,tmp;       switch(a->size_shift)    {    case 0: -  fatal("Unshrinkable!\n"); +  Pike_fatal("Unshrinkable!\n");       case 1:    /* Test if we *actually* can shrink it.. */    if(find_magnitude1(STR1(a),index)) break;    if(find_magnitude1(STR1(a)+index+1,a->len-index-1))    break;       b=begin_shared_string(a->len);    convert_1_to_0((p_wchar0 *)b->str,STR1(a),a->len);    b->str[index]=c;
pike.git/src/stralloc.c:1629:    r=mojt.vtab->funcN(mojt.data,    ADD_PCHARP(MKPCHARP_STR(haystack), start),    haystack->len - start).ptr;       mojt.vtab->freeme(mojt.data);       if(!r) return -1;   #ifdef PIKE_DEBUG    if((r < haystack->str) ||    (r - haystack->str)>>haystack->size_shift > haystack->len) -  fatal("string_search did a bobo!\n"); +  Pike_fatal("string_search did a bobo!\n");   #endif    return (r-haystack->str)>>haystack->size_shift;   }      PMOD_EXPORT struct pike_string *string_slice(struct pike_string *s,    ptrdiff_t start,    ptrdiff_t len)   {   #ifdef PIKE_DEBUG    if(start < 0 || len<0 || start+len>s->len )    { -  fatal("string_slice, start = %ld, len = %ld, s->len = %ld\n", +  Pike_fatal("string_slice, start = %ld, len = %ld, s->len = %ld\n",    DO_NOT_WARN((long)start),    DO_NOT_WARN((long)len),    DO_NOT_WARN((long)s->len));    }   #endif       if(start==0 && len==s->len)    {    add_ref(s);    return s;
pike.git/src/stralloc.c:1665:    {    case 0:    return make_shared_binary_string((char *)STR0(s)+start,len);       case 1:    return make_shared_binary_string1(STR1(s)+start,len);       case 2:    return make_shared_binary_string2(STR2(s)+start,len);    } -  fatal("Illegal shift size!\n"); +  Pike_fatal("Illegal shift size!\n");    return 0;   }      /*** replace function ***/   typedef char *(* replace_searchfunc)(void *,void *,size_t);   PMOD_EXPORT struct pike_string *string_replace(struct pike_string *str,    struct pike_string *del,    struct pike_string *to)   {    struct pike_string *ret;
pike.git/src/stralloc.c:1720:    del->len,    str->len,    del);    ret=begin_wide_shared_string(str->len,shift);    switch(str->size_shift)    {    case 0: f=(replace_searchfunc)mojt.vtab->func0; break;    case 1: f=(replace_searchfunc)mojt.vtab->func1; break;    case 2: f=(replace_searchfunc)mojt.vtab->func2; break;   #ifdef PIKE_DEBUG -  default: fatal("Illegal shift.\n"); +  default: Pike_fatal("Illegal shift.\n");   #endif    }       }else{    INT32 delimeters=0;    mojt=compile_memsearcher(MKPCHARP_STR(del),    del->len,    str->len*2,    del);       switch(str->size_shift)    {    case 0: f=(replace_searchfunc)mojt.vtab->func0; break;    case 1: f=(replace_searchfunc)mojt.vtab->func1; break;    case 2: f=(replace_searchfunc)mojt.vtab->func2; break;   #ifdef PIKE_DEBUG -  default: fatal("Illegal shift.\n"); +  default: Pike_fatal("Illegal shift.\n");   #endif    }       while((s = f(mojt.data, s, (end-s)>>str->size_shift)))    {    delimeters++;    s+=del->len << str->size_shift;    }       if(!delimeters)
pike.git/src/stralloc.c:1763:       ret=begin_wide_shared_string(str->len + (to->len-del->len)*delimeters, shift);    }    s=str->str;    r=MKPCHARP_STR(ret);       while((tmp = f(mojt.data, s, (end-s)>>str->size_shift)))    {   #ifdef PIKE_DEBUG    if(tmp + (del->len << str->size_shift) > end) -  fatal("generic_memory_search found a match beyond end of string!!!\n"); +  Pike_fatal("generic_memory_search found a match beyond end of string!!!\n");   #endif    generic_memcpy(r,MKPCHARP(s,str->size_shift),(tmp-s)>>str->size_shift);    INC_PCHARP(r,(tmp-s)>>str->size_shift);    pike_string_cpy(r,to);    INC_PCHARP(r,to->len);    s=tmp+(del->len << str->size_shift);    }    generic_memcpy(r,MKPCHARP(s,str->size_shift),(end-s)>>str->size_shift);       mojt.vtab->freeme(mojt.data);
pike.git/src/stralloc.c:1881:    LOCK_BUCKET(e);    for(p=base_table[e];p;p=p->next)    {    num_++;    size_+=sizeof(struct pike_string)+(p->len<<p->size_shift);    }    UNLOCK_BUCKET(e);    }   #ifdef PIKE_DEBUG    if(num_strings != num_) -  fatal("Num strings is wrong! %d!=%d.\n",num_strings, num_); +  Pike_fatal("Num strings is wrong! %d!=%d.\n",num_strings, num_);   #endif    num[0]=num_;    size[0]=size_;   }      #ifdef PIKE_DEBUG   unsigned gc_touch_all_strings(void)   {    unsigned INT32 e;    unsigned n = 0;
pike.git/src/stralloc.c:2013:      PMOD_EXPORT void string_builder_binary_strcat(struct string_builder *s, char *str, ptrdiff_t len)   {    string_build_mkspace(s,len,0);    switch(s->s->size_shift)    {    case 0: convert_0_to_0(STR0(s->s)+s->s->len,(p_wchar0 *)str,len); break;    case 1: convert_0_to_1(STR1(s->s)+s->s->len,(p_wchar0 *)str,len); break;    case 2: convert_0_to_2(STR2(s->s)+s->s->len,(p_wchar0 *)str,len); break;    default: -  fatal("Illegal magnitude!\n"); +  Pike_fatal("Illegal magnitude!\n");    }    s->s->len+=len;    /* Ensure NUL-termination */    s->s->str[s->s->len << s->s->size_shift] = 0;   }         PMOD_EXPORT void string_builder_append(struct string_builder *s,    PCHARP from,    ptrdiff_t len)
pike.git/src/stralloc.c:2051:    ptrdiff_t howmany,    PCHARP from,    ptrdiff_t len,    ptrdiff_t offset)   {    ptrdiff_t tmp;    int shift;      #ifdef PIKE_DEBUG    if(len<=0) -  fatal("Cannot fill with zero length strings!\n"); +  Pike_fatal("Cannot fill with zero length strings!\n");   #endif    if(howmany<=0) return;       if(!s->s->size_shift &&    len == 1 &&    (!from.shift || !min_magnitude(EXTRACT_PCHARP(from))))    {    MEMSET(string_builder_allocate(s,howmany,0),    EXTRACT_PCHARP(from),    howmany);
pike.git/src/stralloc.c:2162:   }      PMOD_EXPORT PCHARP MEMCHR_PCHARP(PCHARP ptr, int chr, ptrdiff_t len)   {    switch(ptr.shift)    {    case 0: return MKPCHARP(MEMCHR0(ptr.ptr,chr,len),0);    case 1: return MKPCHARP(MEMCHR1((p_wchar1 *)ptr.ptr,chr,len),1);    case 2: return MKPCHARP(MEMCHR2((p_wchar2 *)ptr.ptr,chr,len),2);    } -  fatal("Illegal shift in MEMCHR_PCHARP.\n"); +  Pike_fatal("Illegal shift in MEMCHR_PCHARP.\n");    return MKPCHARP(0,0); /* make wcc happy */   }      #define DIGIT(x) (WIDE_ISDIGIT(x) ? (x) - '0' : \    WIDE_ISLOWER(x) ? (x) + 10 - 'a' : (x) + 10 - 'A')   #define MBASE ('z' - 'a' + 1 + 10)      PMOD_EXPORT long STRTOL_PCHARP(PCHARP str, PCHARP *ptr, int base)   {    register long val;
pike.git/src/stralloc.c:2569:    switch(s->size_shift)    {    case 0:    *to_free=0;    return STR0(s);    case 1:    case 2:    return 0;       default: -  fatal("Illegal shift size in string.\n"); +  Pike_fatal("Illegal shift size in string.\n");    }    return 0;   }      PMOD_EXPORT p_wchar1 *require_wstring1(struct pike_string *s,    char **to_free)   {    switch(s->size_shift)    {    case 0:
pike.git/src/stralloc.c:2592:    return (p_wchar1 *)*to_free;       case 1:    *to_free=0;    return STR1(s);       case 2:    return 0;       default: -  fatal("Illegal shift size in string.\n"); +  Pike_fatal("Illegal shift size in string.\n");    }    return 0;   }         PMOD_EXPORT p_wchar2 *require_wstring2(struct pike_string *s,    char **to_free)   {    switch(s->size_shift)    {
pike.git/src/stralloc.c:2618:    case 1:    *to_free=xalloc((s->len+1)*4);    convert_1_to_2((p_wchar2 *)*to_free, STR1(s),s->len+1);    return (p_wchar2 *)*to_free;       case 2:    *to_free=0;    return STR2(s);       default: -  fatal("Illegal shift size in string.\n"); +  Pike_fatal("Illegal shift size in string.\n");    }    return 0;   }