Changeset 17447 for trunk/psLib
- Timestamp:
- Apr 17, 2008, 1:43:03 PM (18 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 13 edited
-
fits/psFitsFloat.c (modified) (1 diff)
-
fits/psFitsHeader.c (modified) (4 diffs)
-
fits/psFitsImage.c (modified) (5 diffs)
-
fits/psFitsScale.c (modified) (2 diffs)
-
imageops/psImageMapFit.c (modified) (2 diffs)
-
math/psMatrix.c (modified) (2 diffs)
-
math/psPolynomialMD.c (modified) (2 diffs)
-
math/psStats.c (modified) (2 diffs)
-
sys/psTrace.c (modified) (7 diffs)
-
types/psHash.c (modified) (5 diffs)
-
types/psList.c (modified) (2 diffs)
-
types/psLookupTable.c (modified) (2 diffs)
-
types/psPixels.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsFloat.c
r16549 r17447 153 153 return NULL; 154 154 } 155 assert(out->type.type == PS_TYPE_F32);155 psAssert(out->type.type == PS_TYPE_F32, "impossible"); 156 156 for (int y = 0; y < numRows; y++) { 157 157 for (int x = 0; x < numCols; x++) { -
trunk/psLib/src/fits/psFitsHeader.c
r17053 r17447 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.4 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2008-0 3-19 20:23:06$9 * @version $Revision: 1.44 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-04-17 23:43:02 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 21 21 #include <strings.h> 22 22 23 #include "psAbort.h" 23 24 #include "psAssert.h" 24 25 #include "psFits.h" … … 230 231 ) 231 232 { 232 assert(fits);233 psAssert(fits, "impossible"); 233 234 234 235 psMetadata *header = psMetadataAlloc(); // Header, to return … … 414 415 // Need to look for MULTI, which won't be picked up using the iterator. 415 416 psMetadataItem *multiCheckItem = psMetadataLookup(header, item->name); 416 assert(multiCheckItem);417 psAssert(multiCheckItem, "impossible"); 417 418 unsigned int flag = 0; // Flag to indicate MULTI; otherwise default action 418 419 if (multiCheckItem->type == PS_DATA_METADATA_MULTI) { -
trunk/psLib/src/fits/psFitsImage.c
r16934 r17447 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2008-0 3-11 19:57:41$9 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-04-17 23:43:02 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 253 253 ) 254 254 { 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"); 260 260 261 261 *bscale = 1.0; … … 358 358 { 359 359 // 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 size365 assert(!output->parent); // No parents means the buffer is contiguous360 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 366 366 367 367 int anynull = 0; // Are there any NULLs in the data? … … 516 516 if (cfitsioBzero != 0.0) { 517 517 // p_psFitsTypeToCfitsio and imageToDiskRepresentation must not clash! 518 assert(bzero == 0.0 && bscale == 1.0);518 psAssert(bzero == 0.0 && bscale == 1.0, "impossible"); 519 519 bscale = 1.0; 520 520 bzero = cfitsioBzero; 521 521 } 522 522 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"); 524 524 525 525 int naxis = 3; // Number of axes … … 647 647 if (cfitsioBzero != 0.0) { 648 648 // p_psFitsTypeToCfitsio and imageToDiskRepresentation must not clash! 649 assert(bzero == 0.0 && bscale == 1.0);649 psAssert(bzero == 0.0 && bscale == 1.0, "impossible"); 650 650 bscale = 1.0; 651 651 bzero = cfitsioBzero; 652 652 } 653 653 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"); 655 655 656 656 //check to see if the HDU has the same datatype -
trunk/psLib/src/fits/psFitsScale.c
r17048 r17447 41 41 ) 42 42 { 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"); 47 47 48 48 double range = pow(2.0, options->bitpix); // Range of values for target BITPIX … … 101 101 ) 102 102 { 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"); 107 107 108 108 // Measure the mean and stdev -
trunk/psLib/src/imageops/psImageMapFit.c
r15841 r17447 7 7 * @author Eugene Magnier, IfA 8 8 * 9 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $10 * @date $Date: 200 7-12-15 01:20:03$9 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-04-17 23:43:02 $ 11 11 * 12 12 * Copyright 2007 Institute for Astronomy, University of Hawaii … … 338 338 { 339 339 // XXX add in full PS_ASSERTS 340 assert(map);341 assert(stats);342 assert(x);343 assert(y);344 assert(f);340 psAssert(map, "impossible"); 341 psAssert(stats, "impossible"); 342 psAssert(x, "impossible"); 343 psAssert(y, "impossible"); 344 psAssert(f, "impossible"); 345 345 346 346 // the user supplies one of various stats option pairs, -
trunk/psLib/src/math/psMatrix.c
r15824 r17447 22 22 * @author Andy Becker, University of Washington (SVD). 23 23 * 24 * @version $Revision: 1.5 5$ $Name: not supported by cvs2svn $25 * @date $Date: 200 7-12-14 02:49:44$24 * @version $Revision: 1.56 $ $Name: not supported by cvs2svn $ 25 * @date $Date: 2008-04-17 23:43:02 $ 26 26 * 27 27 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 768 768 /* make sure that these things are sorted! */ 769 769 if (i > 0) { 770 assert(eval->data.F64[i] <= eval->data.F64[i-1]);770 psAssert(eval->data.F64[i] <= eval->data.F64[i-1], "impossible"); 771 771 } 772 772 } -
trunk/psLib/src/math/psPolynomialMD.c
r17147 r17447 44 44 { 45 45 int numTerms = vector->n; // Number of terms 46 assert(matrix->numCols == numTerms && matrix->numRows == numTerms);47 assert(buffer && buffer->n == numTerms && buffer->type.type == PS_TYPE_F64);46 psAssert(matrix->numCols == numTerms && matrix->numRows == numTerms, "impossible"); 47 psAssert(buffer && buffer->n == numTerms && buffer->type.type == PS_TYPE_F64, "impossible"); 48 48 49 49 #ifdef DEBUG … … 161 161 ) 162 162 { 163 assert(poly);164 assert(coords);165 assert(values);163 psAssert(poly, "impossible"); 164 psAssert(coords, "impossible"); 165 psAssert(values, "impossible"); 166 166 167 167 double rms = 0.0; // Root mean square deviation -
trunk/psLib/src/math/psStats.c
r15840 r17447 13 13 * use ->min and ->max (PS_STAT_USE_RANGE) 14 14 * 15 * @version $Revision: 1.22 1$ $Name: not supported by cvs2svn $16 * @date $Date: 200 7-12-15 01:17:28$15 * @version $Revision: 1.222 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2008-04-17 23:43:02 $ 17 17 * 18 18 * Copyright 2006 IfA, University of Hawaii … … 521 521 } 522 522 523 assert(count > 1); // It should be, because we have a mean and standard deviation523 psAssert(count > 1, "impossible"); // It should be, because we have a mean and standard deviation 524 524 525 525 double stdev = stats->sampleStdev; // Standard deviation -
trunk/psLib/src/sys/psTrace.c
r12286 r17447 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.8 6$ $Name: not supported by cvs2svn $12 * @date $Date: 200 7-03-07 00:17:48$11 * @version $Revision: 1.87 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2008-04-17 23:43:02 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 52 52 #include <stdarg.h> 53 53 54 #include "psAbort.h" 54 55 #include "psAssert.h" 55 56 #include "psTrace.h" … … 83 84 static p_psComponent* componentAlloc(const char *name, int level) 84 85 { 85 assert(name);86 psAssert(name, "impossible"); 86 87 87 88 p_psComponent* comp = psAlloc(sizeof(p_psComponent)); … … 149 150 void p_psTraceReset(p_psComponent* currentNode) 150 151 { 151 assert(currentNode);152 psAssert(currentNode, "impossible"); 152 153 153 154 psS32 i = 0; … … 184 185 static bool componentAdd(const char *addNodeName, psS32 level) 185 186 { 186 assert(addNodeName);187 psAssert(addNodeName, "impossible"); 187 188 188 189 psS32 i = 0; // Loop index variable. … … 346 347 static psS32 doGetTraceLevel(const char *aname) 347 348 { 348 assert(aname);349 psAssert(aname, "impossible"); 349 350 char name[strlen(aname) + 1]; // need a writeable copy: for strsep() 350 351 char *pname = name; … … 472 473 psS32 defLevel) 473 474 { 474 assert(comp);475 psAssert(comp, "impossible"); 475 476 476 477 char line[1024]; -
trunk/psLib/src/types/psHash.c
r12316 r17447 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $15 * @date $Date: 200 7-03-08 19:58:37$14 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2008-04-17 23:43:03 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include <inttypes.h> 28 28 29 #include "psAbort.h" 29 30 #include "psHash.h" 30 31 #include "psMemory.h" … … 92 93 psHashBucket* next) 93 94 { 94 assert(key && strlen(key) > 0);95 psAssert(key && strlen(key) > 0, "impossible"); 95 96 96 97 // Allocate memory for the new hash bucket. … … 229 230 ) 230 231 { 231 assert(table);232 assert(table->n >= 0);233 assert(key && strlen(key) > 0);232 psAssert(table, "impossible"); 233 psAssert(table->n >= 0, "impossible"); 234 psAssert(key && strlen(key) > 0, "impossible"); 234 235 235 236 if (table->n == 0) { … … 244 245 hash = (64 * hash + *tmpchar) % (table->n); 245 246 } 246 assert(hash >= 0 && hash < table->n);247 psAssert(hash >= 0 && hash < table->n, "impossible"); 247 248 248 249 // ptr will have the correct hash bucket. -
trunk/psLib/src/types/psList.c
r12317 r17447 7 7 * @author Joshua Hoblitt, University of Hawaii 8 8 * 9 * @version $Revision: 1.6 7$ $Name: not supported by cvs2svn $10 * @date $Date: 200 7-03-08 20:38:30$9 * @version $Revision: 1.68 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-04-17 23:43:03 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 84 84 static bool listIteratorRemove(psListIterator* iterator) 85 85 { 86 assert(iterator);86 psAssert(iterator, "impossible"); 87 87 if (iterator->cursor == NULL) { 88 88 return false; -
trunk/psLib/src/types/psLookupTable.c
r12329 r17447 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.5 0$ $Name: not supported by cvs2svn $10 * @date $Date: 200 7-03-08 22:08:26$9 * @version $Revision: 1.51 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-04-17 23:43:03 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 193 193 static void lookupTableFree(psLookupTable* table) 194 194 { 195 assert(table);195 psAssert(table, "impossible"); 196 196 psFree(table->values); 197 197 psFree(table->filename); -
trunk/psLib/src/types/psPixels.c
r16963 r17447 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2008-0 3-13 01:03:08$9 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-04-17 23:43:03 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 20 20 #include <stdlib.h> 21 21 22 #include "psAbort.h" 22 23 #include "psPixels.h" 23 24 #include "psMemory.h" … … 31 32 static void pixelsFree(psPixels* pixels) 32 33 { 33 assert(pixels);34 psAssert(pixels, "impossible"); 34 35 psFree(pixels->data); 35 36 }
Note:
See TracChangeset
for help on using the changeset viewer.
