pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:11:   #include "pike_macros.h"   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"   #include "bignum.h"   #include "interpret.h"   #include "operators.h"   #include "pike_float.h"   #include "pike_types.h"   #include "block_allocator.h" + #include "whitespace.h"      #include <errno.h>   #include <ctype.h>      #define SET_HSIZE(X) htable_mask=(htable_size=(X))-1   #define HMODULO(X) ((X) & (htable_mask))      static unsigned INT32 htable_mask;      #if (SIZEOF_LONG == 4) && defined(_LP64)
pike.git/src/stralloc.c:3254:    /* Note: Code duplication in strtol and pcharp_to_svalue_inumber. */       unsigned long val, mul_limit;    int c;    int xx, neg = 0, add_limit, overflow = 0;       if (ptr) *ptr = str;    if (base < 0 || base > MBASE) return 0;    if (!WIDE_ISALNUM(c = EXTRACT_PCHARP(str)))    { -  while (WIDE_ISSPACE(c)) +  while (wide_isspace(c))    {    INC_PCHARP(str,1);    c=EXTRACT_PCHARP(str);    }    switch (c)    {    case '-':    neg++;    /* FALL_THROUGH */    case '+':
pike.git/src/stralloc.c:3399:    /* In case no number is formed. */    SET_SVAL(*r, T_INT, NUMBER_NUMBER, integer, 0);    if(ptr != 0)    *ptr = str;       if(base < 0 || MBASE < base)    return 0;       if(!WIDE_ISALNUM(c = EXTRACT_PCHARP(str)))    { -  while(WIDE_ISSPACE(c)) +  while(wide_isspace(c))    {    INC_PCHARP(str,1);    c = EXTRACT_PCHARP(str);    }       switch (c)    {    case '-':    neg++;    /* Fall-through. */
pike.git/src/stralloc.c:3542:       if (nptr.ptr == NULL)    {    errno = EINVAL;    goto noconv;    }       s = nptr;       /* Eat whitespace. */ -  while (EXTRACT_PCHARP(s) <256 && WIDE_ISSPACE(EXTRACT_PCHARP(s))) INC_PCHARP(s,1); +  while (EXTRACT_PCHARP(s) <256 && wide_isspace(EXTRACT_PCHARP(s))) INC_PCHARP(s,1);       /* Get the sign. */    sign = EXTRACT_PCHARP(s) == '-' ? -1 : 1;    if (EXTRACT_PCHARP(s) == '-' || EXTRACT_PCHARP(s) == '+')    INC_PCHARP(s,1);       num = 0.0;    got_dot = 0;    got_digit = 0;    exponent = 0;
pike.git/src/stralloc.c:3607:    exp = STRTOL_PCHARP(s, &end, 10);    if (errno == ERANGE)    {    /* The exponent overflowed a `long int'. It is probably a safe    assumption that an exponent that cannot be represented by    a `long int' exceeds the limits of a `double'. */    /* NOTE: Don't trust the value returned from strtol.    * We need to find the sign of the exponent by hand.    */    p_wchar2 c; -  while(WIDE_ISSPACE(c = EXTRACT_PCHARP(s))) { +  while(wide_isspace(c = EXTRACT_PCHARP(s))) {    INC_PCHARP(s, 1);    }    if (endptr != NULL)    *endptr = end;    if (c == '-')    goto underflow;    else    goto overflow;    }    else if (COMPARE_PCHARP(end,==,s))
pike.git/src/stralloc.c:3729:    *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);    }    UNREACHABLE(return 0);   } +  + PMOD_EXPORT int wide_isspace(int c) + { +  switch(c) +  { +  SPACECASE16; +  return 1; +  } +  return 0; + }