pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: stralloc.c,v 1.229 2008/07/16 00:33:28 mast Exp $ + || $Id: stralloc.c,v 1.230 2008/07/18 01:42:49 mast Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "dynamic_buffer.h"   #include "pike_macros.h"   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"
pike.git/src/stralloc.c:638:      static void link_pike_string(struct pike_string *s, size_t hval)   {    size_t h;      #ifdef PIKE_DEBUG    if (!(s->flags & STRING_NOT_SHARED)) {    debug_dump_pike_string(s, 70);    Pike_fatal("String already linked.\n");    } +  +  if (PIKE_MEM_NOT_DEF_RANGE (s->str, (s->len + 1) << s->size_shift)) +  Pike_fatal ("Got undefined contents in pike string %p.\n", s);   #endif       LOCK_BUCKET(hval);    h=HMODULO(hval);    s->next = base_table[h];    base_table[h] = s;    s->hval=hval;    s->flags &= ~(STRING_NOT_HASHED|STRING_NOT_SHARED);    num_strings++;    UNLOCK_BUCKET(hval);
pike.git/src/stralloc.c:2687:    for(delta = 1; (base>>delta) > 1; delta++)    ;       mask = (1<<delta)-1; /* Usually base-1. */       /* Precision is minimum number of digits. */    if (precision) shift = (len = precision) * delta;    else shift = delta;       /* Calculate actual number of digits and initial shift. */ -  for (; tmp >> shift; shift += delta, len++) +  for (; tmp >> shift && shift < SIZEOF_LONGEST * 8; shift += delta, len++)    ;       if ((len < min_width) && !(flags & APPEND_LEFT)) {    /* Perform padding.    * Note that APPEND_ZERO_PAD can not be active here, since    * len is at least min_width in that case.    */    string_builder_fill(s, min_width - len, MKPCHARP(" ", 0),    4, 0);    min_width = 0;