IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 13, 2004, 1:36:27 PM (22 years ago)
Author:
desonia
Message:

moved the type stuff from psVector to psType.h, enhanced the PSELEMTYPE_SIZEOF macro to handle PS_TYPE_PTR, etc.

File:
1 edited

Legend:

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

    r670 r672  
    1919 *  @author Ross Harman, MHPCC
    2020 *   
    21  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2004-05-13 22:47:52 $
     21 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2004-05-13 23:36:27 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7575    }
    7676
    77     if (elemType == PS_TYPE_PTR) {
    78         elementSize = sizeof(void*);
    79     } else {
    80         elementSize = PSELEMTYPE_SIZEOF(elemType);
    81     }
     77    elementSize = PSELEMTYPE_SIZEOF(elemType);
    8278
    8379    // Create vector struct
     
    10298    // Invalid nalloc
    10399    if(nalloc < 1) {
    104         psError(__func__, " : Line %d - Invalid value for nalloc. nalloc: %d\n", __LINE__, nalloc);
     100        psError(__func__, "Invalid value for nalloc (%d)\n", nalloc);
    105101        return NULL;
    106102    }
    107103
    108     if (elemType == PS_TYPE_PTR) {
    109         elementSize = sizeof(void*);
    110     } else {
    111         elementSize = PSELEMTYPE_SIZEOF(elemType);
    112     }
     104    elementSize = PSELEMTYPE_SIZEOF(elemType);
    113105
    114106
     
    137129    }
    138130
    139     if (psVec->type.type == PS_TYPE_PTR) {
    140         psLogMsg(__func__,PS_LOG_WARN,"psVectorFree was called with a void* vector. "
    141                  "Referenced of pointers was not freed.");
    142         psVoidPtrVectorFree(psVec,NULL);
    143     } else {
    144         psFree(psVec->vec.v);
    145         psFree(psVec);
    146     }
     131    psFree(psVec->vec.v);
     132    psFree(psVec);
    147133}
    148134
Note: See TracChangeset for help on using the changeset viewer.