IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 17, 2005, 1:39:51 PM (21 years ago)
Author:
drobbin
Message:

* empty log message *

File:
1 edited

Legend:

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

    r3682 r4307  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-04-07 20:27:41 $
     11 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-06-17 23:39:51 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    109109}
    110110
    111 psBool psArrayRemove(psArray* psArr,
    112                      psPtr data)
    113 {
    114     psBool success = false;
    115 
    116     if (psArr == NULL) {
     111bool psArrayRemove(psArray* array,
     112                   const psPtr data)
     113{
     114    bool success = false;
     115
     116    if (array == NULL) {
    117117        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    118118                PS_ERRORTEXT_psArray_ARRAY_NULL);
     
    120120    }
    121121
    122     psS32 n = psArr->n;
    123     psPtr* psArrData = psArr->data;
     122    psS32 n = array->n;
     123    psPtr* psArrData = array->data;
    124124    for (psS32 i = n-1; i >= 0; i--) {
    125125        if (psArrData[i] == data) {
    126             memmove(&psArr->data[i],&psArr->data[i+1],(n-i-1)*sizeof(psPtr));
     126            memmove(&array->data[i],&array->data[i+1],(n-i-1)*sizeof(psPtr));
    127127            n--;
    128128            success = true;
    129129        }
    130130    }
    131     psArr->n = n; // reset the array size to indicate the removed item(s)
     131    array->n = n; // reset the array size to indicate the removed item(s)
    132132
    133133    return success;
Note: See TracChangeset for help on using the changeset viewer.