Changeset 4493 for trunk/psLib/src/collections/psVector.c
- Timestamp:
- Jul 6, 2005, 4:17:54 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/psVector.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psVector.c
r4409 r4493 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 6-28 20:17:52$11 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-07 02:17:53 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 48 48 // FUNCTION IMPLEMENTATION - PUBLIC 49 49 50 psVector* psVectorAlloc( unsignedlong nalloc, psElemType type)50 psVector* psVectorAlloc( long nalloc, psElemType type) 51 51 { 52 52 psVector* psVec = NULL; … … 67 67 psVec->type.dimen = PS_DIMEN_VECTOR; 68 68 psVec->type.type = type; 69 *( int*)&psVec->nalloc = nalloc;69 *(long*)&psVec->nalloc = nalloc; 70 70 psVec->n = nalloc; 71 71 … … 76 76 } 77 77 78 psVector* psVectorRealloc(psVector* vector, unsignedlong nalloc)78 psVector* psVectorRealloc(psVector* vector, long nalloc) 79 79 { 80 80 psS32 elementSize = 0; … … 93 93 // Realloc after decrementation to avoid accessing freed array elements 94 94 vector->data.U8 = psRealloc(vector->data.U8, nalloc * elementSize); 95 *( int*)&vector->nalloc = nalloc;95 *(long*)&vector->nalloc = nalloc; 96 96 } 97 97 … … 99 99 } 100 100 101 psVector* psVectorRecycle(psVector* vector, unsignedlong nalloc, psElemType type)101 psVector* psVectorRecycle(psVector* vector, long nalloc, psElemType type) 102 102 { 103 103 psS32 byteSize; … … 120 120 if (byteSize > vector->nalloc*PSELEMTYPE_SIZEOF(vector->type.type)) { 121 121 vector->data.U8 = psRealloc(vector->data.U8, byteSize); 122 *( int*)&vector->nalloc = nalloc;122 *(long*)&vector->nalloc = nalloc; 123 123 } 124 124
Note:
See TracChangeset
for help on using the changeset viewer.
