Changeset 1841
- Timestamp:
- Sep 21, 2004, 1:15:04 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 8 edited
-
collections/psCollectionsErrors.dat (modified) (1 diff)
-
collections/psCollectionsErrors.h (modified) (2 diffs)
-
collections/psHash.c (modified) (7 diffs)
-
image/psImage.c (modified) (3 diffs)
-
image/psImageStats.c (modified) (2 diffs)
-
imageops/psImageStats.c (modified) (2 diffs)
-
mathtypes/psImage.c (modified) (3 diffs)
-
types/psHash.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psCollectionsErrors.dat
r1807 r1841 25 25 psScalar_UNSUPPORTED_TYPE Specified datatype (%d) is unsupported by psScalar. 26 26 psScalar_COPY_NULL Can not copy a NULL psScalar. 27 # 28 psHash_KEY_NULL Input key can not be NULL. 29 psHash_TABLE_NULL Input psHash can not be NULL. 30 psHash_DATA_NULL Input data can not be NULL. 31 -
trunk/psLib/src/collections/psCollectionsErrors.h
r1807 r1841 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09- 14 20:01:52$9 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-21 23:15:04 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 45 45 #define PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE "Specified datatype (%d) is unsupported by psScalar." 46 46 #define PS_ERRORTEXT_psScalar_COPY_NULL "Can not copy a NULL psScalar." 47 #define PS_ERRORTEXT_psHash_KEY_NULL "Input key can not be NULL." 48 #define PS_ERRORTEXT_psHash_TABLE_NULL "Input psHash can not be NULL." 49 #define PS_ERRORTEXT_psHash_DATA_NULL "Input data can not be NULL." 47 50 //~End 48 51 -
trunk/psLib/src/collections/psHash.c
r1747 r1841 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-09- 09 02:23:27$13 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-21 23:15:04 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psString.h" 25 25 #include "psTrace.h" 26 #include "psError.h" 26 27 #include "psAbort.h" 28 29 #include "psCollectionsErrors.h" 27 30 28 31 static psHashBucket* hashBucketAlloc(const char *key, void *data, psHashBucket* next); … … 83 86 static psHashBucket* hashBucketAlloc(const char *key, void *data, psHashBucket* next) 84 87 { 85 if (key == NULL) {86 psAbort(__func__, "psHashBucket() called with NULL key.");87 }88 88 // Allocate memory for the new hash bucket. 89 89 psHashBucket* bucket = psAlloc(sizeof(psHashBucket)); … … 226 226 // the way this procedure is called. 227 227 if ((table == NULL) || (key == NULL)) { 228 229 psAbort(__func__, "psHashRemove() called with NULL key or table."); 228 psErrorMsg(PS_ERRORNAME_DOMAIN "doHashWork", 229 PS_ERR_BAD_PARAMETER_NULL, true, 230 PS_ERRORTEXT_psHash_KEY_NULL); 231 return NULL; 230 232 } 231 233 // NOTE: This is the originally supplied hash function. … … 341 343 { 342 344 if (table == NULL) { 343 psAbort(__func__, "psHashInsert() called with NULL hash table."); 345 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashAdd", 346 PS_ERR_BAD_PARAMETER_NULL, true, 347 PS_ERRORTEXT_psHash_KEY_NULL); 348 return false; 344 349 } 345 350 if (key == NULL) { 346 psAbort(__func__, "psHashInsert() called with NULL key."); 351 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashAdd", 352 PS_ERR_BAD_PARAMETER_NULL, true, 353 PS_ERRORTEXT_psHash_TABLE_NULL); 354 return false; 347 355 } 348 356 if (data == NULL) { 349 psAbort(__func__, "psHashLookup() called with NULL data."); 357 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashAdd", 358 PS_ERR_BAD_PARAMETER_NULL, true, 359 PS_ERRORTEXT_psHash_DATA_NULL); 350 360 } 351 361 … … 368 378 { 369 379 if (table == NULL) { 370 psAbort(__func__, "psHashLookup() called with NULL hash table."); 380 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashLookup", 381 PS_ERR_BAD_PARAMETER_NULL, true, 382 PS_ERRORTEXT_psHash_KEY_NULL); 383 return NULL; 371 384 } 372 385 if (key == NULL) { 373 psAbort(__func__, "psHashLookup() called with NULL key."); 386 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashLookup", 387 PS_ERR_BAD_PARAMETER_NULL, true, 388 PS_ERRORTEXT_psHash_TABLE_NULL); 389 return NULL; 374 390 } 375 391 … … 393 409 394 410 if (table == NULL) { 395 psAbort(__func__, "psHashRemove() called with NULL hash table."); 411 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashRemove", 412 PS_ERR_BAD_PARAMETER_NULL, true, 413 PS_ERRORTEXT_psHash_TABLE_NULL); 414 return false; 396 415 } 397 416 if (key == NULL) { 398 psAbort(__func__, "psHashRemove() called with NULL key."); 417 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashRemove", 418 PS_ERR_BAD_PARAMETER_NULL, true, 419 PS_ERRORTEXT_psHash_KEY_NULL); 420 return false; 399 421 } 400 422 -
trunk/psLib/src/image/psImage.c
r1840 r1841 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.4 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09-21 2 2:30:19$12 * @version $Revision: 1.45 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 23:15:04 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 23 23 #include "psMemory.h" 24 #include "psAbort.h"25 24 #include "psError.h" 26 25 #include "psImage.h" … … 50 49 psImage* image = (psImage* ) psAlloc(sizeof(psImage)); 51 50 52 if (image == NULL) {53 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);54 }55 56 51 p_psMemSetDeallocator(image, (psFreeFcn) imageFree); 57 52 58 53 image->data.V = psAlloc(sizeof(void *) * numRows); 59 if (image->data.V == NULL) {60 psFree(image);61 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);62 }63 54 64 55 image->rawDataBuffer = psAlloc(area * elementSize); 65 if (image->rawDataBuffer == NULL) {66 psFree(image);67 psFree(image->data.V);68 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);69 }70 56 71 57 // set the row pointers. -
trunk/psLib/src/image/psImageStats.c
r1840 r1841 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09-21 2 2:30:19$12 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 23:15:04 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "psTrace.h" 27 27 #include "psError.h" 28 #include "psAbort.h"29 28 #include "psStats.h" 30 29 #include "psImage.h" -
trunk/psLib/src/imageops/psImageStats.c
r1840 r1841 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09-21 2 2:30:19$12 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 23:15:04 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "psTrace.h" 27 27 #include "psError.h" 28 #include "psAbort.h"29 28 #include "psStats.h" 30 29 #include "psImage.h" -
trunk/psLib/src/mathtypes/psImage.c
r1840 r1841 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.4 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09-21 2 2:30:19$12 * @version $Revision: 1.45 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-21 23:15:04 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 23 23 #include "psMemory.h" 24 #include "psAbort.h"25 24 #include "psError.h" 26 25 #include "psImage.h" … … 50 49 psImage* image = (psImage* ) psAlloc(sizeof(psImage)); 51 50 52 if (image == NULL) {53 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);54 }55 56 51 p_psMemSetDeallocator(image, (psFreeFcn) imageFree); 57 52 58 53 image->data.V = psAlloc(sizeof(void *) * numRows); 59 if (image->data.V == NULL) {60 psFree(image);61 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);62 }63 54 64 55 image->rawDataBuffer = psAlloc(area * elementSize); 65 if (image->rawDataBuffer == NULL) {66 psFree(image);67 psFree(image->data.V);68 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);69 }70 56 71 57 // set the row pointers. -
trunk/psLib/src/types/psHash.c
r1747 r1841 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-09- 09 02:23:27$13 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-21 23:15:04 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psString.h" 25 25 #include "psTrace.h" 26 #include "psError.h" 26 27 #include "psAbort.h" 28 29 #include "psCollectionsErrors.h" 27 30 28 31 static psHashBucket* hashBucketAlloc(const char *key, void *data, psHashBucket* next); … … 83 86 static psHashBucket* hashBucketAlloc(const char *key, void *data, psHashBucket* next) 84 87 { 85 if (key == NULL) {86 psAbort(__func__, "psHashBucket() called with NULL key.");87 }88 88 // Allocate memory for the new hash bucket. 89 89 psHashBucket* bucket = psAlloc(sizeof(psHashBucket)); … … 226 226 // the way this procedure is called. 227 227 if ((table == NULL) || (key == NULL)) { 228 229 psAbort(__func__, "psHashRemove() called with NULL key or table."); 228 psErrorMsg(PS_ERRORNAME_DOMAIN "doHashWork", 229 PS_ERR_BAD_PARAMETER_NULL, true, 230 PS_ERRORTEXT_psHash_KEY_NULL); 231 return NULL; 230 232 } 231 233 // NOTE: This is the originally supplied hash function. … … 341 343 { 342 344 if (table == NULL) { 343 psAbort(__func__, "psHashInsert() called with NULL hash table."); 345 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashAdd", 346 PS_ERR_BAD_PARAMETER_NULL, true, 347 PS_ERRORTEXT_psHash_KEY_NULL); 348 return false; 344 349 } 345 350 if (key == NULL) { 346 psAbort(__func__, "psHashInsert() called with NULL key."); 351 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashAdd", 352 PS_ERR_BAD_PARAMETER_NULL, true, 353 PS_ERRORTEXT_psHash_TABLE_NULL); 354 return false; 347 355 } 348 356 if (data == NULL) { 349 psAbort(__func__, "psHashLookup() called with NULL data."); 357 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashAdd", 358 PS_ERR_BAD_PARAMETER_NULL, true, 359 PS_ERRORTEXT_psHash_DATA_NULL); 350 360 } 351 361 … … 368 378 { 369 379 if (table == NULL) { 370 psAbort(__func__, "psHashLookup() called with NULL hash table."); 380 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashLookup", 381 PS_ERR_BAD_PARAMETER_NULL, true, 382 PS_ERRORTEXT_psHash_KEY_NULL); 383 return NULL; 371 384 } 372 385 if (key == NULL) { 373 psAbort(__func__, "psHashLookup() called with NULL key."); 386 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashLookup", 387 PS_ERR_BAD_PARAMETER_NULL, true, 388 PS_ERRORTEXT_psHash_TABLE_NULL); 389 return NULL; 374 390 } 375 391 … … 393 409 394 410 if (table == NULL) { 395 psAbort(__func__, "psHashRemove() called with NULL hash table."); 411 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashRemove", 412 PS_ERR_BAD_PARAMETER_NULL, true, 413 PS_ERRORTEXT_psHash_TABLE_NULL); 414 return false; 396 415 } 397 416 if (key == NULL) { 398 psAbort(__func__, "psHashRemove() called with NULL key."); 417 psErrorMsg(PS_ERRORNAME_DOMAIN "psHashRemove", 418 PS_ERR_BAD_PARAMETER_NULL, true, 419 PS_ERRORTEXT_psHash_KEY_NULL); 420 return false; 399 421 } 400 422
Note:
See TracChangeset
for help on using the changeset viewer.
