Changeset 1162
- Timestamp:
- Jun 30, 2004, 2:14:40 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 4 edited
-
collections/psBitSet.c (modified) (5 diffs)
-
collections/psScalar.c (modified) (3 diffs)
-
mathtypes/psScalar.c (modified) (3 diffs)
-
types/psBitSet.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psBitSet.c
r1073 r1162 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 6-23 23:00:15 $12 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-07-01 00:14:25 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psMemory.h" 28 28 #include "psError.h" 29 #include "psAbort.h" 29 30 30 31 /******************************************************************************/ … … 90 91 numBytes = ceil(n/8.0); 91 92 newObj = psAlloc(sizeof(psBitSet)); 93 if(newObj == NULL) { 94 psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__); 95 } 92 96 p_psMemSetDeallocator(newObj,(psFreeFcn)bitSetFree); 93 97 newObj->n = numBytes; … … 96 100 /*@i@*/ 97 101 newObj->bits = psAlloc(sizeof(char)*numBytes); 102 if(newObj->bits == NULL) { 103 psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__); 104 } 105 98 106 memset(newObj->bits, numBytes, 0); 99 107 … … 225 233 int numBits = inBitSet->n*8; 226 234 char* outString = psAlloc((size_t)numBits+1); 235 if(outString == NULL) { 236 psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__); 237 } 238 227 239 for(i=0; i<numBits; i++) { 228 240 outString[numBits-i-1] = (psBitSetTest(inBitSet, i) == 1)?'1':'0'; -
trunk/psLib/src/collections/psScalar.c
r1063 r1162 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-0 6-19 01:59:51$10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-07-01 00:14:40 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 #include "psScalar.h" 22 22 #include "psLogMsg.h" 23 #include "psAbort.h" 23 24 24 25 /******************************************************************************/ … … 61 62 // Create scalar 62 63 scalar = (psScalar *)psAlloc(sizeof(psScalar)); 64 if(scalar == NULL) { 65 psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__); 66 } 67 63 68 scalar->type.dimen = PS_DIMEN_SCALAR; 64 69 scalar->type.type = dataType; -
trunk/psLib/src/mathtypes/psScalar.c
r1063 r1162 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-0 6-19 01:59:51$10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-07-01 00:14:40 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 #include "psScalar.h" 22 22 #include "psLogMsg.h" 23 #include "psAbort.h" 23 24 24 25 /******************************************************************************/ … … 61 62 // Create scalar 62 63 scalar = (psScalar *)psAlloc(sizeof(psScalar)); 64 if(scalar == NULL) { 65 psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__); 66 } 67 63 68 scalar->type.dimen = PS_DIMEN_SCALAR; 64 69 scalar->type.type = dataType; -
trunk/psLib/src/types/psBitSet.c
r1073 r1162 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 6-23 23:00:15 $12 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-07-01 00:14:25 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psMemory.h" 28 28 #include "psError.h" 29 #include "psAbort.h" 29 30 30 31 /******************************************************************************/ … … 90 91 numBytes = ceil(n/8.0); 91 92 newObj = psAlloc(sizeof(psBitSet)); 93 if(newObj == NULL) { 94 psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__); 95 } 92 96 p_psMemSetDeallocator(newObj,(psFreeFcn)bitSetFree); 93 97 newObj->n = numBytes; … … 96 100 /*@i@*/ 97 101 newObj->bits = psAlloc(sizeof(char)*numBytes); 102 if(newObj->bits == NULL) { 103 psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__); 104 } 105 98 106 memset(newObj->bits, numBytes, 0); 99 107 … … 225 233 int numBits = inBitSet->n*8; 226 234 char* outString = psAlloc((size_t)numBits+1); 235 if(outString == NULL) { 236 psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__); 237 } 238 227 239 for(i=0; i<numBits; i++) { 228 240 outString[numBits-i-1] = (psBitSetTest(inBitSet, i) == 1)?'1':'0';
Note:
See TracChangeset
for help on using the changeset viewer.
