VirtualBox

Changeset 16545 in vbox for trunk/include/iprt/assert.h


Ignore:
Timestamp:
Feb 6, 2009 12:17:10 PM (16 years ago)
Author:
vboxsync
Message:

assert.h/AssertForEach: -lisp, -name, +indent, +typecast, +hex print, +dots, s/last/end/ (convention is that end is exclusive while last is inclusive).

File:
1 edited

Legend:

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

    r16542 r16545  
    22502250 * value to the finishing one.
    22512251 *
    2252  * @param   var     Name of the counter variable
    2253  * @param   vartype Type of the counter variable
    2254  * @param   first   Lowest inclusive value of the counter variable.  This must
    2255  *                  be free from side effects.
    2256  * @param   last    Highest exclusive value of the counter variable.  This
    2257  *                  must be free from side effects.
     2252 * @param   var     Name of the counter variable.
     2253 * @param   vartype Type of the counter variable.
     2254 * @param   first   Lowest inclusive value of the counter variable.
     2255 *                  This must be free from side effects.
     2256 * @param   end     Highest exclusive value of the counter variable.
     2257 *                  This must be free from side effects.
    22582258 * @param   expr    Expression which should be true for each value of @a var.
    2259  * @param   name    Name of the precondition
    2260  */
    2261 #define AssertForEach(var, vartype, first, last, expr) \
    2262 do { \
    2263     vartype var; \
    2264     Assert(((first) == (first)) && ((last) == (last))); /* partial check for side effects */ \
    2265     for (var = (first); var < (last); ++var) \
    2266         AssertMsg(expr, ("%s = %lld", #var, var)); \
    2267 } while(0)
     2259 */
     2260#define AssertForEach(var, vartype, first, end, expr) \
     2261    do { \
     2262        vartype var; \
     2263        Assert((first) == (first) && (end) == (end)); /* partial check for side effects */ \
     2264        for (var = (first); var < (end); var++) \
     2265            AssertMsg(expr, ("%s = %#RX64 (%RI64)", #var, (uint64_t)var, (int64_t)var)); \
     2266    } while (0)
    22682267
    22692268/** @} */
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