Ignore:
Timestamp:
Feb 12, 2009, 2:22:07 PM (16 years ago)
Author:
[email protected]
Message:

2009-02-12 Geoffrey Garen <[email protected]>

Build fix.

  • wtf/RandomNumber.cpp: (WTF::randomNumber):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/RandomNumber.cpp

    r40932 r40935  
    4747#endif
    4848   
    49     uint32_t part1;
    50     uint32_t part2;
    5149    uint64_t fullRandom;
    5250#if COMPILER(MSVC) && defined(_CRT_RAND_S)
     51    uint32_t part1;
    5352    rand_s(&part1);
    5453    fullRandom = part1;
     
    5655    fullRandom = arc4random();
    5756#elif PLATFORM(UNIX)
    58     part1 = random() & (RAND_MAX - 1);
    59     part2 = random() & (RAND_MAX - 1);
     57    uint32_t part1 = random() & (RAND_MAX - 1);
     58    uint32_t part2 = random() & (RAND_MAX - 1);
    6059    // random only provides 31 bits
    6160    fullRandom = part1;
     
    6362    fullRandom |= part2;
    6463#else
    65     part1 = rand() & (RAND_MAX - 1);
    66     part2 = rand() & (RAND_MAX - 1);
     64    uint32_t part1 = rand() & (RAND_MAX - 1);
     65    uint32_t part2 = rand() & (RAND_MAX - 1);
    6766    // rand only provides 31 bits, and the low order bits of that aren't very random
    6867    // so we take the high 26 bits of part 1, and the high 27 bits of part2.
Note: See TracChangeset for help on using the changeset viewer.