IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4307 for trunk/psLib/src/types


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

* empty log message *

Location:
trunk/psLib/src/types
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/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;
  • trunk/psLib/src/types/psArray.h

    r4162 r4307  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-06-08 23:40:45 $
     14 *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-06-17 23:39:51 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9191 *
    9292 */
    93 psBool psArrayRemove(
    94     psArray* psArr,                    ///< array to operate on
    95     psPtr data                         ///< the data pointer to remove from psArray
     93bool psArrayRemove(
     94    psArray* array,                    ///< array to operate on
     95    const psPtr data                   ///< the data pointer to remove from psArray
    9696);
    9797
Note: See TracChangeset for help on using the changeset viewer.