IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 25, 2006, 6:34:28 PM (20 years ago)
Author:
jhoblitt
Message:

add gcc format attributes to:

psAbort()
psErrorStackPrint()
p_psError()
p_psWarning()
psLogMsg()
p_psTrace()

add PS_ASSERT_LONG_LARGER_THAN_OR_EQUAL
add PS_ASSERT_S64_WITHIN_RANGE
fix PS_ASSERT_LONG_WITHIN_RANGE
fix a wide range of format related issues:

  • missing format field specifiers
  • missing format args
  • incorrect format field specifiers
  • constants declared with the wrong type (float vs. int)
  • PS_ASSERT* for the wrong type
  • attemps to print structs with *printf()
  • unportable format specifiers, eg. long vs. long long
File:
1 edited

Legend:

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

    r8623 r8627  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-08-26 03:11:59 $
     9 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-08-26 04:34:28 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7474    }
    7575
    76     psTrace("psLib.fits",5,"Table size is %ix%i\n",numCols, numRows);
     76    psTrace("psLib.fits",5,"Table size is %ix%li\n",numCols, numRows);
    7777    // the row parameter in the proper range?
    7878    if (row < 0 || row >= numRows) {
    7979        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    80                 _("Specified row, %d, is not valid for current table of %d rows."),
    81                 row,numRows);
     80                _("Specified row, %d, is not valid for current table of %ld rows."),
     81                row, numRows);
    8282        return NULL;
    8383    }
     
    110110                    fits_read_col(fits->fd, FITSTYPE, col,row+1, \
    111111                                  1, 1, NULL, &value, &anynul, &status); \
    112                     psTrace("psLib.fits",5,"Column #%i, '%s', is type %i, repeat %i, Value = %g\n", \
     112                    psTrace("psLib.fits",5,"Column #%i, '%s', is type %i, repeat %li, Value = %g\n", \
    113113                            col, name, typecode, repeat, (double)value); \
    114114                    psMetadataAdd(data,PS_LIST_TAIL, name, \
     
    144144                    fits_read_col(fits->fd, TSTRING, col,row+1,
    145145                                  1, 1, NULL, &value, &anynul, &status);
    146                     psTrace("psLib.fits",5,"Column #%i, '%s', is type %i, repeat %i, value = %s\n",
     146                    psTrace("psLib.fits",5,"Column #%i, '%s', is type %i, repeat %li, value = %s\n",
    147147                            col, name, typecode, repeat, value);
    148148                    if (anynul == 0) {
     
    387387
    388388    for (int row = 0; row < numRows; row++) {
    389         psTrace("psLib.fits",5,"Reading row %i of %i\n",row, numRows);
     389        psTrace("psLib.fits",5,"Reading row %i of %li\n",row, numRows);
    390390        table->data[row] = psFitsReadTableRow(fits,row);
    391391        table->n++;
     
    507507                // unsupported type -- treating as an error
    508508                psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    509                         "Unsupported data type (%d) for Metadata Item '%s' in row %d.",
    510                         colItem->type, colItem->name, row);
     509                        "Unsupported data type (%d) for Metadata Item '%s' in row %ld.",
     510                        colItem->type, colItem->name, i);
    511511                psFree(rowIter);
    512512                psFree(colSpecs);
     
    620620        char fitsErr[MAX_STRING_LENGTH];
    621621        fits_get_errstatus(status, fitsErr);
    622         psError(PS_ERR_LOCATION_INVALID, true, "Unable to create FITS table with %d columns and %d rows:",
     622        psError(PS_ERR_LOCATION_INVALID, true, "Unable to create FITS table with %ld columns and %ld rows: %s",
    623623                numColumns, table->n, fitsErr);
    624624        psFree(colSpecsIter);
     
    709709            char fitsErr[MAX_STRING_LENGTH];
    710710            fits_get_errstatus(status, fitsErr);
    711             psError(PS_ERR_LOCATION_INVALID, true, "Unable to write column %d of FITS table:",
     711            psError(PS_ERR_LOCATION_INVALID, true, "Unable to write column %ld of FITS table: %s",
    712712                    colNum, fitsErr);
    713713            psFree(colSpecsIter);
Note: See TracChangeset for help on using the changeset viewer.