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/math/psMathUtils.c

    r8245 r8627  
    33 *  This file contains standard math routines.
    44 *
    5  *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-08-09 02:26:44 $
     5 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-08-26 04:34:28 $
    77 *
    88 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5858    long max; \
    5959    long mid; \
    60     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__); \
     60    psTrace("psLib.math", 4, "---- () begin ----\n"); \
    6161    /* psTrace("psLib.math", 6, "Determining the bin for: %f\n", x); */\
    6262    if (value < bounds[0]) { \
    6363        psLogMsg(__func__, PS_LOG_WARN, \
    6464                 "vectorBinDisect%s(): ordinate %f is outside vector range (%f - %f).", \
    65                  #TYPE, value, bounds[0], bounds[numBins-1]); \
     65                 #TYPE, (double)value, (double)bounds[0], (double)bounds[numBins-1]); \
    6666        return(-2); \
    6767    } \
     
    6969        psLogMsg(__func__, PS_LOG_WARN, \
    7070                 "vectorBinDisect%s(): ordinate %f is outside vector range (%f - %f).", \
    71                  #TYPE, value, bounds[0], bounds[numBins-1]); \
     71                 #TYPE, (double)value, (double)bounds[0], (double)bounds[numBins-1]); \
    7272        return(-1); \
    7373    } \
     
    7979        \
    8080        if (value == bounds[mid]) { \
    81             psTrace("psLib.math", 4, "---- %s(%d) end (1) ----\n", __func__, mid); \
     81            psTrace("psLib.math", 4, "---- %s(%ld) end (1) ----\n", __func__, mid); \
    8282            return(mid); \
    8383        } else if (value < bounds[mid]) { \
     
    8888        mid = ((max+1)+min)/2; \
    8989    } \
    90     psTrace("psLib.math", 4, "---- %s(%d) end (2) ----\n", __func__, min); \
     90    psTrace("psLib.math", 4, "---- %s(%ld) end (2) ----\n", __func__, min); \
    9191    return(min); \
    9292}
Note: See TracChangeset for help on using the changeset viewer.