Changeset 4330 for trunk/psLib/src/collections/psVector.c
- Timestamp:
- Jun 20, 2005, 5:01:37 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/psVector.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psVector.c
r4212 r4330 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-06- 10 21:46:46$11 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-06-21 03:01:37 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 129 129 } 130 130 131 psVector *psVectorExtend(psVector *vector, int delta, intnExtend)131 psVector *psVectorExtend(psVector *vector, long delta, long nExtend) 132 132 { 133 133 // can't handle a NULL vector (don't know the data type to allocate) … … 166 166 } 167 167 168 psVector* psVectorCopy(psVector* out , const psVector* in, psElemType type)169 { 170 if (in == NULL) {168 psVector* psVectorCopy(psVector* output, const psVector* input, psElemType type) 169 { 170 if (input == NULL) { 171 171 psError(PS_ERR_BAD_PARAMETER_NULL, true, 172 172 PS_ERRORTEXT_psVector_SORT_NULL); 173 psFree(out );174 return NULL; 175 } 176 177 psS32 nElements = in ->n;178 179 out = psVectorRecycle(out, nElements, type);173 psFree(output); 174 return NULL; 175 } 176 177 psS32 nElements = input->n; 178 179 output = psVectorRecycle(output, nElements, type); 180 180 181 181 #define PSVECTOR_COPY(INTYPE,OUTTYPE) { \ 182 ps##INTYPE *inVec = in ->data.INTYPE; \183 ps##OUTTYPE *outVec = out ->data.OUTTYPE; \182 ps##INTYPE *inVec = input->data.INTYPE; \ 183 ps##OUTTYPE *outVec = output->data.OUTTYPE; \ 184 184 for (psS32 col=0;col<nElements;col++) { \ 185 185 *(outVec++) = *(inVec++); \ … … 189 189 #define PSVECTOR_COPY_CASE(OUTTYPE) \ 190 190 case PS_TYPE_##OUTTYPE: { \ 191 switch (in ->type.type) { \191 switch (input->type.type) { \ 192 192 case PS_TYPE_S8: \ 193 193 PSVECTOR_COPY(S8,OUTTYPE); \ … … 232 232 PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, \ 233 233 typeStr); \ 234 psFree(out ); \234 psFree(output); \ 235 235 } \ 236 236 } \ … … 257 257 PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, 258 258 typeStr); 259 psFree(out );259 psFree(output); 260 260 261 261 break; 262 262 } 263 263 } 264 return out ;264 return output; 265 265 266 266
Note:
See TracChangeset
for help on using the changeset viewer.
