VirtualBox

Changeset 11172 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 6, 2008 3:27:28 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34169
Message:

IPRT/RTRand: cosmetics - don't take the address of an array.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/rand/rand.cpp

    r11126 r11172  
    125125    if (offLast == UINT32_MAX)
    126126        /* get 4 random bytes and return them raw. */
    127         rtRandGenBytes(&u.ab, sizeof(u.off));
     127        rtRandGenBytes(&u.ab[0], sizeof(u.off));
    128128    else if (!(offLast & UINT32_C(0xf0000000)))
    129129    {
    130130        /* get 4 random bytes and do simple squeeze. */
    131         rtRandGenBytes(&u.ab, sizeof(u.off));
     131        rtRandGenBytes(&u.ab[0], sizeof(u.off));
    132132        u.off %= offLast + 1;
    133133        u.off += u32First;
     
    136136    {
    137137        /* get 5 random bytes and do shifted squeeze. (this ain't perfect) */
    138         rtRandGenBytes(&u.ab, sizeof(u.ab));
     138        rtRandGenBytes(&u.ab[0], sizeof(u.ab));
    139139        u.off %= (offLast >> 4) + 1;
    140140        u.off <<= 4;
     
    204204    if (offLast == UINT64_MAX)
    205205        /* get 8 random bytes and return them raw. */
    206         rtRandGenBytes(&u.ab, sizeof(u.off));
     206        rtRandGenBytes(&u.ab[0], sizeof(u.off));
    207207    else if (!(offLast & UINT64_C(0xf000000000000000)))
    208208    {
    209209        /* get 8 random bytes and do simple squeeze. */
    210         rtRandGenBytes(&u.ab, sizeof(u.off));
     210        rtRandGenBytes(&u.ab[0], sizeof(u.off));
    211211        u.off %= offLast + 1;
    212212        u.off += u64First;
     
    215215    {
    216216        /* get 9 random bytes and do shifted squeeze. (this ain't perfect) */
    217         rtRandGenBytes(&u.ab, sizeof(u.ab));
     217        rtRandGenBytes(&u.ab[0], sizeof(u.ab));
    218218        u.off %= (offLast >> 4) + 1;
    219219        u.off <<= 4;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette