VirtualBox

Changeset 3250 in vbox


Ignore:
Timestamp:
Jun 24, 2007 1:46:54 AM (17 years ago)
Author:
vboxsync
Message:

Two more timspec functions.

File:
1 edited

Legend:

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

    r3123 r3250  
    159159{
    160160    pTime->i64NanosecondsRelativeToUnixEpoch = i64Seconds * 1000000000;
     161    return pTime;
     162}
     163
     164
     165/**
     166 * Makes the time spec absolute like abs() does (i.e. a positive value).
     167 *
     168 * @returns pTime.
     169 * @param   pTime       The time spec to modify.
     170 */
     171DECLINLINE(PRTTIMESPEC) RTTimeSpecAbsolute(PRTTIMESPEC pTime)
     172{
     173    if (pTime->i64NanosecondsRelativeToUnixEpoch < 0)
     174        pTime->i64NanosecondsRelativeToUnixEpoch = -pTime->i64NanosecondsRelativeToUnixEpoch;
     175    return pTime;
     176}
     177
     178
     179/**
     180 * Negates the time.
     181 *
     182 * @returns pTime.
     183 * @param   pTime       The time spec to modify.
     184 */
     185DECLINLINE(PRTTIMESPEC) RTTimeSpecNegate(PRTTIMESPEC pTime)
     186{
     187    pTime->i64NanosecondsRelativeToUnixEpoch = -pTime->i64NanosecondsRelativeToUnixEpoch;
    161188    return pTime;
    162189}
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