VirtualBox

Changeset 20256 in vbox


Ignore:
Timestamp:
Jun 4, 2009 8:55:28 AM (16 years ago)
Author:
vboxsync
Message:

Runtime/rand: compiler warnings / typecast fixes

Location:
trunk/src/VBox/Runtime/common/rand
Files:
2 edited

Legend:

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

    r11523 r20256  
    315315DECLCALLBACK(uint32_t)  rtRandAdvSynthesizeU32FromU64(PRTRANDINT pThis, uint32_t u32First, uint32_t u32Last)
    316316{
    317     return pThis->pfnGetU64(pThis, u32First, u32Last);
     317    return (uint32_t)pThis->pfnGetU64(pThis, u32First, u32Last);
    318318}
    319319
     
    358358    uint64_t off = u64Last - u64First;
    359359    if (off <= UINT32_MAX)
    360         return pThis->pfnGetU32(pThis, 0, off) + u64First;
    361 
    362     return (    pThis->pfnGetU32(pThis, 0, UINT32_MAX)
     360        return (uint64_t)pThis->pfnGetU32(pThis, 0, off) + u64First;
     361
     362    return (    (uint64_t)pThis->pfnGetU32(pThis, 0, UINT32_MAX)
    363363            |  ((uint64_t)pThis->pfnGetU32(pThis, 0, off >> 32) << 32))
    364364         + u64First;
  • trunk/src/VBox/Runtime/common/rand/randparkmiller.cpp

    r11523 r20256  
    118118static DECLCALLBACK(int) rtRandParkMillerSeed(PRTRANDINT pThis, uint64_t u64Seed)
    119119{
    120     pThis->u.ParkMiller.u32Ctx = u64Seed;
     120    pThis->u.ParkMiller.u32Ctx = (uint32_t)u64Seed;
    121121    pThis->u.ParkMiller.u32Bits = 0;
    122122    pThis->u.ParkMiller.cBits = 0;
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