IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 16, 2006, 5:24:47 PM (20 years ago)
Author:
drobbin
Message:

Changed psArrayAlloc to set ->n = 0. Updated corresponding functions & tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fits/psFitsTable.c

    r6354 r6445  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-02-08 01:03:34 $
     9 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-02-17 03:24:46 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    595595        psTrace(".psFits.psFitsReadTable",5,"Reading row %i of %i\n",row, numRows);
    596596        table->data[row] = psFitsReadTableRow(fits,row);
     597        table->n++;
    597598    }
    598599
     
    658659                        psMemDecrRefCounter(fItem);
    659660                        columns->data[n] = psMemIncrRefCounter(item);
     661                        columns->n++;
    660662
    661663                    } else if (item->type == PS_DATA_VECTOR &&
     
    663665                        psMemDecrRefCounter(fItem);
    664666                        columns->data[n] = psMemIncrRefCounter(item);
     667                        columns->n++;
    665668                    }
    666669                } else {
     
    686689
    687690    //create list of column names and types.
     691    columns->n--;
    688692    psArray* columnNames = psArrayAlloc(columns->n);
    689693    psArray* columnTypes = psArrayAlloc(columns->n);
    690694    for (int n=0; n < columns->n; n++) {
    691695        columnNames->data[n] = psMemIncrRefCounter(((psMetadataItem*)columns->data[n])->name);
     696        columnNames->n++;
     697        columnTypes->n++;
    692698        if ( ! getMetadataTForm((psMetadataItem*)columns->data[n],
    693699                                (char**)&(columnTypes->data[n]),1) ) {
     
    754760                                                   table->data[row],
    755761                                                   item->name));
     762                colArray->n++;
    756763            }
    757764            fits_write_col_str(fits->fd,
Note: See TracChangeset for help on using the changeset viewer.