Changeset 8387
- Timestamp:
- Aug 16, 2006, 10:36:04 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/mathtypes/psVector.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/mathtypes/psVector.h
r7766 r8387 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.5 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-0 6-30 02:20:06$13 * @version $Revision: 1.55 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-08-16 20:36:04 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 295 295 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \ 296 296 "psVector %s: bad type(%d)", \ 297 #NAME, NAME->type.type); \297 #NAME, (NAME)->type.type); \ 298 298 return(RVAL); \ 299 299 } \ … … 303 303 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \ 304 304 "psVector %s: bad type(%d)", \ 305 #NAME, NAME->type.type); \305 #NAME, (NAME)->type.type); \ 306 306 return(RVAL); \ 307 307 } \ … … 316 316 317 317 #define PS_ASSERT_VECTORS_SIZE_EQUAL(VEC1, VEC2, RVAL) \ 318 if ( VEC1->n != VEC2->n) { \318 if ((VEC1)->n != (VEC2)->n) { \ 319 319 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 320 320 "psVector %s has size %d, psVector %s has size %d.", \ 321 #VEC1, VEC1->n, #VEC2, VEC2->n); \321 #VEC1, (VEC1)->n, #VEC2, (VEC2)->n); \ 322 322 return(RVAL); \ 323 323 } 324 324 325 325 #define PS_ASSERT_VECTOR_SIZE(VEC, SIZE, RVAL) \ 326 if ( VEC->n != SIZE) { \326 if ((VEC)->n != (SIZE)) { \ 327 327 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 328 328 "psVector %s has size %d, should be %d.", \ 329 #VEC, VEC->n, SIZE); \329 #VEC, (VEC)->n, (SIZE)); \ 330 330 return(RVAL); \ 331 331 } 332 332 333 333 #define PS_ASSERT_VECTOR_TYPE_EQUAL(VEC1, VEC2, RVAL) \ 334 if ( VEC1->type.type != VEC2->type.type) { \334 if ((VEC1)->type.type != (VEC2)->type.type) { \ 335 335 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 336 336 "psVector %s has size %d, psVector %s has size %d.", \ 337 #VEC1, VEC1->type.type, #VEC2, VEC2->type.type); \337 #VEC1, (VEC1)->type.type, #VEC2, (VEC2)->type.type); \ 338 338 return(RVAL); \ 339 339 } 340 340 341 341 #define PS_VECTOR_PRINT_F32(NAME) \ 342 if ( NAME!= NULL) { \343 for (int my_i=0;my_i<(NAME)->n;my_i++) { \344 printf("%s->data.F32[%d] is %f\n", #NAME, my_i, (NAME)->data.F32[my_i]); \342 if ((NAME) != NULL) { \ 343 for (int i = 0; i < (NAME)->n; i++) { \ 344 printf("%s->data.F32[%d] is %f\n", #NAME, i, (NAME)->data.F32[i]); \ 345 345 } \ 346 346 printf("\n"); \ … … 350 350 351 351 #define PS_VECTOR_PRINT_F64(NAME) \ 352 if ( NAME!= NULL) { \353 for (int my_i=0;my_i<(NAME)->n;my_i++) { \354 printf("%s->data.F64[%d] is %f\n", #NAME, my_i, (NAME)->data.F64[my_i]); \352 if ((NAME) != NULL) { \ 353 for (int i = 0; i < (NAME)->n; i++) { \ 354 printf("%s->data.F64[%d] is %f\n", #NAME, i, (NAME)->data.F64[i]); \ 355 355 } \ 356 356 printf("\n"); \
Note:
See TracChangeset
for help on using the changeset viewer.
