IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2098


Ignore:
Timestamp:
Oct 13, 2004, 2:12:40 PM (22 years ago)
Author:
gusciora
Message:

Added macro checks for NULL parameters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psAstrometry.c

    r2097 r2098  
    88 *  @author George Gusciora, MHPCC
    99 *
    10  *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-10-14 00:06:17 $
     10 *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-10-14 00:12:40 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5959{
    6060    int i = 0;
    61     if (transform == NULL) {
    62         psAbort(__func__, "input parameter transform is NULL.");
    63     }
     61    PS_CHECK_NULL_PTR_RETURN_NULL(transform);
    6462
    6563    for (i=2;i<(transform->x->nX);i++) {
     
    116114    double F = transform->y->coeff[0][1];
    117115
    118     if (transform == NULL) {
    119         psAbort(__func__, "input parameter transform is NULL.");
    120     }
     116    PS_CHECK_NULL_PTR_RETURN_NULL(transform);
    121117    psPlaneTransform *out = psAlloc(sizeof(psPlaneTransform));
    122118
     
    291287                            const psObservatory* observatory)
    292288{
     289    PS_CHECK_NULL_PTR_RETURN_NULL(observatory);
    293290    psExposure* exp = psAlloc(sizeof(psExposure));
    294291
     
    472469psGrommit* psGrommitAlloc(const psExposure* exp)
    473470{
    474     if (exp == NULL) {
    475         psAbort(__func__, "the 'exp' parameter is NULL\n");
    476     }
     471    PS_CHECK_NULL_PTR_RETURN_NULL(exp);
    477472
    478473    double date = psTimeToMJD(exp->time);
     
    610605                           const psCell* cell)
    611606{
    612     if (inCoord == NULL) {
    613         psAbort(__func__, "input parameter inCoord is NULL.");
    614     }
    615     if (cell == NULL) {
    616         psAbort(__func__, "input parameter cell is NULL.");
    617     }
     607    PS_CHECK_NULL_PTR_RETURN_NULL(inCoord);
     608    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
    618609
    619610    return (psPlaneTransformApply(outCoord, cell->toChip, inCoord));
     
    624615                          const psChip* chip)
    625616{
    626     if (inCoord == NULL) {
    627         psAbort(__func__, "input parameter inCoord is NULL.");
    628     }
    629     if (chip == NULL) {
    630         psAbort(__func__, "input parameter chip is NULL.");
    631     }
     617    PS_CHECK_NULL_PTR_RETURN_NULL(inCoord);
     618    PS_CHECK_NULL_PTR_RETURN_NULL(chip);
    632619
    633620    return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord));
     
    640627                        const psFPA* fpa)
    641628{
    642     if (inCoord == NULL) {
    643         psAbort(__func__, "input parameter inCoord is NULL.");
    644     }
    645     if (fpa == NULL) {
    646         psAbort(__func__, "input parameter fpa is NULL.");
    647     }
     629    PS_CHECK_NULL_PTR_RETURN_NULL(inCoord);
     630    PS_CHECK_NULL_PTR_RETURN_NULL(fpa);
    648631
    649632    return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord,
     
    661644    double ZOB = 0.0;
    662645    double HOB = 0.0;
    663 
    664     if (tpCoord == NULL) {
    665         psAbort(__func__, "input parameter tpCoord is NULL.");
    666     }
    667     if (grommit == NULL) {
    668         psAbort(__func__, "input parameter grommit is NULL.");
    669     }
     646    PS_CHECK_NULL_PTR_RETURN_NULL(tpCoord);
     647    PS_CHECK_NULL_PTR_RETURN_NULL(grommit);
    670648    if (outSphere == NULL) {
    671649        outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
     
    682660                          const psCell* cell)
    683661{
    684     if (cellCoord == NULL) {
    685         psAbort(__func__, "input parameter cellCoord is NULL.");
    686     }
    687     if (cell == NULL) {
    688         psAbort(__func__, "input parameter cell is NULL.");
    689     }
     662    PS_CHECK_NULL_PTR_RETURN_NULL(cellCoord);
     663    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
    690664
    691665    return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord));
     
    698672                           const psCell* cell)
    699673{
    700     if (cellCoord == NULL) {
    701         psAbort(__func__, "input parameter cellCoord is NULL.");
    702     }
    703     if (cell == NULL) {
    704         psAbort(__func__, "input parameter cell is NULL.");
    705     }
     674    PS_CHECK_NULL_PTR_RETURN_NULL(cellCoord);
     675    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
    706676
    707677    psPlane* fpaCoord = NULL;
     
    734704                                const psCell* cell)
    735705{
    736     if (cellCoord == NULL) {
    737         psAbort(__func__, "input parameter cellCoord is NULL.");
    738     }
    739     if (cell == NULL) {
    740         psAbort(__func__, "input parameter cell is NULL.");
    741     }
     706    PS_CHECK_NULL_PTR_RETURN_NULL(cellCoord);
     707    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
    742708
    743709    psPlane *tpCoord = NULL;
     
    776742    char* type = "RA";
    777743
    778     if (in == NULL) {
    779         psAbort(__func__, "input parameter in is NULL.");
    780     }
    781     if (grommit == NULL) {
    782         psAbort(__func__, "input parameter grommit is NULL.");
    783     }
     744    PS_CHECK_NULL_PTR_RETURN_NULL(in);
     745    PS_CHECK_NULL_PTR_RETURN_NULL(grommit);
     746
    784747    if (tpCoord == NULL) {
    785748        tpCoord = (psPlane* ) psAlloc(sizeof(psPlane));
     
    798761                        const psFPA* fpa)
    799762{
    800     if (tpCoord == NULL) {
    801         psAbort(__func__, "input parameter tpCoord is NULL.");
    802     }
    803     if (fpa == NULL) {
    804         psAbort(__func__, "input parameter fpa is NULL.");
    805     }
     763    PS_CHECK_NULL_PTR_RETURN_NULL(tpCoord);
     764    PS_CHECK_NULL_PTR_RETURN_NULL(fpa);
    806765
    807766    return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane,
     
    813772                          const psChip* chip)
    814773{
    815     if (fpaCoord == NULL) {
    816         psAbort(__func__, "input parameter fpaCoord is NULL.");
    817     }
    818     if (chip == NULL) {
    819         psAbort(__func__, "input parameter chip is NULL.");
    820     }
    821 
    822     psFPA *FPA = chip->parent;
    823     if (FPA == NULL) {
    824         psAbort(__func__, "chip->parent is NULL");
    825     }
    826 
     774    PS_CHECK_NULL_PTR_RETURN_NULL(fpaCoord);
     775    PS_CHECK_NULL_PTR_RETURN_NULL(chip);
     776    PS_CHECK_NULL_PTR_RETURN_NULL(chip->parent);
     777    //    psFPA *FPA = chip->parent;
    827778    chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord);
    828779
     
    834785                           const psCell* cell)
    835786{
    836     if (chipCoord == NULL) {
    837         psAbort(__func__, "input parameter chipCoord is NULL.");
    838     }
    839     if (cell == NULL) {
    840         psAbort(__func__, "input parameter cell is NULL.");
    841     }
    842 
    843     psChip *chip = cell->parent;
    844     if (chip == NULL) {
    845         psAbort(__func__, "cell->parent is NULL");
    846     }
     787    PS_CHECK_NULL_PTR_RETURN_NULL(chipCoord);
     788    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
     789    PS_CHECK_NULL_PTR_RETURN_NULL(cell->parent);
    847790
    848791    cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord);
     
    857800                          const psCell* cell)
    858801{
    859     if (skyCoord == NULL) {
    860         psAbort(__func__, "input parameter skyCoord is NULL.");
    861     }
    862     if (cell == NULL) {
    863         psAbort(__func__, "input parameter cell is NULL.");
    864     }
     802    PS_CHECK_NULL_PTR_RETURN_NULL(skyCoord);
     803    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
    865804
    866805    psChip *parChip = cell->parent;
     
    892831                               const psCell* cell)
    893832{
    894     if (skyCoord == NULL) {
    895         psAbort(__func__, "input parameter skyCoord is NULL.");
    896     }
    897     if (cell == NULL) {
    898         psAbort(__func__, "input parameter cell is NULL.");
    899     }
     833    PS_CHECK_NULL_PTR_RETURN_NULL(skyCoord);
     834    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
    900835
    901836    psPlane *tpCoord = NULL;
Note: See TracChangeset for help on using the changeset viewer.