IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2006, 12:55:05 PM (20 years ago)
Author:
Paul Price
Message:

Following today's meeting, we agreed that psVectorAlloc (and therefore
psArrayAlloc also) shall set the number of elements in use to equal the
number of elements allocated. We introduce new functions,
psVectorAllocEmpty and psArrayAllocEmpty, that allocate a vector and set
the length to zero.

File:
1 edited

Legend:

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

    r8627 r9730  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-08-26 04:34:28 $
     9 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-10-24 22:52:55 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    237237        result->data[row] = psAlloc((width+1)*sizeof(char));
    238238    }
    239     result->n = numRows;
    240239
    241240    fits_read_col_str(fits->fd,
     
    319318
    320319    psVector* result = psVectorAlloc(numRows, p_psFitsTypeFromCfitsio(typecode));
    321     result->n = numRows;
    322320
    323321    fits_read_col(fits->fd,
     
    389387        psTrace("psLib.fits",5,"Reading row %i of %li\n",row, numRows);
    390388        table->data[row] = psFitsReadTableRow(fits,row);
    391         table->n++;
    392389    }
    393390
     
    564561    psArray *columnNames = psArrayAlloc(numColumns); // Array of column names, for cfitsio
    565562    psArray *columnTypes = psArrayAlloc(numColumns); // Array of column types, for cfitsio
    566     columnNames->n = numColumns;
    567     columnTypes->n = numColumns;
    568563    psMetadataIterator *colSpecsIter = psMetadataIteratorAlloc(colSpecs, PS_LIST_HEAD, NULL); // Iterator
    569564    psMetadataItem *colSpecItem;        // Column specification item, from iteration
     
    644639            size_t dataSize = PSELEMTYPE_SIZEOF(spec->type); // Size (in bytes) of this type
    645640            psVector *columnData = psVectorAlloc(table->n, spec->type); // The raw row data, to be written
    646             columnData->n = table->n;
    647641            psVectorInit(columnData, 0);
    648642            for (long i = 0; i < table->n; i++) {
     
    667661            case PS_DATA_STRING: {
    668662                    psArray *strings = psArrayAlloc(table->n); // Array of strings
    669                     strings->n = table->n;
    670663                    for (long i = 0; i < table->n; i++) {
    671664                        psMetadata *row = table->data[i]; // The row of interest
Note: See TracChangeset for help on using the changeset viewer.