Changeset 4049 for trunk/psLib/src/math/psConstants.h
- Timestamp:
- May 31, 2005, 11:25:27 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psConstants.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psConstants.h
r4029 r4049 6 6 * @author GLG, MHPCC 7 7 * 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 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 75 75 } 76 76 77 // Return an error if the arg is less than zero.78 77 #define PS_ASSERT_INT_NONNEGATIVE(NAME, RVAL) \ 79 78 if (NAME < 0) { \ … … 83 82 } 84 83 85 // Return an error if the arg is less than zero.86 // XXX: This naming scheme is opposite most other macros. This should be87 // 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 be97 // corrected as soon as a fresh checkin/out can be performed.98 84 #define PS_ASSERT_INT_POSITIVE(NAME, RVAL) \ 99 85 if (NAME < 1) { \ … … 103 89 } 104 90 105 // Return an error if the arg is not equal to zero.106 91 #define PS_ASSERT_INT_ZERO(NAME, RVAL) \ 107 92 if (NAME != 0) { \ … … 111 96 } 112 97 113 // Return an error if the arg is equal to zero.114 98 #define PS_ASSERT_INT_NONZERO(NAME, RVAL) \ 115 99 if (NAME == 0) { \ … … 119 103 } 120 104 121 // Return an error if the arg is lies outside the supplied range.122 105 #define PS_ASSERT_INT_WITHIN_RANGE(NAME, LOWER, UPPER, RVAL) \ 123 106 if ((int)NAME < LOWER || (int)NAME > UPPER) { \ … … 129 112 130 113 // Produce an error if (NAME1 > NAME2) 114 // XXX: rename: ASSERT 131 115 #define PS_INT_COMPARE(NAME1, NAME2, RVAL) \ 132 116 if (NAME1 > NAME2) { \ … … 138 122 139 123 // Produce an error if ((NAME1 > NAME2) 124 // XXX: rename: ASSERT 140 125 #define PS_FLOAT_COMPARE(NAME1, NAME2, RVAL) \ 141 126 if (NAME1 > NAME2) { \ … … 272 257 "psVector %s has size %d, psVector %s has size %d.", \ 273 258 #VEC1, VEC1->n, #VEC2, VEC2->n); \ 259 return(RVAL); \ 260 } 261 262 #define PS_ASSERT_VECTOR_SIZE(VEC, SIZE, RVAL) \ 263 if (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); \ 274 267 return(RVAL); \ 275 268 }
Note:
See TracChangeset
for help on using the changeset viewer.
