pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:18:      #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.71 1999/10/24 01:08:39 noring Exp $"); + RCSID("$Id: stralloc.c,v 1.72 1999/10/26 17:52:49 noring Exp $");      #define BEGIN_HASH_SIZE 997   #define MAX_AVG_LINK_LENGTH 3      /* Experimental dynamic hash length */   #ifndef HASH_PREFIX   static unsigned int HASH_PREFIX=64;   static unsigned int need_more_hash_prefix=0;   #endif   
pike.git/src/stralloc.c:1881:    }       if(base == 0)    {    implicit_base = 1;       if(c != '0')    base = 10;    else if(INDEX_PCHARP(str,1) == 'x' || INDEX_PCHARP(str,1) == 'X')    base = 16; +  else if(INDEX_PCHARP(str,1) == 'b' || INDEX_PCHARP(str,1) == 'B') +  base = 2;    else    base = 8;    }       /*    * For any base > 10, the digits incrementally following    * 9 are assumed to be "abc...z" or "ABC...Z".    */    if(!isalnum(c) || (xx = DIGIT(c)) >= base)    return 0; /* No number formed. */    -  if(implicit_base && base == 16 && c == '0' && +  if(implicit_base && c == '0' &&    INDEX_PCHARP(str,2) < 256 && /* Don't trust isxdigit... */    isxdigit(INDEX_PCHARP(str,2)) && -  (INDEX_PCHARP(str,1) == 'x' || INDEX_PCHARP(str,1) == 'X')) +  ((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" or "0X". */    INC_PCHARP(str,2);    c=EXTRACT_PCHARP(str);    }       for(val = -DIGIT(c);    isalnum(c = ( INC_PCHARP(str,1),EXTRACT_PCHARP(str) )) &&    (xx = DIGIT(c)) < base &&    0 != maxlength--; )