IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 21, 2005, 4:05:41 PM (21 years ago)
Author:
drobbin
Message:

* empty log message *

File:
1 edited

Legend:

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

    r4312 r4342  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-18 00:53:32 $
     11 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-06-22 02:05:41 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4949  FUNCTION IMPLEMENTATION - PUBLIC
    5050 *****************************************************************************/
    51 psArray* psArrayAlloc(psU32 nalloc)
     51psArray* psArrayAlloc(unsigned long nalloc)
    5252{
    5353    psArray* psArr = NULL;
     
    6666}
    6767
    68 psArray* psArrayRealloc(psArray* in, psU32 nalloc)
     68psArray* psArrayRealloc(psArray* in, unsigned long nalloc)
    6969{
    7070    if (in == NULL) {
     
    159159
    160160/// Set an element in the array.
    161 psBool psArraySet(psArray* in,                       ///< input array to set element in
    162                   psU32 position,                    ///< the element position to set
    163                   void* value)                       ///< the value to set it to
    164 {
    165     if (in == NULL)
     161bool psArraySet(psArray* array,                      ///< input array to set element in
     162                unsigned long position,            ///< the element position to set
     163                psPtr data)                        ///< the value to set it to
     164{
     165    if (array == NULL)
    166166    {
    167167        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     
    170170    }
    171171
    172     if (position >= in->nalloc)
     172    if (position >= array->nalloc)
    173173    {
    174174        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    175175                PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC,
    176                 position, in->nalloc);
     176                position, array->nalloc);
    177177        return false;
    178178    }
    179179
    180     psFree(in->data[position]);
    181     in->data[position] = value;
     180    psFree(array->data[position]);
     181    array->data[position] = data;
    182182
    183183    return true;
     
    185185
    186186/// Get an element in the array.
    187 void* psArrayGet(psArray* in, psU32 position )
    188 {
    189     if (in == NULL) {
     187psPtr psArrayGet(const psArray* array, unsigned long position )
     188{
     189    if (array == NULL) {
    190190        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    191191                PS_ERRORTEXT_psArray_ARRAY_NULL);
     
    193193    }
    194194
    195     if (position >= in->nalloc) {
     195    if (position >= array->nalloc) {
    196196        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    197197                PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC,
    198                 position, in->nalloc);
    199         return NULL;
    200     }
    201 
    202     return in->data[position];
    203 }
    204 
    205 
    206 
    207 
     198                position, array->nalloc);
     199        return NULL;
     200    }
     201
     202    return array->data[position];
     203}
     204
     205
     206
     207
Note: See TracChangeset for help on using the changeset viewer.