pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:3183:    return neg ? LONG_MIN : LONG_MAX;    }    else {    if (neg)    return (long)(~val + 1);    else    return (long) val;    }   }    - /* - static int string_to_svalue_inumber(struct svalue *r, -  char * str, -  char **ptr, -  int base, -  int maxlength) - { -  PCHARP tmp; -  int ret=pcharp_to_svalue_inumber(r, -  MKPCHARP(str,0), -  &tmp, -  base, -  maxlength); -  if(ptr) *ptr=(char *)tmp.ptr; -  return ret; - } - */ -  +    int wide_string_to_svalue_inumber(struct svalue *r,    void * str,    void *ptr,    int base,    ptrdiff_t maxlength,    int shift)   {    PCHARP tmp;    int ret=pcharp_to_svalue_inumber(r,    MKPCHARP(str,shift),
pike.git/src/stralloc.c:3395:    i=pcharp_to_svalue_inumber(&r, MKPCHARP_STR(Pike_sp[-1].u.string), 0, base, 0);       free_string(Pike_sp[-1].u.string);    Pike_sp[-1] = r;       return i;   }      /* Convert PCHARP to a double. If ENDPTR is not NULL, a pointer to the    character after the last one used in the number is put in *ENDPTR. */ - PMOD_EXPORT double STRTOD_PCHARP(PCHARP nptr, PCHARP *endptr) + PMOD_EXPORT double STRTOD_PCHARP(const PCHARP nptr, PCHARP *endptr)   {    /* Note: Code duplication in strtod. */       PCHARP s;    short int sign;       /* The number so far. */    double num;       int got_dot; /* Found a decimal point. */
pike.git/src/stralloc.c:3550:    return 0.0;       noconv:    /* There was no number. */    if (endptr != NULL)    *endptr = nptr;    return 0.0;   }       - PMOD_EXPORT p_wchar0 *require_wstring0(struct pike_string *s, + PMOD_EXPORT p_wchar0 *require_wstring0(const struct pike_string *s,    char **to_free)   {    switch(s->size_shift)    {    case 0:    *to_free=0;    return STR0(s);    case 1:    case 2:    return 0;      #ifdef PIKE_DEBUG    default:    Pike_fatal("Illegal shift size in string.\n");   #endif    }    return 0;   }    - PMOD_EXPORT p_wchar1 *require_wstring1(struct pike_string *s, + PMOD_EXPORT p_wchar1 *require_wstring1(const struct pike_string *s,    char **to_free)   {    switch(s->size_shift)    {    case 0:    *to_free=xalloc((s->len+1)*2);    convert_0_to_1((p_wchar1 *)*to_free, STR0(s),s->len+1);    return (p_wchar1 *)*to_free;       case 1:
pike.git/src/stralloc.c:3596: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    default:    Pike_fatal("Illegal shift size in string.\n");   #endif    }    return 0;   }       - PMOD_EXPORT p_wchar2 *require_wstring2(struct pike_string *s, + PMOD_EXPORT p_wchar2 *require_wstring2(const struct pike_string *s,    char **to_free)   {    switch(s->size_shift)    {    case 0:    *to_free=xalloc((s->len+1)*4);    convert_0_to_2((p_wchar2 *)*to_free, STR0(s),s->len+1);    return (p_wchar2 *)*to_free;       case 1: