IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2006, 12:55:05 PM (20 years ago)
Author:
Paul Price
Message:

Following today's meeting, we agreed that psVectorAlloc (and therefore
psArrayAlloc also) shall set the number of elements in use to equal the
number of elements allocated. We introduce new functions,
psVectorAllocEmpty and psArrayAllocEmpty, that allocate a vector and set
the length to zero.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmPeaks.c

    r8815 r9730  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-09-15 09:49:01 $
     8 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-10-24 22:55:05 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4040
    4141    if (list == NULL) {
    42         list = psArrayAlloc(100);
    43         list->n = 0;
     42        list = psArrayAllocEmpty(100);
    4443    }
    4544    psArrayAdd(list, 100, tmpPeak);
     
    6968        tmpVector->data.F32[col] = image->data.F32[row][col];
    7069    }
    71     tmpVector->n = image->numCols;
    7270    psTrace("psModules.objects", 4, "---- %s() end ----\n", __func__);
    7371    return(tmpVector);
     
    194192    if (n == 1) {
    195193        psVector *tmpVector = NULL;
    196         ;
    197194        if (vector->data.F32[0] > threshold) {
    198195            tmpVector = psVectorAlloc(1, PS_TYPE_U32);
    199196            tmpVector->data.U32[0] = 0;
    200             tmpVector->n = 1;
    201197        } else {
    202198            tmpVector = psVectorAlloc(0, PS_TYPE_U32);
     
    238234    //
    239235    psVector *tmpVector = psVectorAlloc(count, PS_TYPE_U32);
    240     tmpVector->n = count;
    241236    count = 0;
    242237
     
    544539    PS_ASSERT_PTR_NON_NULL(peaks, NULL);
    545540
    546     psArray *output = psArrayAlloc (200);
    547     output->n = 0;
     541    psArray *output = psArrayAllocEmpty (200);
    548542
    549543    psTrace (".pmObjects.pmCullPeaks", 3, "list size is %ld\n", peaks->n);
Note: See TracChangeset for help on using the changeset viewer.