Changeset 4589
- Timestamp:
- Jul 20, 2005, 3:40:10 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 17 edited
-
src/db/psDB.c (modified) (28 diffs)
-
src/db/psDB.h (modified) (18 diffs)
-
src/imageops/psImagePixelManip.c (modified) (5 diffs)
-
src/imageops/psImagePixelManip.h (modified) (2 diffs)
-
src/math/psMatrix.c (modified) (15 diffs)
-
src/math/psMatrix.h (modified) (6 diffs)
-
src/sys/psMemory.c (modified) (13 diffs)
-
src/sys/psMemory.h (modified) (7 diffs)
-
src/types/psLookupTable.c (modified) (14 diffs)
-
src/types/psLookupTable.h (modified) (2 diffs)
-
src/types/psMetadata.c (modified) (12 diffs)
-
src/types/psMetadata.h (modified) (6 diffs)
-
src/types/psMetadataConfig.c (modified) (17 diffs)
-
src/types/psMetadataConfig.h (modified) (2 diffs)
-
test/math/tst_psMatrix04.c (modified) (3 diffs)
-
test/types/verified/tst_psLookupTable_01.stderr (modified) (1 diff)
-
test/types/verified/tst_psMetadataIO.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/db/psDB.c
r4556 r4589 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-07- 15 02:33:52$14 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-07-21 01:40:10 $ 16 16 * 17 17 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 49 49 // SQL generation functions 50 50 static char *psDBGenerateCreateTableSQL(const char *tableName, const psMetadata *where); 51 static char *psDBGenerateSelectRowSQL(const char *tableName, const char *col, const psMetadata *where, psU64 limit); 51 static char *psDBGenerateSelectRowSQL(const char *tableName, const char *col, 52 const psMetadata *where, psU64 limit); 52 53 static char *psDBGenerateInsertRowSQL(const char *tableName, const psMetadata *row); 53 static char *psDBGenerateUpdateRowSQL(const char *tableName, const psMetadata *where, const psMetadata *values); 54 static char *psDBGenerateDeleteRowSQL(const char *tableName, const psMetadata *where, unsigned long long limit); 54 static char *psDBGenerateUpdateRowSQL(const char *tableName, const psMetadata *where, 55 const psMetadata *values); 56 static char *psDBGenerateDeleteRowSQL(const char *tableName, const psMetadata *where, 57 unsigned long long limit); 55 58 static char *psDBGenerateWhereSQL(const psMetadata *where); 56 59 static char *psDBGenerateSetSQL(const psMetadata *set … … 89 92 /*****************************************************************************/ 90 93 91 psDB *psDBInit(const char *host, const char *user, const char *passwd, const char *dbname) 94 psDB *psDBInit(const char *host, 95 const char *user, 96 const char *passwd, 97 const char *dbname) 92 98 { 93 99 MYSQL *mysql; … … 139 145 } 140 146 141 bool psDBCreate(psDB *dbh, const char *dbname) 147 bool psDBCreate(psDB *dbh, 148 const char *dbname) 142 149 { 143 150 char *query = NULL; … … 157 164 } 158 165 159 bool psDBChange(psDB *dbh, const char *dbname) 166 bool psDBChange(psDB *dbh, 167 const char *dbname) 160 168 { 161 169 // Verify database object is valid … … 177 185 } 178 186 179 bool psDBDrop(psDB *dbh, const char *dbname) 187 bool psDBDrop(psDB *dbh, 188 const char *dbname) 180 189 { 181 190 char *query = NULL; … … 195 204 } 196 205 197 bool psDBCreateTable(psDB *dbh, const char *tableName, const psMetadata *md) 206 bool psDBCreateTable(psDB *dbh, 207 const char *tableName, 208 const psMetadata *md) 198 209 { 199 210 char *query; … … 225 236 } 226 237 227 bool psDBDropTable(psDB *dbh, const char *tableName) 238 bool psDBDropTable(psDB *dbh, 239 const char *tableName) 228 240 { 229 241 char *query = NULL; … … 244 256 } 245 257 246 psArray *psDBSelectColumn(psDB *dbh, const char *tableName, const char *col, unsigned long long limit) 258 psArray *psDBSelectColumn(psDB *dbh, 259 const char *tableName, 260 const char *col, 261 unsigned long long limit) 247 262 { 248 263 MYSQL_RES *result; // complete db result set … … 339 354 } 340 355 341 psVector *psDBSelectColumnNum(psDB *dbh, const char *tableName, const char *col, psElemType type, unsigned long long limit) 356 psVector *psDBSelectColumnNum(psDB *dbh, 357 const char *tableName, 358 const char *col, 359 psElemType type, 360 unsigned long long limit) 342 361 { 343 362 psArray *stringColumn; // source psArray … … 403 422 } 404 423 405 psArray *psDBSelectRows(psDB *dbh, const char *tableName, const psMetadata *where, unsigned long long limit) 424 psArray *psDBSelectRows(psDB *dbh, 425 const char *tableName, 426 const psMetadata *where, 427 unsigned long long limit) 406 428 { 407 429 MYSQL_RES *result; // complete db result set … … 507 529 } 508 530 509 bool psDBInsertOneRow(psDB *dbh, const char *tableName, const psMetadata *row) 531 bool psDBInsertOneRow(psDB *dbh, 532 const char *tableName, 533 const psMetadata *row) 510 534 { 511 535 psArray *rowSet; // psArray of row to insert … … 534 558 } 535 559 536 bool psDBInsertRows(psDB *dbh, const char *tableName, const psArray *rowSet) 560 bool psDBInsertRows(psDB *dbh, 561 const char *tableName, 562 const psArray *rowSet) 537 563 { 538 564 psMetadata *row; // row of data … … 635 661 } 636 662 637 psArray *psDBDumpRows(psDB *dbh, const char *tableName) 663 psArray *psDBDumpRows(psDB *dbh, 664 const char *tableName) 638 665 { 639 666 return psDBSelectRows(dbh, tableName, NULL, 0); 640 667 } 641 668 642 psMetadata *psDBDumpCols(psDB *dbh, const char *tableName) 669 psMetadata *psDBDumpCols(psDB *dbh, 670 const char *tableName) 643 671 { 644 672 MYSQL_RES *result; … … 698 726 } 699 727 700 psS64 psDBUpdateRows(psDB *dbh, const char *tableName, const psMetadata *where, const psMetadata *values) 728 long psDBUpdateRows(psDB *dbh, 729 const char *tableName, 730 const psMetadata *where, 731 const psMetadata *values) 701 732 { 702 733 char *query; … … 779 810 } 780 811 781 psS64 psDBDeleteRows(psDB *dbh, const char *tableName, const psMetadata *where, unsigned long long limit) 812 long psDBDeleteRows(psDB *dbh, 813 const char *tableName, 814 const psMetadata *where, 815 unsigned long long limit) 782 816 { 783 817 char *query; … … 818 852 /*****************************************************************************/ 819 853 820 bool p_psDBRunQuery(psDB *dbh, const char *format) 854 bool p_psDBRunQuery(psDB *dbh, 855 const char *format) 821 856 { 822 857 // Verify database object is not NULL … … 835 870 } 836 871 837 static inline bool psDBPackRow(MYSQL_BIND *bind, const psMetadata *values, psU32 paramCount) 872 static inline bool psDBPackRow(MYSQL_BIND *bind, 873 const psMetadata *values, 874 psU32 paramCount) 838 875 { 839 876 psListIterator *cursor; // row iterator … … 928 965 /*****************************************************************************/ 929 966 930 static char *psDBGenerateCreateTableSQL(const char *tableName, const psMetadata *table) 967 static char *psDBGenerateCreateTableSQL(const char *tableName, 968 const psMetadata *table) 931 969 { 932 970 char *query = NULL; // complete query … … 1004 1042 } 1005 1043 1006 static char *psDBGenerateSelectRowSQL(const char *tableName, const char *col, const psMetadata *where, psU64 limit) 1044 static char *psDBGenerateSelectRowSQL(const char *tableName, 1045 const char *col, 1046 const psMetadata *where, 1047 psU64 limit) 1007 1048 { 1008 1049 char *query = NULL; … … 1041 1082 } 1042 1083 1043 static char *psDBGenerateInsertRowSQL(const char *tableName, const psMetadata *row) 1084 static char *psDBGenerateInsertRowSQL(const char *tableName, 1085 const psMetadata *row) 1044 1086 { 1045 1087 char *query = NULL; … … 1097 1139 } 1098 1140 1099 static char *psDBGenerateUpdateRowSQL(const char *tableName, const psMetadata *where, const psMetadata *values) 1141 static char *psDBGenerateUpdateRowSQL(const char *tableName, 1142 const psMetadata *where, 1143 const psMetadata *values) 1100 1144 { 1101 1145 char *query = NULL; … … 1131 1175 } 1132 1176 1133 static char *psDBGenerateDeleteRowSQL(const char *tableName, const psMetadata *where, unsigned long long limit) 1177 static char *psDBGenerateDeleteRowSQL(const char *tableName, 1178 const psMetadata *where, 1179 unsigned long long limit) 1134 1180 { 1135 1181 char *query = NULL; … … 1261 1307 /*****************************************************************************/ 1262 1308 1263 static psElemType psDBMySQLToPType(enum enum_field_types type, unsigned int flags) 1309 static psElemType psDBMySQLToPType(enum enum_field_types type, 1310 unsigned int flags) 1264 1311 { 1265 1312 psHash *mysqlToSQLTable; // type lookup table … … 1550 1597 } 1551 1598 1552 static psPtr psDBMySQLTypeAlloc(enum enum_field_types type, bool isUnsigned) 1599 static psPtr psDBMySQLTypeAlloc(enum enum_field_types type, 1600 bool isUnsigned) 1553 1601 { 1554 1602 mysqlType *mType; … … 1561 1609 } 1562 1610 1563 static void psDBAddToLookupTable(psHash *lookupTable, psU32 type, const char *string) 1611 static void psDBAddToLookupTable(psHash *lookupTable, 1612 psU32 type, 1613 const char *string) 1564 1614 { 1565 1615 char *key; … … 1575 1625 } 1576 1626 1577 static void psDBAddVoidToLookupTable(psHash *lookupTable, psU32 type, psPtr value) 1627 static void psDBAddVoidToLookupTable(psHash *lookupTable, 1628 psU32 type, 1629 psPtr value) 1578 1630 { 1579 1631 char *key; … … 1650 1702 #define PS_IS_NAN(type, data, nan) *(type *)data == nan 1651 1703 1652 static bool psDBIsPTypeNaN(psElemType pType, psPtr data) 1704 static bool psDBIsPTypeNaN(psElemType pType, 1705 psPtr data) 1653 1706 { 1654 1707 bool isNaN; -
trunk/psLib/src/db/psDB.h
r4540 r4589 10 10 * @author Joshua Hoblitt 11 11 * 12 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-07- 12 19:12:00 $12 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-21 01:40:10 $ 14 14 * 15 15 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 40 40 /** Opens a new database connection 41 41 * 42 * @return A new psDB object if the database connection is successful or NULL on42 * @return psDB*: A new psDB object if the database connection is successful or NULL on 43 43 * failure. 44 44 */ … … 50 50 ); 51 51 52 /** Closes a database connection 53 */ 52 /** Closes a database connection */ 54 53 void psDBCleanup( 55 54 psDB *dbh ///< Database handle … … 58 57 /** Creates a new database namespace 59 58 * 60 * @return true on success59 * @return bool: true on success 61 60 */ 62 61 bool psDBCreate( … … 67 66 /** Changes the current database namespace 68 67 * 69 * @return true on success68 * @return bool: true on success 70 69 */ 71 70 bool psDBChange( … … 76 75 /** Drops a database namespace 77 76 * 78 * @return true on success77 * @return bool: true on success 79 78 */ 80 79 bool psDBDrop( … … 89 88 * dialect is provided. Caveat emptor. 90 89 * 91 * @return true on success90 * @return bool: true on success 92 91 */ 93 92 bool p_psDBRunQuery( … … 114 113 * Key" or "Key". Comments are otherwise ignored. 115 114 * 116 * @return true on success115 * @return bool: true on success 117 116 */ 118 117 bool psDBCreateTable( … … 124 123 /** Deletes a database table 125 124 * 126 * @return true on success125 * @return bool: true on success 127 126 */ 128 127 bool psDBDropTable( … … 137 136 * entire range is returned. 138 137 * 139 * @return A psArray of strings or NULL on failure138 * @return psArray*: A psArray of strings or NULL on failure 140 139 */ 141 140 psArray *psDBSelectColumn( … … 152 151 * entire range is returned. The data in the column is cast to to "pType". 153 152 * 154 * @return A psVector or NULL on failure153 * @return psVector*: A psVector or NULL on failure 155 154 */ 156 155 psVector *psDBSelectColumnNum( … … 174 173 * string, e.g. "", to match NULL field values. 175 174 * 176 * @return A psArray of psMetadata or NULL on failure175 * @return psArray*: A psArray of psMetadata or NULL on failure 177 176 */ 178 177 psArray *psDBSelectRows( … … 192 191 * specified in "row" that do not exist in "tableName", the insert will fail. 193 192 * 194 * @return true on success193 * @return bool: true on success 195 194 */ 196 195 bool psDBInsertOneRow( … … 207 206 * those used in psDBInsertOneRow(). 208 207 * 209 * @return true on success208 * @return bool: true on success 210 209 */ 211 210 bool psDBInsertRows( … … 220 219 * the same psMetadata format as used in psDBInsertOneRow() & psDBInsertRows(). 221 220 * 222 * @return A psArray of psMetadata or NULL on failure221 * @return psArray*: A psArray of psMetadata or NULL on failure 223 222 */ 224 223 psArray *psDBDumpRows( … … 233 232 * psMetadata structure where psMetadataItem.name contains the column's name. 234 233 * 235 * @return A psMetadata containing either a psArrays or psVector per column234 * @return psMetadata*: A psMetadata containing either a psArrays or psVector per column 236 235 */ 237 236 psMetadata *psDBDumpCols( … … 249 248 * used in psDBInsertOneRow(), etc. 250 249 * 251 * @return The number of rows modified or a negative value on error252 */ 253 psS64psDBUpdateRows(250 * @return long: The number of rows modified or a negative value on error 251 */ 252 long psDBUpdateRows( 254 253 psDB *dbh, ///< Database handle 255 254 const char *tableName, ///< Table name … … 266 265 * the number of rows that were dropped, only 1 will be returned on success. 267 266 * 268 * @return The number of rows removed or a negative value on error269 */ 270 psS64psDBDeleteRows(267 * @return long: The number of rows removed or a negative value on error 268 */ 269 long psDBDeleteRows( 271 270 psDB *dbh, ///< Database handle 272 271 const char *tableName, ///< Table name -
trunk/psLib/src/imageops/psImagePixelManip.c
r4544 r4589 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-07- 12 19:33:49$12 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-21 01:40:10 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 187 187 int psImageOverlaySection(psImage* image, 188 188 const psImage* overlay, 189 int col0,190 int row0,189 int x0, 190 int y0, 191 191 const char *op) 192 192 { … … 229 229 overlayNumRows = overlay->numRows; 230 230 overlayNumCols = overlay->numCols; 231 imageRowLimit = row0 + overlayNumRows;232 imageColLimit = col0 + overlayNumCols;231 imageRowLimit = y0 + overlayNumRows; 232 imageColLimit = x0 + overlayNumCols; 233 233 234 234 /* check to see if overlay is within the input image */ 235 if ( row0 < 0 ||236 col0 < 0 ||235 if ( y0 < 0 || 236 x0 < 0 || 237 237 imageRowLimit > imageNumRows || 238 238 imageColLimit > imageNumCols) { … … 240 240 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 241 241 PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID, 242 col0, imageColLimit, row0, imageRowLimit,242 x0, imageColLimit, y0, imageRowLimit, 243 243 imageNumCols, imageNumRows); 244 244 return pixelsOverlaid; … … 247 247 248 248 #define psImageOverlayLoop(DATATYPE,OP) { \ 249 for (int row= row0;row<imageRowLimit;row++) { \249 for (int row=y0;row<imageRowLimit;row++) { \ 250 250 ps##DATATYPE* imageRow = image->data.DATATYPE[row]; \ 251 ps##DATATYPE* overlayRow = overlay->data.DATATYPE[row- row0]; \252 for (int col= col0;col<imageColLimit;col++) { \253 imageRow[col] OP overlayRow[col- col0]; \254 } \ 255 } \ 256 pixelsOverlaid += (imageRowLimit - row0) * (imageColLimit - col0); \251 ps##DATATYPE* overlayRow = overlay->data.DATATYPE[row-y0]; \ 252 for (int col=x0;col<imageColLimit;col++) { \ 253 imageRow[col] OP overlayRow[col-x0]; \ 254 } \ 255 } \ 256 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 257 257 } 258 258 -
trunk/psLib/src/imageops/psImagePixelManip.h
r4540 r4589 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-07- 12 19:12:01$10 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-07-21 01:40:10 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 83 83 psImage* image, ///< target image 84 84 const psImage* overlay, ///< the overlay image 85 int col0,///< the column to start overlay86 int row0,///< the row to start overlay85 int x0, ///< the column to start overlay 86 int y0, ///< the row to start overlay 87 87 const char *op ///< the operation to perform for overlay 88 88 ); -
trunk/psLib/src/math/psMatrix.c
r4540 r4589 21 21 * @author Robert DeSonia, MHPCC 22 22 * 23 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $24 * @date $Date: 2005-07- 12 19:12:01$23 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-07-21 01:40:10 $ 25 25 * 26 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 95 95 96 96 /** Static function to copy psF32 or psF64 vector data to a GSL vector */ 97 static void psVectorToGslVector(gsl_vector *outGslVector, const psVector *inVector) 97 static void psVectorToGslVector(gsl_vector *outGslVector, 98 const psVector *inVector) 98 99 { 99 100 psU32 i = 0; … … 112 113 113 114 /** Static function to copy GSL vector data to a psF32 or psF64 vector */ 114 static void gslVectorToPsVector(psVector *outVector, gsl_vector *inGslVector) 115 static void gslVectorToPsVector(psVector *outVector, 116 gsl_vector *inGslVector) 115 117 { 116 118 psU32 i = 0; … … 129 131 130 132 /** Static function to copy psF32 or psF64 image data to a GSL matrix */ 131 static void psImageToGslMatrix(gsl_matrix *outGslMatrix, const psImage *inImage) 133 static void psImageToGslMatrix(gsl_matrix *outGslMatrix, 134 const psImage *inImage) 132 135 { 133 136 psU32 i = 0; … … 155 158 156 159 /** Static function to copy GSL matrix data to a psF32 or psF64 image */ 157 static void gslMatrixToPsImage(psImage *outImage, gsl_matrix *inGslMatrix) 160 static void gslMatrixToPsImage(psImage *outImage, 161 gsl_matrix *inGslMatrix) 158 162 { 159 163 psU32 i = 0; … … 185 189 /*****************************************************************************/ 186 190 187 psImage* psMatrixLUD(psImage* out, psVector** perm, psImage* in) 191 psImage* psMatrixLUD(psImage* out, 192 psVector** perm, 193 const psImage* in) 188 194 { 189 195 psS32 signum = 0; … … 243 249 } 244 250 245 psVector* psMatrixLUSolve(psVector* out, const psImage* LU, const psVector* RHS, 251 psVector* psMatrixLUSolve(psVector* out, 252 const psImage* LU, 253 const psVector* RHS, 246 254 const psVector* perm) 247 255 { … … 298 306 } 299 307 300 psImage* psMatrixInvert(psImage* out, const psImage* in, float *determinant) 308 psImage* psMatrixInvert(psImage* out, 309 const psImage* in, 310 float *determinant) 301 311 { 302 312 psS32 signum = 0; … … 346 356 } 347 357 348 float *psMatrixDeterminant(const psImage* in)358 float psMatrixDeterminant(const psImage* in) 349 359 { 350 360 psS32 signum = 0; 351 361 psS32 numRows = 0; 352 362 psS32 numCols = 0; 353 psF32 *det = NULL;363 psF32 det = 0; 354 364 gsl_matrix *lu = NULL; 355 365 gsl_permutation *perm = NULL; 356 366 357 #define DETERMINANT_EXIT { return NULL; }367 #define DETERMINANT_EXIT { return 0; } 358 368 // Error checks 359 369 PS_ASSERT_GENERAL_IMAGE_NON_NULL(in, DETERMINANT_EXIT); … … 372 382 373 383 // Calculate determinant 374 det = (psF32*)psAlloc(sizeof(psF32));384 // det = psAlloc(sizeof(psF32)); 375 385 gsl_linalg_LU_decomp(lu, perm, &signum); 376 *det = (psF32)gsl_linalg_LU_det(lu, signum);386 det = (psF32)gsl_linalg_LU_det(lu, signum); 377 387 378 388 // Free GSL structs … … 383 393 } 384 394 385 psImage* psMatrixMultiply(psImage* out, psImage* in1, psImage* in2) 395 psImage* psMatrixMultiply(psImage* out, 396 const psImage* in1, 397 const psImage* in2) 386 398 { 387 399 gsl_matrix *m1 = NULL; … … 434 446 } 435 447 436 psImage* psMatrixTranspose(psImage* out, const psImage* in) 448 psImage* psMatrixTranspose(psImage* out, 449 const psImage* in) 437 450 { 438 451 psU32 i = 0; … … 480 493 } 481 494 482 psImage* psMatrixEigenvectors(psImage* out, psImage* in) 495 psImage* psMatrixEigenvectors(psImage* out, 496 const psImage* in) 483 497 { 484 498 psS32 numRows = 0; … … 529 543 } 530 544 531 psVector* psMatrixToVector(psVector* outVector, const psImage* inImage) 545 psVector* psMatrixToVector(psVector* outVector, 546 const psImage* inImage) 532 547 { 533 548 psS32 size = 0; … … 593 608 } 594 609 595 psImage* psVectorToMatrix(psImage* outImage, const psVector* inVector) 610 psImage* psVectorToMatrix(psImage* outImage, 611 const psVector* inVector) 596 612 { 597 613 psS32 size = 0; -
trunk/psLib/src/math/psMatrix.h
r4388 r4589 21 21 * @author Ross Harman, MHPCC 22 22 * 23 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $24 * @date $Date: 2005-0 6-25 01:15:01$23 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-07-21 01:40:10 $ 25 25 * 26 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 45 45 psImage* out, ///< Image to return, or NULL. 46 46 psVector** perm, ///< Output permutation vector used by psMatrixLUSolve. 47 psImage* in///< Image to decompose.47 const psImage* in ///< Image to decompose. 48 48 ); 49 49 … … 87 87 * @return float: Determinant from psImage. 88 88 */ 89 float *psMatrixDeterminant(89 float psMatrixDeterminant( 90 90 const psImage* in ///< Image used to calculate determinant. 91 91 ); … … 102 102 psImage* psMatrixMultiply( 103 103 psImage* out, ///< Matrix to return, or NULL. 104 psImage* in1,///< First input image.105 psImage* in2///< Second input image.104 const psImage* in1, ///< First input image. 105 const psImage* in2 ///< Second input image. 106 106 ); 107 107 … … 116 116 */ 117 117 psImage* psMatrixTranspose( 118 psImage* out, ///< Image to return, or NULL119 const psImage* in Image///< Image to transpose118 psImage* out, ///< Image to return, or NULL 119 const psImage* in ///< Image to transpose 120 120 ); 121 121 … … 130 130 psImage* psMatrixEigenvectors( 131 131 psImage* out, ///< Eigenvectors to return, or NULL. 132 psImage* in///< Input image.132 const psImage* in ///< Input image. 133 133 ); 134 134 -
trunk/psLib/src/sys/psMemory.c
r4556 r4589 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1. 59$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-07- 15 02:33:54$10 * @version $Revision: 1.60 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-07-21 01:40:10 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 102 102 } 103 103 104 static void memProblemCallbackDefault( psMemBlock* ptr, const char *file, unsigned int lineno) 104 static void memProblemCallbackDefault(psMemBlock* ptr, 105 const char *file, 106 unsigned int lineno) 105 107 { 106 108 if (ptr->refCounter < 1) { … … 120 122 * N.b. If the block wasn't allocated by psAlloc, it will appear corrupted 121 123 */ 122 static psS32 checkMemBlock(const psMemBlock* m, const char *funcName) 124 static psS32 checkMemBlock(const psMemBlock* m, 125 const char *funcName) 123 126 { 124 127 // n.b. since this is called by psMemCheckCorruption while the memblock list is mutex locked, … … 286 289 } 287 290 288 psPtr p_psAlloc(size_t size, const char *file, unsigned int lineno) 291 psPtr p_psAlloc(size_t size, 292 const char *file, 293 unsigned int lineno) 289 294 { 290 295 … … 370 375 } 371 376 372 psPtr p_psRealloc(psPtr vptr, size_t size, const char *file, unsigned int lineno) 377 psPtr p_psRealloc(psPtr vptr, 378 size_t size, 379 const char *file, 380 unsigned int lineno) 373 381 { 374 382 size = (size < recycleBinSize[0]) ? recycleBinSize[0] : size; // set the minimum size to allocate … … 424 432 } 425 433 426 void p_psFree(psPtr vptr, const char *file, unsigned int lineno) 434 void p_psFree(psPtr vptr, 435 const char *filename, 436 unsigned int lineno) 427 437 { 428 438 if (vptr == NULL) { … … 434 444 435 445 psAbort(__func__,PS_ERRORTEXT_psMemory_MULTIPLE_FREE, 436 ptr->id, ptr->file, ptr->lineno, file , lineno);446 ptr->id, ptr->file, ptr->lineno, filename, lineno); 437 447 } 438 448 439 449 if (checkMemBlock(ptr, __func__) != 0) { 440 memProblemCallback(ptr, file , lineno);450 memProblemCallback(ptr, filename, lineno); 441 451 psAbort(__func__,"Memory Corruption Detected."); 442 452 } 443 453 444 (void)p_psMemDecrRefCounter(vptr, file , lineno); // this handles the free, if required.454 (void)p_psMemDecrRefCounter(vptr, filename, lineno); // this handles the free, if required. 445 455 } 446 456 … … 448 458 * Check for memory leaks. 449 459 */ 450 psS32 psMemCheckLeaks(psMemId id0, psMemBlock* ** arr, FILE * fd, psBool persistence) 460 int psMemCheckLeaks(psMemId id0, 461 psMemBlock* ** arr, 462 FILE * fd, 463 psBool persistence) 451 464 { 452 465 psS32 nleak = 0; … … 527 540 528 541 // increment and return refCounter 529 psPtr p_psMemIncrRefCounter(psPtr vptr, const char *file, psS32 lineno) 542 psPtr p_psMemIncrRefCounter(psPtr vptr, 543 const char *file, 544 psS32 lineno) 530 545 { 531 546 psMemBlock* ptr; … … 549 564 550 565 // decrement and return refCounter 551 psPtr p_psMemDecrRefCounter(psPtr vptr, const char *file, psS32 lineno) 566 psPtr p_psMemDecrRefCounter(psPtr vptr, 567 const char *file, 568 psS32 lineno) 552 569 { 553 570 if (vptr == NULL) { … … 640 657 } 641 658 642 void psMemSetDeallocator(psPtr ptr, psFreeFunc freeFunc) 659 void psMemSetDeallocator(psPtr ptr, 660 psFreeFunc freeFunc) 643 661 { 644 662 if (ptr == NULL) { … … 655 673 656 674 } 657 psFreeFunc psMemGetDeallocator( psPtr ptr)675 psFreeFunc psMemGetDeallocator(const psPtr ptr) 658 676 { 659 677 if (ptr == NULL) { … … 685 703 } 686 704 687 void p_psMemSetPersistent(psPtr vptr, bool value) 705 void p_psMemSetPersistent(psPtr vptr, 706 bool value) 688 707 { 689 708 if (vptr == NULL) { -
trunk/psLib/src/sys/psMemory.h
r4578 r4589 12 12 * @ingroup MemoryManagement 13 13 * 14 * @version $Revision: 1.4 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-07- 18 20:54:22$14 * @version $Revision: 1.47 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-07-21 01:40:10 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 169 169 */ 170 170 psFreeFunc psMemGetDeallocator( 171 psPtr ptr ///< the memory block171 const psPtr ptr ///< the memory block 172 172 ); 173 173 … … 239 239 void p_psFree( 240 240 psPtr ptr, ///< Pointer to free 241 const char *file ,///< File of call241 const char *filename, ///< File of call 242 242 unsigned int lineno ///< Line number of call 243 243 ); … … 260 260 * If memory leaks are found, the Memory Problem callback will be called as well. 261 261 * 262 * return psS32number of memory blocks found as 'leaks', i.e., the number of currently allocated memory262 * @return int number of memory blocks found as 'leaks', i.e., the number of currently allocated memory 263 263 * blocks above id0 that have not been freed. 264 264 * @see psAlloc, psFree, psgetMemId, psMemProblemCallbackSet 265 265 * @ingroup memTracing 266 266 */ 267 psS32psMemCheckLeaks(267 int psMemCheckLeaks( 268 268 psMemId id0, ///< don't list blocks with id < id0 269 269 psMemBlock* ** arr, ///< pointer to array of pointers to leaked blocks, or NULL … … 275 275 * i.e., invalid markers that signify a buffer under/overflow. 276 276 * 277 * @return int 278 * 277 279 * @ingroup memTracing 278 280 */ … … 283 285 /** Return reference counter 284 286 * 287 * @return psReferenceCount 288 * 285 289 * @ingroup memRefCount 286 290 */ … … 290 294 291 295 /** Increment reference counter and return the pointer 296 * 297 * @return psPtr 292 298 * 293 299 * @ingroup memRefCount -
trunk/psLib/src/types/psLookupTable.c
r4556 r4589 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-07- 15 02:33:54$9 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-21 01:40:10 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 83 83 /** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null 84 84 * terminated copy of the original input string. */ 85 static char *cleanString(char *inString, int sLen) 85 static char *cleanString(char *inString, 86 int sLen) 86 87 { 87 88 char *ptrB = NULL; … … 114 115 /** Returns cleaned token based on delimiter, but not including delimiter. Also changes the pointer location 115 116 * the beginning of the string. Tokens are newly allocated null terminated strings. */ 116 static char* getToken(char **inString, char *delimiter, psParseErrorType *status) 117 static char* getToken(char **inString, 118 char *delimiter, 119 psParseErrorType *status) 117 120 { 118 121 char *cleanToken = NULL; … … 141 144 142 145 /** Returns single parsed value as a psS32. The input string must be cleaned and null terminated. */ 143 static psS32 parseS32(char *inString, psParseErrorType *status) 146 static psS32 parseS32(char *inString, 147 psParseErrorType *status) 144 148 { 145 149 char *end = NULL; … … 158 162 159 163 /** Returns single parsed value as a psS64. The input string must be cleaned and null terminated. */ 160 static psS64 parseS64(char *inString, psParseErrorType *status) 164 static psS64 parseS64(char *inString, 165 psParseErrorType *status) 161 166 { 162 167 char *end = NULL; … … 174 179 175 180 /** Returns single parsed value as a psF32. The input string must be cleaned and null terminated. */ 176 static psF32 parseF32(char *inString, psParseErrorType *status) 181 static psF32 parseF32(char *inString, 182 psParseErrorType *status) 177 183 { 178 184 char *end = NULL; … … 190 196 191 197 /** Returns single parsed value as a psF64. The input string must be cleaned and null terminated. */ 192 static psF64 parseF64(char *inString, psParseErrorType *status) 198 static psF64 parseF64(char *inString, 199 psParseErrorType *status) 193 200 { 194 201 char *end = NULL; … … 207 214 /** Returns single parsed value as a double precision number. The input string must be cleaned and null 208 215 * terminated. */ 209 static void parseValue(psVector *vec, psU64 index, char* strValue, psParseErrorType *status) 216 static void parseValue(psVector *vec, 217 psU64 index, 218 char* strValue, 219 psParseErrorType *status) 210 220 { 211 221 psElemType type; … … 254 264 /*****************************************************************************/ 255 265 256 psLookupTable* psLookupTableAlloc(const char *fileName, const char *format, long indexCol) 266 psLookupTable* psLookupTableAlloc(const char *filename, 267 const char *format, 268 long indexCol) 257 269 { 258 270 psLookupTable *outTable = NULL; 259 271 260 272 // Can't read table if you don't know its name 261 PS_ASSERT_PTR_NON_NULL(file Name,NULL);273 PS_ASSERT_PTR_NON_NULL(filename,NULL); 262 274 263 275 // Can't read table if you don't know its format … … 271 283 272 284 // Allocate and set file name and format strings 273 outTable->filename = psStringCopy(file Name);285 outTable->filename = psStringCopy(filename); 274 286 outTable->format = psStringCopy(format); 275 287 … … 396 408 } 397 409 398 psArray *psVectorsReadFromFile(const char *filename, const char *format) 410 psArray *psVectorsReadFromFile(const char *filename, 411 const char *format) 399 412 { 400 413 psArray* outputArray = NULL; … … 548 561 } 549 562 550 psLookupTable *psLookupTableImport(psLookupTable *table, const psArray *vectors, long indexCol) 563 psLookupTable *psLookupTableImport(psLookupTable *table, 564 const psArray *vectors, 565 long indexCol) 551 566 { 552 567 psLookupTable* outputTable = NULL; … … 745 760 } 746 761 747 double psLookupTableInterpolate(const psLookupTable *table, double index, long column) 762 double psLookupTableInterpolate(const psLookupTable *table, 763 double index, 764 long column) 748 765 { 749 766 psU64 hiIdx = 0; … … 818 835 } 819 836 820 psVector* psLookupTableInterpolateAll(const psLookupTable *table, double index) 837 psVector* psLookupTableInterpolateAll(const psLookupTable *table, 838 double index) 821 839 { 822 840 long numCols = 0; -
trunk/psLib/src/types/psLookupTable.h
r4556 r4589 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-07- 15 02:33:54$9 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-21 01:40:10 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 68 68 */ 69 69 psLookupTable* psLookupTableAlloc( 70 const char *file Name, ///< Name of file to read70 const char *filename, ///< Name of file to read 71 71 const char *format, ///< scanf-like format string 72 72 long indexCol ///< Column of the index vector (starting at zero) -
trunk/psLib/src/types/psMetadata.c
r4556 r4589 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.7 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-07- 15 02:33:54$14 * @version $Revision: 1.72 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-07-21 01:40:10 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 69 69 /*****************************************************************************/ 70 70 71 static psMetadataItem* makeMetaMulti(psHash* table, const char* key, psMetadataItem* existing) 71 static psMetadataItem* makeMetaMulti(psHash* table, 72 const char* key, 73 psMetadataItem* existing) 72 74 { 73 75 … … 99 101 static void metadataItemFree(psMetadataItem* metadataItem) 100 102 { 101 ps MetadataType type;103 psDataType type; 102 104 103 105 type = metadataItem->type; … … 141 143 /*****************************************************************************/ 142 144 143 psMetadataItem* psMetadataItemAlloc(const char *name, psMetadataType type, 144 const char *comment, ...) 145 psMetadataItem* psMetadataItemAlloc(const char *name, 146 psDataType type, 147 const char *comment, 148 ...) 145 149 { 146 150 va_list argPtr; … … 173 177 METADATAITEM_ALLOC_TYPE(Bool,psBool,PS_META_BOOL) 174 178 175 psMetadataItem* psMetadataItemAllocV(const char *name, psMetadataType type, 176 const char *comment, va_list argPtr) 179 psMetadataItem* psMetadataItemAllocV(const char *name, 180 psDataType type, 181 const char *comment, 182 va_list argPtr) 177 183 { 178 184 psMetadataItem* metadataItem = NULL; … … 268 274 } 269 275 270 bool psMetadataAddItem(psMetadata *md, const psMetadataItem *item, long location, psS32 flags) 276 bool psMetadataAddItem(psMetadata *md, 277 const psMetadataItem *item, 278 int location, 279 psS32 flags) 271 280 { 272 281 char * key = NULL; … … 360 369 } 361 370 362 bool psMetadataAdd(psMetadata *md, long location, const char *name, 363 int format, const char *comment, ...) 371 bool psMetadataAdd(psMetadata *md, 372 long location, 373 const char *name, 374 int format, 375 const char *comment, 376 ...) 364 377 { 365 378 va_list argPtr; … … 372 385 } 373 386 374 bool psMetadataAddV(psMetadata *md, long location, const char *name, 375 int format, const char *comment, va_list list) 387 bool psMetadataAddV(psMetadata *md, 388 long location, 389 const char *name, 390 int format, 391 const char *comment, 392 va_list list) 376 393 { 377 394 psMetadataItem* metadataItem = NULL; … … 409 426 METADATA_ADD_TYPE(Array,psArray*,PS_META_ARRAY) 410 427 411 psBool psMetadataRemove(psMetadata *md, long where, const char *key) 428 psBool psMetadataRemove(psMetadata *md, 429 long where, 430 const char *key) 412 431 { 413 432 PS_ASSERT_PTR_NON_NULL(md,NULL); … … 477 496 } 478 497 479 psMetadataItem* psMetadataLookup(const psMetadata *md, const char *key) 498 psMetadataItem* psMetadataLookup(const psMetadata *md, 499 const char *key) 480 500 { 481 501 psHash* mdTable = NULL; … … 493 513 } 494 514 495 void* psMetadataLookupPtr(bool *status, const psMetadata *md, const char *key) 515 void* psMetadataLookupPtr(bool *status, 516 const psMetadata *md, 517 const char *key) 496 518 { 497 519 psMetadataItem *metadataItem = NULL; … … 580 602 psMetadataLookupNumTYPE(Bool) 581 603 582 psMetadataItem* psMetadataGet(const psMetadata *md, long location) 604 psMetadataItem* psMetadataGet(const psMetadata *md, 605 int location) 583 606 { 584 607 psMetadataItem* entry = NULL; -
trunk/psLib/src/types/psMetadata.h
r4556 r4589 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-07- 15 02:33:54$13 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-21 01:40:10 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 118 118 const psS32 id; ///< Unique ID for metadata item. 119 119 psString name; ///< Name of metadata item. 120 ps MetadataType type;///< Type of metadata item.120 psDataType type; ///< Type of metadata item. 121 121 union { 122 122 psBool B; ///< boolean data … … 149 149 psMetadataItem* psMetadataItemAlloc( 150 150 const char *name, ///< Name of metadata item. 151 ps MetadataType type,///< Type of metadata item.151 psDataType type, ///< Type of metadata item. 152 152 const char *comment, ///< Comment for metadata item. 153 153 ... ///< Arguments for name formatting and metadata item data. … … 238 238 psMetadataItem* psMetadataItemAllocV( 239 239 const char *name, ///< Name of metadata item. 240 ps MetadataType type, ///< Type of metadata item.240 psDataType type, ///< Type of metadata item. 241 241 const char *comment, ///< Comment for metadata item. 242 242 va_list list ///< Arguments for name formatting and metadata item data. … … 263 263 psMetadata* md, ///< Metadata collection to insert metadat item. 264 264 const psMetadataItem* item, ///< Metadata item to be added. 265 long location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL265 int location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 266 266 psS32 flags ///< Options flag mask, see psMetadataFlags enum 267 267 ); … … 551 551 psMetadataItem* psMetadataGet( 552 552 const psMetadata* md, ///< Metadata collection to retrieve metadata item. 553 longlocation ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL553 int location ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 554 554 ); 555 555 -
trunk/psLib/src/types/psMetadataConfig.c
r4556 r4589 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-07- 15 02:33:54$12 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-21 01:40:10 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 86 86 ; 87 87 static void parseLevelInfoFree(p_psParseLevelInfo* info); 88 static psBool parseLine(psS32* level, psArray* levelArray, 89 char* linePtr, psS32 lineCount, char* fileName, psBool overwrite); 90 static psBool parseMetadataItem(char* keyName, psS32* level, psArray* levelArray, 91 char* linePtr, psS32 lineCount, char* fileName, psMetadataFlags flags); 92 88 static psBool parseLine(psS32* level, psArray* levelArray, char* linePtr, psS32 lineCount, 89 char* fileName, psBool overwrite); 90 static psBool parseMetadataItem(char* keyName, psS32* level, psArray* levelArray, char* linePtr, 91 psS32 lineCount, char* fileName, psMetadataFlags flags); 93 92 static void parseLevelInfoFree(p_psParseLevelInfo* info) 94 93 { … … 117 116 // Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null 118 117 // terminated copy of the original input string. 119 static char *cleanString(char *inString, psS32 sLen, psBool ignoreComment) 118 static char *cleanString(char *inString, 119 psS32 sLen, 120 psBool ignoreComment) 120 121 { 121 122 char *ptrB = NULL; … … 163 164 164 165 // Count repeat occurances of a single character within a line. The input string must be null terminated. 165 static psS32 repeatedChars(char *inString, char ch) 166 static psS32 repeatedChars(char *inString, 167 char ch) 166 168 { 167 169 psS32 count = 0; … … 179 181 // Returns cleaned token based on delimiter, but not including delimiter. Also changes the pointer location 180 182 // the beginning of the string. Tokens are newly allocated null terminated strings. 181 static char* getToken(char **inString, char *delimiter, psS32 *status, psBool ignoreComment) 183 static char* getToken(char **inString, 184 char *delimiter, 185 psS32 *status, 186 psBool ignoreComment) 182 187 { 183 188 char *cleanToken = NULL; … … 213 218 // Returns single parsed value as a double precision number. The input string must be cleaned and null 214 219 // terminated. 215 static double parseValue(char *inString, psS32 *status) 220 static double parseValue(char *inString, 221 psS32 *status) 216 222 { 217 223 char *end = NULL; … … 229 235 230 236 /** Returns true or false. 'T', 't', '1', 'F', 'f', and '0' are acceptable, parsable variations. */ 231 static psBool parseBool(char *inString, psS32 *status) 237 static psBool parseBool(char *inString, 238 psS32 *status) 232 239 { 233 240 psBool value = false; … … 246 253 247 254 /** Returns parsed vector filled with with data. The input string must be null terminated. */ 248 static psVector* parseVector(char *inString, psElemType elemType, psS32 *status) 255 static psVector* parseVector(char *inString, 256 psElemType elemType, 257 psS32 *status) 249 258 { 250 259 char* end = NULL; … … 363 372 } 364 373 365 bool psMetadataItemPrint(FILE * fd, const char *format, const psMetadataItem* item) 374 bool psMetadataItemPrint(FILE * fd, 375 const char *format, 376 const psMetadataItem* item) 366 377 { 367 378 psMetadataType type; … … 453 464 454 465 455 psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, psS32 extNum, char *fileName) 466 psMetadata* psMetadataReadHeader(psMetadata* output, 467 char *extName, 468 psS32 extNum, 469 char *fileName) 456 470 { 457 471 psBool tempBool; … … 604 618 } 605 619 606 static psMetadata* setMetadataItem(psMetadata* template, char* linePtr) 620 static psMetadata* setMetadataItem(psMetadata* template, 621 char* linePtr) 607 622 { 608 623 psMetadata* md = NULL; … … 674 689 } 675 690 676 psBool parseMetadataItem(char* keyName, psS32* level, psArray* levelArray, 677 char* linePtr, psS32 lineCount, char* fileName, psMetadataFlags flags) 691 psBool parseMetadataItem(char* keyName, 692 psS32* level, 693 psArray* levelArray, 694 char* linePtr, 695 psS32 lineCount, 696 char* fileName, 697 psMetadataFlags flags) 678 698 { 679 699 psBool returnValue = true; … … 940 960 } 941 961 942 psBool parseLine(psS32* level, psArray* levelArray, char* linePtr, 943 psS32 lineCount, char* fileName, psBool overwrite) 962 psBool parseLine(psS32* level, 963 psArray* levelArray, 964 char* linePtr, 965 psS32 lineCount, 966 char* fileName, 967 psBool overwrite) 944 968 { 945 969 psBool returnValue = true; … … 1075 1099 } 1076 1100 1077 psMetadata* psMetadataConfigParse(psMetadata* md, unsigned int *nFail, const char *fileName, bool overwrite) 1101 psMetadata* psMetadataConfigParse(psMetadata* md, 1102 unsigned int *nFail, 1103 const char *filename, 1104 bool overwrite) 1078 1105 { 1079 1106 FILE* fp = NULL; … … 1086 1113 1087 1114 // Check for NULL file name 1088 PS_ASSERT_PTR_NON_NULL(file Name,NULL);1115 PS_ASSERT_PTR_NON_NULL(filename,NULL); 1089 1116 1090 1117 // Check for NULL nFail … … 1092 1119 1093 1120 // Attempt to open specified file 1094 if((fp=fopen(file Name, "r")) == NULL) {1095 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_OPEN_FAILED, file Name);1121 if((fp=fopen(filename, "r")) == NULL) { 1122 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_OPEN_FAILED, filename); 1096 1123 return NULL; 1097 1124 } … … 1122 1149 lineCount++; 1123 1150 1124 if(!parseLine(&nestingLevel,parseLevelInfoArray,linePtr,lineCount,(char*)file Name,overwrite)) {1151 if(!parseLine(&nestingLevel,parseLevelInfoArray,linePtr,lineCount,(char*)filename,overwrite)) { 1125 1152 (*nFail)++; 1126 1153 } -
trunk/psLib/src/types/psMetadataConfig.h
r4556 r4589 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-07- 15 02:33:54$12 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-21 01:40:10 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 82 82 psMetadata* md, ///< Resulting metadata from read. 83 83 unsigned int *nFail, ///< Number of failed lines. 84 const char *file Name, ///< Name of file to read.84 const char *filename, ///< Name of file to read. 85 85 bool overwrite ///< Allow overwrite of duplicate specifications. 86 86 ); -
trunk/psLib/test/math/tst_psMatrix04.c
r4547 r4589 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $16 * @date $Date: 2005-07- 13 02:47:00 $15 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-07-21 01:40:10 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 51 51 { 52 52 float det = 0.0f; 53 float *det2 = NULL;53 float det2 = 0; 54 54 psImage *outImage = NULL; 55 55 psImage *inImage = NULL; … … 120 120 printPositiveTestHeader(stdout, "psMatrix", "Calculate determinant only"); 121 121 det2 = psMatrixDeterminant(inImage); 122 CHECK_VALUE(*det2); 123 psFree(det2); 122 CHECK_VALUE(det2); 124 123 det2 = psMatrixDeterminant(inImage32); 125 CHECK_VALUE(*det2); 126 psFree(det2); 124 CHECK_VALUE(det2); 127 125 printFooter(stdout, "psMatrix", "Calculate determinant only", true); 128 126 -
trunk/psLib/test/types/verified/tst_psLookupTable_01.stderr
r4547 r4589 8 8 Following should generate error message for invalid file name 9 9 <DATE><TIME>|<HOST>|E|psLookupTableAlloc (FILE:LINENO) 10 Unallowable operation: file Name is NULL.10 Unallowable operation: filename is NULL. 11 11 <DATE><TIME>|<HOST>|I|testLookupTableAlloc 12 12 Following should generate error message for invalid format string -
trunk/psLib/test/types/verified/tst_psMetadataIO.stderr
r4547 r4589 65 65 Following should generate an error message for NULL file name arg 66 66 <DATE><TIME>|<HOST>|E|psMetadataConfigParse (FILE:LINENO) 67 Unallowable operation: file Name is NULL.67 Unallowable operation: filename is NULL. 68 68 69 69 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse} | tst_psMetadataIO.c)
Note:
See TracChangeset
for help on using the changeset viewer.
