IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 20, 2005, 5:01:37 PM (21 years ago)
Author:
drobbin
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psVector.c

    r4212 r4330  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.42 $ $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 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    129129}
    130130
    131 psVector *psVectorExtend(psVector *vector, int delta, int nExtend)
     131psVector *psVectorExtend(psVector *vector, long delta, long nExtend)
    132132{
    133133    // can't handle a NULL vector (don't know the data type to allocate)
     
    166166}
    167167
    168 psVector* psVectorCopy(psVector* out, const psVector* in, psElemType type)
    169 {
    170     if (in == NULL) {
     168psVector* psVectorCopy(psVector* output, const psVector* input, psElemType type)
     169{
     170    if (input == NULL) {
    171171        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    172172                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);
    180180
    181181    #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; \
    184184        for (psS32 col=0;col<nElements;col++) { \
    185185            *(outVec++) = *(inVec++); \
     
    189189    #define PSVECTOR_COPY_CASE(OUTTYPE) \
    190190case PS_TYPE_##OUTTYPE: { \
    191         switch (in->type.type) { \
     191        switch (input->type.type) { \
    192192        case PS_TYPE_S8: \
    193193            PSVECTOR_COPY(S8,OUTTYPE); \
     
    232232                        PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, \
    233233                        typeStr); \
    234                 psFree(out); \
     234                psFree(output); \
    235235            } \
    236236        } \
     
    257257                    PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE,
    258258                    typeStr);
    259             psFree(out);
     259            psFree(output);
    260260
    261261            break;
    262262        }
    263263    }
    264     return out;
     264    return output;
    265265
    266266
Note: See TracChangeset for help on using the changeset viewer.