IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2106


Ignore:
Timestamp:
Oct 13, 2004, 3:44:48 PM (22 years ago)
Author:
gusciora
Message:

Added new NULL check macros.

Location:
trunk/psLib/src
Files:
7 edited

Legend:

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

    r2058 r2106  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-10-12 20:53:02 $
     8 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-10-14 01:44:48 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    113113    return(NULL); \
    114114}
     115/** Preprocessor macro to generate error on a NULL poniter */
     116#define PS_CHECK_NULL_PTR_RETURN_ZERO(NAME) \
     117if (NAME == NULL) { \
     118    psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \
     119    return(0); \
     120}
    115121
    116122/** Preprocessor macro to generate error for zero length vector */
  • trunk/psLib/src/dataManip/psFunctions.c

    r1985 r2106  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-10-06 22:27:06 $
     9 *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-10-14 01:44:48 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    206206}
    207207
    208 //XXX: remove this
    209 //typedef enum {
    210 //    PS_POLYNOMIAL_ORD,                 ///< Ordinary Polynomial
    211 //    PS_POLYNOMIAL_CHEB                 ///< Chebyshev Polynomial
    212 //} psPolynomialType;
    213 
    214208/*****************************************************************************
    215209    This routine must allocate memory for the polynomial structures.
     
    18581852{
    18591853    if (x->type.type != bins->type.type) {
    1860         // XXX: Generate error message.
    1861         return(-1);
     1854        psError(__func__, "x->type.type != bins->type.type");
     1855        return(-2);
    18621856    }
    18631857
     
    18671861        return(p_psVectorBinDisectF32(bins->data.F32, bins->n, x->data.F32));
    18681862    } else {
    1869         // XXX: Generate error message.
     1863        psError(__func__, "Unallowable data type.");
     1864        return(-2);
    18701865    }
    18711866    return(-1);
     
    20642059by a call to the 1D polynomial functions.
    20652060 
    2066 XXX: SDR is silent about data types.  PS_TYPE_F32 is implemented.
    2067  
    20682061XXX: The spline eval functions require input and output to be F32.  however
    20692062     the spline fit functions require F32 and F64.
  • trunk/psLib/src/dataManip/psMinimize.c

    r1992 r2106  
    99 *  @author GLF, MHPCC
    1010 *
    11  *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-10-06 23:38:49 $
     11 *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-10-14 01:44:48 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    895895        tmpPoly = p_psVectorFitPolynomial1DOrd(myPoly, x64, y64, yErr64);
    896896    } else {
    897         // XXX: psErrorMsg()
     897        psError(__func__, "unknown polynomial type.\n");
    898898        return(NULL);
    899899    }
  • trunk/psLib/src/math/psConstants.h

    r2058 r2106  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-10-12 20:53:02 $
     8 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-10-14 01:44:48 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    113113    return(NULL); \
    114114}
     115/** Preprocessor macro to generate error on a NULL poniter */
     116#define PS_CHECK_NULL_PTR_RETURN_ZERO(NAME) \
     117if (NAME == NULL) { \
     118    psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \
     119    return(0); \
     120}
    115121
    116122/** Preprocessor macro to generate error for zero length vector */
  • trunk/psLib/src/math/psMinimize.c

    r1992 r2106  
    99 *  @author GLF, MHPCC
    1010 *
    11  *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-10-06 23:38:49 $
     11 *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-10-14 01:44:48 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    895895        tmpPoly = p_psVectorFitPolynomial1DOrd(myPoly, x64, y64, yErr64);
    896896    } else {
    897         // XXX: psErrorMsg()
     897        psError(__func__, "unknown polynomial type.\n");
    898898        return(NULL);
    899899    }
  • trunk/psLib/src/math/psPolynomial.c

    r1985 r2106  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-10-06 22:27:06 $
     9 *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-10-14 01:44:48 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    206206}
    207207
    208 //XXX: remove this
    209 //typedef enum {
    210 //    PS_POLYNOMIAL_ORD,                 ///< Ordinary Polynomial
    211 //    PS_POLYNOMIAL_CHEB                 ///< Chebyshev Polynomial
    212 //} psPolynomialType;
    213 
    214208/*****************************************************************************
    215209    This routine must allocate memory for the polynomial structures.
     
    18581852{
    18591853    if (x->type.type != bins->type.type) {
    1860         // XXX: Generate error message.
    1861         return(-1);
     1854        psError(__func__, "x->type.type != bins->type.type");
     1855        return(-2);
    18621856    }
    18631857
     
    18671861        return(p_psVectorBinDisectF32(bins->data.F32, bins->n, x->data.F32));
    18681862    } else {
    1869         // XXX: Generate error message.
     1863        psError(__func__, "Unallowable data type.");
     1864        return(-2);
    18701865    }
    18711866    return(-1);
     
    20642059by a call to the 1D polynomial functions.
    20652060 
    2066 XXX: SDR is silent about data types.  PS_TYPE_F32 is implemented.
    2067  
    20682061XXX: The spline eval functions require input and output to be F32.  however
    20692062     the spline fit functions require F32 and F64.
  • trunk/psLib/src/math/psSpline.c

    r1985 r2106  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-10-06 22:27:06 $
     9 *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-10-14 01:44:48 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    206206}
    207207
    208 //XXX: remove this
    209 //typedef enum {
    210 //    PS_POLYNOMIAL_ORD,                 ///< Ordinary Polynomial
    211 //    PS_POLYNOMIAL_CHEB                 ///< Chebyshev Polynomial
    212 //} psPolynomialType;
    213 
    214208/*****************************************************************************
    215209    This routine must allocate memory for the polynomial structures.
     
    18581852{
    18591853    if (x->type.type != bins->type.type) {
    1860         // XXX: Generate error message.
    1861         return(-1);
     1854        psError(__func__, "x->type.type != bins->type.type");
     1855        return(-2);
    18621856    }
    18631857
     
    18671861        return(p_psVectorBinDisectF32(bins->data.F32, bins->n, x->data.F32));
    18681862    } else {
    1869         // XXX: Generate error message.
     1863        psError(__func__, "Unallowable data type.");
     1864        return(-2);
    18701865    }
    18711866    return(-1);
     
    20642059by a call to the 1D polynomial functions.
    20652060 
    2066 XXX: SDR is silent about data types.  PS_TYPE_F32 is implemented.
    2067  
    20682061XXX: The spline eval functions require input and output to be F32.  however
    20692062     the spline fit functions require F32 and F64.
Note: See TracChangeset for help on using the changeset viewer.