Changeset 1162 for trunk/psLib/src/collections/psBitSet.c
- Timestamp:
- Jun 30, 2004, 2:14:40 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/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';
Note:
See TracChangeset
for help on using the changeset viewer.
