IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2004, 10:20:11 AM (22 years ago)
Author:
gusciora
Message:

I've been unifying the naming conventions for various macros that check
functions parameters for type, size, non-NULL ...

File:
1 edited

Legend:

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

    r2213 r2214  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-10-27 20:11:46 $
     8 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-10-27 20:20:11 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    109109    return(RVAL); \
    110110}
    111 /*****************************************************************************
    112  
     111
     112
     113/*****************************************************************************
     114Macros which take a psVector type and determine if it is NULL, or has the
     115wrong type.
    113116 *****************************************************************************/
    114117#define PS_VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \
     
    118121} \
    119122
    120 /** Preprocessor macro to generate error on an incorrect type */
    121123#define PS_VECTOR_CHECK_TYPE(NAME, TYPE, RVAL) \
    122124if (NAME->type.type != TYPE) { \
     
    125127}
    126128
    127 /** Preprocessor macro to generate error on a NULL vector */
    128 #define PS_VECTOR_CHEC_NULL(NAME, RVAL) \
     129#define PS_VECTOR_CHECK_NULL(NAME, RVAL) \
    129130if (NAME == NULL || NAME->data.V == NULL) { \
    130131    psError(__func__,"Unallowable operation: %s or its data is NULL.", #NAME); \
     
    132133} \
    133134
    134 /** Preprocessor macro to generate error for zero length vector */
    135135#define PS_VECTOR_CHECK_EMPTY(NAME, RVAL) \
    136136if (NAME->n < 1) { \
     
    139139} \
    140140
    141 /** Preprocessor macro to generate error on differing size vectors */
    142141#define PS_VECTOR_CHECK_SIZE_EQUAL(VEC1, VEC2, RVAL) \
    143142if (VEC1->n != VEC2->n) { \
     
    145144    return(RVAL); \
    146145}
    147 
    148 #define PS_VECTOR_PRINT(NAME) \
    149 for (int my_i=0;my_i<NAME->n;my_i++) { \
    150     printf("%s->data.F32[%d] is %f\n", #NAME, my_i, NAME->data.F32[my_i]); \
    151 } \
    152 printf("\n"); \
    153146
    154147#define PS_VECTOR_F64_TO_F32(X64, X32) \
     
    164157} \
    165158
     159#define PS_VECTOR_PRINT(NAME) \
     160for (int my_i=0;my_i<NAME->n;my_i++) { \
     161    printf("%s->data.F32[%d] is %f\n", #NAME, my_i, NAME->data.F32[my_i]); \
     162} \
     163printf("\n"); \
    166164
    167165
     
    169167 
    170168*****************************************************************************/
    171 #define PS_CHECK_NULL_POLY(NAME, NULL) \
     169#define PS_POLY_CHECK_NULL(NAME, NULL) \
    172170if (NAME == NULL || NAME->coeff == NULL) { \
    173171    psError(__func__,"Unallowable operation: polynomial %s or its coeffs is NULL.", #NAME); \
     
    175173} \
    176174
    177 
    178 
    179 
    180 
    181175/*****************************************************************************
    182176 
    183177*****************************************************************************/
    184 /** Preprocessor macro to generate error on a NULL image */
    185 #define PS_CHECK_NULL_IMAGE(NAME, RVAL) \
     178#define PS_IMAGE_CHECK_NULL(NAME, RVAL) \
    186179if (NAME == NULL || NAME->data.V == NULL) { \
    187180    psError(__func__,"Unallowable operation: psImage %s or its data is NULL.", #NAME); \
     
    189182}
    190183
    191 /** Preprocessor macro to generate error for zero length rows or columns */
    192 #define PS_CHECK_EMPTY_IMAGE(NAME, RVAL) \
     184#define PS_IMAGE_CHECK_EMPTY(NAME, RVAL) \
    193185if (NAME->numCols < 1 || NAME->numRows < 1) { \
    194186    psError(__func__,"Unallowable operation: psImage %s has zero rows or columns (%dx%d).", #NAME, \
     
    197189}
    198190
    199 #define PS_CHECK_IMAGE_TYPE(NAME, TYPE, RVAL) \
     191#define PS_IMAGE_CHECK_TYPE(NAME, TYPE, RVAL) \
    200192if (NAME->type.type != TYPE) { \
    201193    psError(__func__,"Unallowable operation: psImage %s has incorrect type.", #NAME); \
    202194    return(RVAL); \
    203195}
    204 
    205196/*****************************************************************************
    206197 
    207198 *****************************************************************************/
    208199/** Preprocessor macro to generate error on a NULL image */
    209 #define PS_CHECK_NULL_IMAGE_READOUT(NAME, RVAL) \
    210 if (NAME == NULL || NAME->image == NULL) {                                                         \
     200#define PS_READOUT_CHECK_NULL(NAME, RVAL) \
     201if (NAME == NULL || NAME->image == NULL) { \
    211202    psError(__func__,"Unallowable operation: psReadout %s or its data is NULL.", #NAME); \
    212203    return(RVAL); \
Note: See TracChangeset for help on using the changeset viewer.