Changeset 6484 for trunk/psLib/src/types
- Timestamp:
- Feb 24, 2006, 1:43:16 PM (20 years ago)
- Location:
- trunk/psLib/src/types
- Files:
-
- 3 edited
-
psArray.c (modified) (3 diffs)
-
psLookupTable.c (modified) (3 diffs)
-
psMetadataConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psArray.c
r6445 r6484 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-02- 17 03:24:46$11 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-02-24 23:43:15 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 64 64 65 65 P_PSARRAY_SET_NALLOC(psArr,nalloc); 66 psArr->n = 0; 67 // psArr->n = nalloc; 66 psArr->n = 0; //set the initial number of elements in use to 0 68 67 // Create vector data array 69 68 psArr->data = psAlloc(nalloc * sizeof(psPtr)); 69 memset(psArr->data, 0, sizeof(void*) * nalloc); //set the initial values of data to NULL 70 70 71 71 return psArr; … … 86 86 } 87 87 // Realloc after decrementation to avoid accessing freed array elements 88 long n = in->n; 88 89 in->data = psRealloc(in->data, nalloc * sizeof(psPtr)); 89 90 P_PSARRAY_SET_NALLOC(in,nalloc); 91 for (long m = n; m < nalloc; m++) { //if array is grown, set grown data to NULL 92 in->data[m] = NULL; 93 } 90 94 } 91 95 -
trunk/psLib/src/types/psLookupTable.c
r6445 r6484 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-02- 17 03:24:46$9 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-02-24 23:43:15 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 600 600 // Check if array is sorted on the index column 601 601 psVector* sortedIndex = psVectorAlloc(numRows,PS_TYPE_U32); 602 sortedIndex->n = numRows; 602 603 sortedIndex = psVectorSortIndex(sortedIndex,indexColumnVector); 603 604 for(psS32 i = 0; i < numRows; i++ ) { … … 615 616 psS32 type = ((psVector*)(vectors->data[j]))->type.type; 616 617 newValueArray->data[j] = psVectorAlloc(numRows,type); 618 ((psVector*)(newValueArray->data[j]))->n = numRows; 617 619 newValueArray->n++; 618 620 } -
trunk/psLib/src/types/psMetadataConfig.c
r6191 r6484 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-0 1-25 22:33:41$12 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-02-24 23:43:15 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 363 363 elemType); 364 364 } 365 365 vec->n++; 366 366 while(*end==' ' || *end==',') { 367 367 end++;
Note:
See TracChangeset
for help on using the changeset viewer.
