VirtualBox

Changeset 62401 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Jul 21, 2016 1:52:17 PM (9 years ago)
Author:
vboxsync
Message:

Added RTUInt128AssignNeg.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/uint128.h

    r60482 r62401  
    644644        pValue1Result->s.Hi--;
    645645    pValue1Result->s.Hi -= pValue2->s.Hi;
     646    return pValue1Result;
     647}
     648
     649
     650/**
     651 * Negates a 128 number, storing the result in the input.
     652 *
     653 * @returns pValueResult.
     654 * @param   pValueResult    The value to negate.
     655 */
     656DECLINLINE(PRTUINT128U) RTUInt128AssignNeg(PRTUINT128U pValueResult)
     657{
     658    /* result = 0 - value */
     659    if (pValue1Result->s.Lo != 0)
     660    {
     661        pValue1Result->s.Lo = UINT64_C(0) - pValue1Result->s.Lo;
     662        pValue1Result->s.Hi = UINT64_MAX  - pValue1Result->s.Hi;
     663    }
     664    else
     665        pValue1Result->s.Hi = UINT64_C(0) - pValue1Result->s.Hi;
    646666    return pValue1Result;
    647667}
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