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/astro/psTime.c

    r8232 r8627  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.93 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-08-08 23:32:22 $
     12 *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-08-26 04:34:27 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8080
    8181// Offset of year 0000 from epoch
    82 #define YEAR_0000_SEC                 -62125920000.0
     82#define YEAR_0000_SEC                 -62125920000
    8383
    8484// Offset of year 9999 from epoch
    85 #define YEAR_9999_SEC                 253202544000.0
     85#define YEAR_9999_SEC                 253202544000
    8686
    8787/** Static function prototypes */
     
    299299    if(tablesFrom->n != numTables) {
    300300        p_psMemAllocatePersistent(initialPersistence);
    301         psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Incorrect vector size. Size: %d, Expected %d."), tablesFrom->n, numTables);
     301        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Incorrect vector size. Size: %ld, Expected %d."), tablesFrom->n, numTables);
    302302        psFree(tablesFrom);
    303303        return false;
     
    316316    if(tablesTo->n != numTables) {
    317317        p_psMemAllocatePersistent(initialPersistence);
    318         psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Incorrect vector size. Size: %d, Expected %d."), tablesTo->n, numTables);
     318        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Incorrect vector size. Size: %ld, Expected %d."), tablesTo->n, numTables);
    319319        psFree(tablesFrom);
    320320        psFree(tablesTo);
     
    335335    if(tablesIndex->n != numTables) {
    336336        p_psMemAllocatePersistent(initialPersistence);
    337         psError(PS_ERR_BAD_PARAMETER_VALUE,true,_("Incorrect vector size. Size: %d, Expected %d."),tablesIndex->n,numTables);
     337        psError(PS_ERR_BAD_PARAMETER_VALUE,true,_("Incorrect vector size. Size: %ld, Expected %d."),tablesIndex->n,numTables);
    338338        psFree(tablesFrom);
    339339        psFree(tablesTo);
     
    13571357
    13581358    // Check valid year range
    1359     PS_ASSERT_LONG_WITHIN_RANGE(time->sec,YEAR_0000_SEC,YEAR_9999_SEC,NULL)
     1359    PS_ASSERT_S64_WITHIN_RANGE(time->sec, (psS64)YEAR_0000_SEC, (psS64)YEAR_9999_SEC, NULL);
    13601360
    13611361    // Allocate temp strings
     
    17271727    // Create output time
    17281728    sec = delta + (psF64)tempTime->sec + (psF64)tempTime->nsec/1e9;
    1729     PS_ASSERT_LONG_WITHIN_RANGE((psS64)sec,0,PS_MAX_S64,outTime);
     1729    PS_ASSERT_S64_WITHIN_RANGE((psS64)sec, (psS64)0, PS_MAX_S64, NULL);
    17301730    outTime->sec = (psS64)sec;
    17311731    outTime->nsec = (psU32)((sec - (psF64)outTime->sec)*1e9);
    17321732
    17331733    // Error check
    1734     PS_ASSERT_INT_WITHIN_RANGE(outTime->nsec,0,(psU32)((1e9)-1),outTime);
     1734    PS_ASSERT_INT_WITHIN_RANGE(outTime->nsec,0,(psU32)((1e9)-1), NULL);
    17351735
    17361736    // Convert result to same time type as input
Note: See TracChangeset for help on using the changeset viewer.