IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 6, 2007, 4:50:54 PM (19 years ago)
Author:
Paul Price
Message:

Allowing PS_ASSERT_INT_* to be used with any integer type (e.g., long).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psAssert.h

    r11265 r12290  
    7474if ((int)(NAME) < LOWER || (int)(NAME) > UPPER) { \
    7575    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    76             "Error: %s, %d, is out of range.  Must be between %d and %d.", \
    77             #NAME,(int)NAME,LOWER,UPPER); \
     76            "Error: %s, %ld, is out of range.  Must be between %ld and %ld.", \
     77            #NAME,(long)(NAME),(long)(LOWER),(long)(UPPER)); \
    7878    return RVAL; \
    7979}
     
    8282if (!(VAR1 < VAR2)) { \
    8383    psError(PS_ERR_UNKNOWN, true, \
    84             "Error: %s is not less than %s (%d, %d)", #VAR1, #VAR2, VAR1, VAR2); \
     84            "Error: %s is not less than %s (%ld, %ld)", #VAR1, #VAR2, (long)(VAR1), (long)(VAR2)); \
    8585    return(RVAL); \
    8686}
     
    8989if (!(VAR1 <= VAR2)) { \
    9090    psError(PS_ERR_UNKNOWN, true, \
    91             "Error: %s is not less than %s (%d, %d)", #VAR1, #VAR2, VAR1, VAR2); \
     91            "Error: %s is not less than %s (%ld, %ld)", #VAR1, #VAR2, (long)(VAR1), (long)(VAR2)); \
    9292    return(RVAL); \
    9393}
     
    9696if (!((NAME1) > (NAME2))) { \
    9797    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    98             "Error: !(%s > %s) (%d %d).", \
    99             #NAME1, #NAME2, NAME1, NAME2); \
     98            "Error: !(%s > %s) (%ld %ld).", \
     99            #NAME1, #NAME2,(long)(NAME1), long)(NAME2)); \
    100100    return(RVAL); \
    101101}
     
    104104if (!((NAME1) >= (NAME2))) { \
    105105    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    106             "Error: !(%s >= %s) (%d %d).", \
    107             #NAME1, #NAME2, NAME1, NAME2); \
     106            "Error: !(%s >= %s) (%ld %ld).", \
     107            #NAME1, #NAME2, (long)(NAME1), (long)(NAME2)); \
    108108    return(RVAL); \
    109109}
     
    111111if (!((NAME1) > (NAME2))) { \
    112112    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    113             "Error: !(%s > %s) (%f %f).", \
    114             #NAME1, #NAME2, NAME1, NAME2); \
     113            "Error: !(%s > %s) (%lf %lf).", \
     114            #NAME1, #NAME2, (double)(NAME1), (double)(NAME2)); \
    115115    return(RVAL); \
    116116}
     
    119119if (!((NAME1) >= (NAME2))) { \
    120120    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    121             "Error: !(%s >= %s) (%f %f).", \
    122             #NAME1, #NAME2, NAME1, NAME2); \
     121            "Error: !(%s >= %s) (%lf %lf).", \
     122            #NAME1, #NAME2, (double)(NAME1), (double)(NAME2)); \
    123123    return(RVAL); \
    124124}
     
    127127if (!((NAME1) < (NAME2))) { \
    128128    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    129             "Error: !(%s < %s) (%f %f).", \
    130             #NAME1, #NAME2, NAME1, NAME2); \
     129            "Error: !(%s < %s) (%lf %lf).", \
     130            #NAME1, #NAME2, (double)(NAME1), (double)(NAME2)); \
    131131    return(RVAL); \
    132132}
     
    135135if (!((NAME1) <= (NAME2))) { \
    136136    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    137             "Error: !(%s <= %s) (%f %f).", \
    138             #NAME1, #NAME2, NAME1, NAME2); \
     137            "Error: !(%s <= %s) (%lf %lf).", \
     138            #NAME1, #NAME2, (double)(NAME1), (double)(NAME2)); \
    139139    return(RVAL); \
    140140}
     
    160160if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \
    161161    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    162             "Error: %s, %f, is out of range.  Must be between %f and %f.", \
    163             #NAME, NAME, LOWER, UPPER); \
     162            "Error: %s, %f, is out of range.  Must be between %lf and %lf.", \
     163            #NAME, NAME, (double)(LOWER), (double)(UPPER)); \
    164164    return RVAL; \
    165165}
     
    168168if (!isfinite(NAME)) { \
    169169    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    170             "Error: %s=%f is not a real value.\n", \
    171             #NAME, NAME); \
     170            "Error: %s=%lf is not a real value.\n", \
     171            #NAME, (double)(NAME)); \
    172172    return RVAL; \
    173173}
Note: See TracChangeset for help on using the changeset viewer.