Diff for /parser3/src/classes/math.C between versions 1.30 and 1.32

version 1.30, 2003/04/15 14:30:14 version 1.32, 2003/05/26 09:32:29
Line 148  static void random(void *buffer, size_t Line 148  static void random(void *buffer, size_t
 static inline int _random(uint top) {  static inline int _random(uint top) {
         uint raw;          uint raw;
         random(&raw, sizeof(raw));          random(&raw, sizeof(raw));
         return int(double(raw) / 0x100000000 * top );          return int(double(raw) / 0xFFFFFFFFu * top );
 }  }
 static void _random(Request& r, const String& method_name, MethodParams *params) {  static void _random(Request& r, const String& method_name, MethodParams *params) {
         Pool& pool=r.pool();          Pool& pool=r.pool();
Line 287  static const char* hex_string(Pool& pool Line 287  static const char* hex_string(Pool& pool
         unsigned char *src=bytes;          unsigned char *src=bytes;
         unsigned char *end=bytes+size;          unsigned char *end=bytes+size;
         char *dest=bytes_hex;          char *dest=bytes_hex;
   
           static const char *hex=upcase?"0123456789ABCDEF":"0123456789abcdef";
   
         const char *format=upcase?"%02X":"%02x";          const char *format=upcase?"%02X":"%02x";
         while(src<end)          for(; src<end; src++) {
                 dest+=snprintf(dest, 3, format, *src++);                  *dest++=hex[*src/0x10];
                   *dest++=hex[*src%0x10];
           }
           *dest=0;
   
         return bytes_hex;          return bytes_hex;
 }  }

Removed from v.1.30  
changed lines
  Added in v.1.32


E-mail: