IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 31, 2005, 11:25:27 AM (21 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psConstants.h

    r4029 r4049  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-05-25 20:26:55 $
     8 *  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-05-31 21:25:27 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7575}
    7676
    77 // Return an error if the arg is less than zero.
    7877#define PS_ASSERT_INT_NONNEGATIVE(NAME, RVAL) \
    7978if (NAME < 0) { \
     
    8382}
    8483
    85 // Return an error if the arg is less than zero.
    86 // XXX: This naming scheme is opposite most other macros.  This should be
    87 // corrected as soon as a fresh checkin/out can be performed.
    88 #define PS_ASSERT_INT_NONNEGATIVE(NAME, RVAL) \
    89 if (NAME < 0) { \
    90     psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    91             "Error: %s is less than 0.", #NAME); \
    92     return(RVAL); \
    93 }
    94 
    95 // Return an error if the arg is less than or equal to zero.
    96 // XXX: This naming scheme is opposite most other macros.  This should be
    97 // corrected as soon as a fresh checkin/out can be performed.
    9884#define PS_ASSERT_INT_POSITIVE(NAME, RVAL) \
    9985if (NAME < 1) { \
     
    10389}
    10490
    105 // Return an error if the arg is not equal to zero.
    10691#define PS_ASSERT_INT_ZERO(NAME, RVAL) \
    10792if (NAME != 0) { \
     
    11196}
    11297
    113 // Return an error if the arg is equal to zero.
    11498#define PS_ASSERT_INT_NONZERO(NAME, RVAL) \
    11599if (NAME == 0) { \
     
    119103}
    120104
    121 // Return an error if the arg is lies outside the supplied range.
    122105#define PS_ASSERT_INT_WITHIN_RANGE(NAME, LOWER, UPPER, RVAL) \
    123106if ((int)NAME < LOWER || (int)NAME > UPPER) { \
     
    129112
    130113// Produce an error if (NAME1 > NAME2)
     114// XXX: rename: ASSERT
    131115#define PS_INT_COMPARE(NAME1, NAME2, RVAL) \
    132116if (NAME1 > NAME2) { \
     
    138122
    139123// Produce an error if ((NAME1 > NAME2)
     124// XXX: rename: ASSERT
    140125#define PS_FLOAT_COMPARE(NAME1, NAME2, RVAL) \
    141126if (NAME1 > NAME2) { \
     
    272257            "psVector %s has size %d, psVector %s has size %d.", \
    273258            #VEC1, VEC1->n, #VEC2, VEC2->n); \
     259    return(RVAL); \
     260}
     261
     262#define PS_ASSERT_VECTOR_SIZE(VEC, SIZE, RVAL) \
     263if (VEC->n != SIZE) { \
     264    psError(PS_ERR_BAD_PARAMETER_SIZE, true, \
     265            "psVector %s has size %d, should be %d." \
     266            #VEC, VEC->n, SIZE); \
    274267    return(RVAL); \
    275268}
Note: See TracChangeset for help on using the changeset viewer.