pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:336:   CONVERT(2,1)      #define TWO_SIZES(X,Y) (((X)<<2)+(Y))      void generic_memcpy(PCHARP to,    const PCHARP from,    ptrdiff_t len)   {   #ifdef PIKE_DEBUG    if(len<0) -  Pike_fatal("Cannot copy %ld bytes!\n", -  DO_NOT_WARN((long)len)); +  Pike_fatal("Cannot copy %ld bytes!\n", (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);    break;
pike.git/src/stralloc.c:1219:    ptrdiff_t overhead;    if (!num_distinct_strings[e]) continue;    if (shift != 3) {    if (e < 4) {    string_builder_sprintf(&s, "Short/%-2d ", 8<<shift);    } else {    string_builder_sprintf(&s, "Long/%-2d ", 8<<shift);    }       overhead_bytes[e] = -  DO_NOT_WARN((long)sizeof(struct pike_string) * -  num_distinct_strings[e]); +  (long)sizeof(struct pike_string) * num_distinct_strings[e];       alloced_strings[e|3] += alloced_strings[e];    alloced_bytes[e|3] += alloced_bytes[e];    num_distinct_strings[e|3] += num_distinct_strings[e];    bytes_distinct_strings[e|3] += bytes_distinct_strings[e];    overhead_bytes[e|3] += overhead_bytes[e];    } else {    if (e < 4) {    string_builder_sprintf(&s, "Total short");    } else {
pike.git/src/stralloc.c:1420: Inside #if defined(PIKE_DEBUG)
  {    return safe_debug_findstring(foo) ? foo : 0;   }      PMOD_EXPORT void debug_dump_pike_string(const struct pike_string *s, INT32 max)   {    INT32 e;    fprintf(stderr,"0x%p: %ld refs, len=%ld, size_shift=%d, hval=%lux (%lx)\n",    s,    (long)s->refs, -  DO_NOT_WARN((long)s->len), +  (long)s->len,    s->size_shift, -  DO_NOT_WARN((unsigned long)s->hval), -  DO_NOT_WARN((unsigned long)StrHash(s->str, s->len))); +  (unsigned long)s->hval, +  (unsigned long)StrHash(s->str, s->len));    fprintf(stderr," \"");    for(e=0;e<s->len && max>0;e++)    {    int c=EXTRACT_UCHAR(s->str+e);    switch(c)    {    case '\t': fprintf(stderr,"\\t"); max-=2; break;    case '\n': fprintf(stderr,"\\n"); max-=2; break;    case '\r': fprintf(stderr,"\\r"); max-=2; break;    case '\b': fprintf(stderr,"\\b"); max-=2; break;
pike.git/src/stralloc.c:1967:         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 )    {    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)); +  (long)start, (long)len, (long)s->len);    }   #endif    if( len == 0)    {    add_ref(empty_pike_string);    return empty_pike_string;    }       if(start==0 && len==s->len)    {