pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:19:      #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.125 2001/04/13 13:35:30 mast Exp $"); + RCSID("$Id: stralloc.c,v 1.126 2001/06/05 10:12:56 hubbe Exp $");      #if PIKE_RUN_UNLOCKED   /* Make this bigger when we get lightweight threads */   #define BUCKET_LOCKS 2048   static PIKE_MUTEX_T *bucket_locks;      #define BUCKETLOCK(HVAL) \    (bucket_locks + ((hval__ % htable_size) & (BUCKET_LOCKS-1)))      #define LOCK_BUCKET(HVAL) do { \
pike.git/src/stralloc.c:2259:    base = 8;    }       /*    * For any base > 10, the digits incrementally following    * 9 are assumed to be "abc...z" or "ABC...Z".    */    if(!WIDE_ISALNUM(c) || (xx = DIGIT(c)) >= base)    return 0; /* No number formed. */    -  if(implicit_base && c == '0' && +  if((base==16 || base == 2) && c == '0' &&    INDEX_PCHARP(str,2) < 256 && /* Don't trust isxdigit... */    isxdigit(INDEX_PCHARP(str,2)) &&    ((base==16 && (INDEX_PCHARP(str,1)=='x' || INDEX_PCHARP(str,1)=='X')) ||    (base==2 && (INDEX_PCHARP(str,1)=='b' || INDEX_PCHARP(str,1)=='B'))))    {    /* Skip over leading "0x", "0X", "0b" or "0B". */    INC_PCHARP(str,2);    c=EXTRACT_PCHARP(str);    } -  +  str_start=str;       for(val = -DIGIT(c);    (INC_PCHARP(str,1), WIDE_ISALNUM(c = EXTRACT_PCHARP(str) )) &&    (xx = DIGIT(c)) < base &&    0 != maxlength--; )    {   #ifdef AUTO_BIGNUM    if(INT_TYPE_MUL_OVERFLOW(val, base))    is_bignum = 1;   #endif /* AUTO_BIGNUM */
pike.git/src/stralloc.c:2311: Inside #if defined(AUTO_BIGNUM)
     #ifdef AUTO_BIGNUM    if(is_bignum)    {    push_string(make_shared_binary_pcharp(str_start,    SUBTRACT_PCHARP(str,str_start)));    /* Note that this can concievably throw errors()    * in some situations that might not be desirable...    * take care.    * /Hubbe +  * +  * It could probably also be faster...    */ -  if(implicit_base) -  { -  convert_stack_top_to_bignum(); -  } -  else -  { +     push_int(base);    convert_stack_top_with_base_to_bignum(); -  } +  if(neg) o_negate();       *r = *--sp;    }   #endif /* AUTO_BIGNUM */       return 1;   }      PMOD_EXPORT int convert_stack_top_string_to_inumber(int base)   {