IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17447 for trunk/psLib/src/fits


Ignore:
Timestamp:
Apr 17, 2008, 1:43:03 PM (18 years ago)
Author:
jhoblitt
Message:

convert assert() to psAssert()

Location:
trunk/psLib/src/fits
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fits/psFitsFloat.c

    r16549 r17447  
    153153            return NULL;
    154154        }
    155         assert(out->type.type == PS_TYPE_F32);
     155        psAssert(out->type.type == PS_TYPE_F32, "impossible");
    156156        for (int y = 0; y < numRows; y++) {
    157157            for (int x = 0; x < numCols; x++) {
  • trunk/psLib/src/fits/psFitsHeader.c

    r17053 r17447  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-03-19 20:23:06 $
     9 *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-04-17 23:43:02 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2121#include <strings.h>
    2222
     23#include "psAbort.h"
    2324#include "psAssert.h"
    2425#include "psFits.h"
     
    230231                              )
    231232{
    232     assert(fits);
     233    psAssert(fits, "impossible");
    233234
    234235    psMetadata *header = psMetadataAlloc(); // Header, to return
     
    414415        // Need to look for MULTI, which won't be picked up using the iterator.
    415416        psMetadataItem *multiCheckItem = psMetadataLookup(header, item->name);
    416         assert(multiCheckItem);
     417        psAssert(multiCheckItem, "impossible");
    417418        unsigned int flag = 0;      // Flag to indicate MULTI; otherwise default action
    418419        if (multiCheckItem->type == PS_DATA_METADATA_MULTI) {
  • trunk/psLib/src/fits/psFitsImage.c

    r16934 r17447  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-03-11 19:57:41 $
     9 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-04-17 23:43:02 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    253253                                          )
    254254{
    255     assert(bscale);
    256     assert(bzero);
    257     assert(floatType);
    258     assert(fits);
    259     assert(image);
     255    psAssert(bscale, "impossible");
     256    psAssert(bzero, "impossible");
     257    psAssert(floatType, "impossible");
     258    psAssert(fits, "impossible");
     259    psAssert(image, "impossible");
    260260
    261261    *bscale = 1.0;
     
    358358{
    359359    // n.b., this assumes contiguous image buffer
    360     assert(output);
    361     assert(fits);
    362     assert(info);
    363     assert(output->numCols == info->lastPixel[0] - info->firstPixel[0] + 1);
    364     assert(output->numRows == info->lastPixel[1] - info->firstPixel[1] + 1); // Right size
    365     assert(!output->parent);            // No parents means the buffer is contiguous
     360    psAssert(output, "impossible");
     361    psAssert(fits, "impossible");
     362    psAssert(info, "impossible");
     363    psAssert(output->numCols == info->lastPixel[0] - info->firstPixel[0] + 1, "impossible");
     364    psAssert(output->numRows == info->lastPixel[1] - info->firstPixel[1] + 1, "impossible"); // Right size
     365    psAssert(!output->parent, "impossible");            // No parents means the buffer is contiguous
    366366
    367367    int anynull = 0;                    // Are there any NULLs in the data?
     
    516516    if (cfitsioBzero != 0.0) {
    517517        // p_psFitsTypeToCfitsio and imageToDiskRepresentation must not clash!
    518         assert(bzero == 0.0 && bscale == 1.0);
     518        psAssert(bzero == 0.0 && bscale == 1.0, "impossible");
    519519        bscale = 1.0;
    520520        bzero = cfitsioBzero;
    521521    }
    522522    psFitsOptions *options = fits->options; // FITS I/O options
    523     assert(!options || bitPix == options->bitpix || options->bitpix == 0);
     523    psAssert(!options || bitPix == options->bitpix || options->bitpix == 0, "impossible");
    524524
    525525    int naxis = 3;                      // Number of axes
     
    647647    if (cfitsioBzero != 0.0) {
    648648        // p_psFitsTypeToCfitsio and imageToDiskRepresentation must not clash!
    649         assert(bzero == 0.0 && bscale == 1.0);
     649        psAssert(bzero == 0.0 && bscale == 1.0, "impossible");
    650650        bscale = 1.0;
    651651        bzero = cfitsioBzero;
    652652    }
    653653    psFitsOptions *options = fits->options; // FITS I/O options
    654     assert(!options || bitPix == options->bitpix || options->bitpix == 0);
     654    psAssert(!options || bitPix == options->bitpix || options->bitpix == 0, "impossible");
    655655
    656656    //check to see if the HDU has the same datatype
  • trunk/psLib/src/fits/psFitsScale.c

    r17048 r17447  
    4141    )
    4242{
    43     assert(bscale);
    44     assert(bzero);
    45     assert(image);
    46     assert(options);
     43    psAssert(bscale, "impossible");
     44    psAssert(bzero, "impossible");
     45    psAssert(image, "impossible");
     46    psAssert(options, "impossible");
    4747
    4848    double range = pow(2.0, options->bitpix); // Range of values for target BITPIX
     
    101101    )
    102102{
    103     assert(bscale);
    104     assert(bzero);
    105     assert(image);
    106     assert(options);
     103    psAssert(bscale, "impossible");
     104    psAssert(bzero, "impossible");
     105    psAssert(image, "impossible");
     106    psAssert(options, "impossible");
    107107
    108108    // Measure the mean and stdev
Note: See TracChangeset for help on using the changeset viewer.