VirtualBox

Changeset 25403 in vbox


Ignore:
Timestamp:
Dec 15, 2009 1:18:03 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56029
Message:

IPRT: Added RT_CLAMP macro.

File:
1 edited

Legend:

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

    r22801 r25403  
    11321132 */
    11331133#define RT_MIN(Value1, Value2)                  ( (Value1) <= (Value2) ? (Value1) : (Value2) )
     1134
     1135/** @def RT_CLAMP
     1136 * Clamps the value to minimum and maximum values.
     1137 * @returns The clamped value.
     1138 * @param   Value       The value to check.
     1139 * @param   Min         Minimum value.
     1140 * @param   Max         Maximum value.
     1141 */
     1142#define RT_CLAMP(Value, Min, Max)               ( ((Value) > (Max)) ? (Max) : (((Value) < (Min)) ? (Min) : (Value)) )
    11341143
    11351144/** @def RT_ABS
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