IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8798


Ignore:
Timestamp:
Sep 12, 2006, 11:04:11 AM (20 years ago)
Author:
jhoblitt
Message:

change psArrayElementsFree() to use a long as the index type instead of psS32 so it will actually work as expected on large arrays and to set psArray->n to zero

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

Legend:

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

    r8627 r8798  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-08-26 04:34:28 $
     11 *  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-09-12 21:04:11 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    165165    }
    166166
    167     for (psS32 i = 0; i < psArr->n; i++) {
     167    for (long i = 0; i < psArr->n; i++) {
    168168        psFree(psArr->data[i]);
    169169        psArr->data[i] = NULL;
    170170    }
     171
     172    psArray->n = 0;
    171173}
    172174
  • trunk/psLib/src/types/psArray.h

    r7816 r8798  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2006-07-05 22:34:38 $
     13 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2006-09-12 21:04:11 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    114114 * Uses psLib memory allocation functions to deallocate/dereference elements
    115115 * of a array of void pointers.  The array psArr is not freed, and its elements
    116  * will all be set to NULL.
     116 * will all be set to NULL.  Additionaly, the array size (n) is set to zero.
    117117 *
    118118 */
Note: See TracChangeset for help on using the changeset viewer.