pike.git / src / stuff.c

version» Context lines:

pike.git/src/stuff.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/      /* -  * $Id: stuff.c,v 1.9 1999/03/01 05:32:38 hubbe Exp $ +  * $Id: stuff.c,v 1.10 1999/03/24 16:31:38 grubba Exp $    */   #include "global.h"   #include "stuff.h"   #include "stralloc.h"      /* Not all of these are primes, but they should be adequate */   INT32 hashprimes[32] =   {    31, /* ~ 2^0 = 1 */    31, /* ~ 2^1 = 2 */
pike.git/src/stuff.c:100:       return (bits[x & 255] +    bits[(x>>8) & 255] +    bits[(x>>16) & 255] +    bits[(x>>24) & 255]);   }      /* Return true for integers with more than one bit set */   int is_more_than_one_bit(unsigned INT32 x)   { -  return ((x & 0xaaaaaaaaUL) && (x & 0x55555555UL)) || -  ((x & 0xccccccccUL) && (x & 0x33333333UL)) || -  ((x & 0xf0f0f0f0UL) && (x & 0x0f0f0f0fUL)) || -  ((x & 0xff00ff00UL) && (x & 0x00ff00ffUL)) || -  ((x & 0xff00ff00UL) && (x & 0x00ff00ffUL)) || -  ((x & 0xffff0000UL) && (x & 0x0000ffffUL)); +  return !!(x & (x-1));   }      double my_strtod(char *nptr, char **endptr)   {    double tmp=STRTOD(nptr,endptr);    if(*endptr>nptr)    {    if(endptr[0][-1]=='.')    endptr[0]--;    }    return tmp;   }