IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 2:57:34 PM (22 years ago)
Author:
desonia
Message:

converted native C types to ps Types, where practical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/collections/tst_psArray.c

    r1920 r2204  
    1212 *  @author  Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
    15  *  @date  $Date: 2004-09-28 23:26:49 $
     14 *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
     15 *  @date  $Date: 2004-10-27 00:57:33 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626typedef struct
    2727{
    28     int x;
     28    psS32 x;
    2929    float y;
    3030}
     
    3232
    3333
    34 int main(int argc,
    35          char* argv[])
     34psS32 main(psS32 argc,
     35           char* argv[])
    3636{
    3737    // Create array of pointers
     
    5151    // Test B - Add data to void pointer array
    5252    printPositiveTestHeader(stdout, "psArray", "Add data to void pointer array");
    53     for(int i = 0; i < 5; i++) {
     53    for(psS32 i = 0; i < 5; i++) {
    5454        testStruct *ts = psAlloc(sizeof(testStruct));
    5555        ts->x = 10*i;
     
    6060    }
    6161
    62     for(int i = 0; i < 5; i++) {
     62    for(psS32 i = 0; i < 5; i++) {
    6363        testStruct *ts = (testStruct*)psArr->data[i];
    6464        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
     
    8585    psArr = psArrayRealloc(psArr,10);
    8686    printf("Adding more elements to void pointer array...\n");
    87     for(int i = 5; i < 10; i++) {
     87    for(psS32 i = 5; i < 10; i++) {
    8888        testStruct *ts = psAlloc(sizeof(testStruct));
    8989        ts->x = 10*i;
     
    9494        psMemIncrRefCounter(ts);
    9595    }
    96     for(int i = 0; i < 10; i++) {
     96    for(psS32 i = 0; i < 10; i++) {
    9797        testStruct *ts = (testStruct*)psArr->data[i];
    9898        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
     
    118118    printPositiveTestHeader(stdout,"psArray","Reallocate void pointer array smaller");
    119119    psArr = psArrayRealloc(psArr,3);
    120     for(int i = 0; i < 3; i++) {
     120    for(psS32 i = 0; i < 3; i++) {
    121121        testStruct *ts = (testStruct*)psArr->data[i];
    122122        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
     
    142142    printPositiveTestHeader(stdout, "psArray", "Free void pointer array");
    143143    psFree(psArr);
    144     for(int i = 0; i < 10; i++) {
     144    for(psS32 i = 0; i < 10; i++) {
    145145        psFree(mySt[i]);
    146146    }
    147147    psMemCheckLeaks(0, NULL, stdout);
    148     int nBad = psMemCheckCorruption(0);
     148    psS32 nBad = psMemCheckCorruption(0);
    149149    if(nBad) {
    150150        printf("ERROR: Found %d bad memory blocks\n", nBad);
Note: See TracChangeset for help on using the changeset viewer.