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/sys/psAssert.h

    r8409 r8627  
    33
    44#include <assert.h>
     5#include <inttypes.h>
     6
    57#include "psError.h"
    68#include "psLogMsg.h"
     
    155157if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \
    156158    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    157             "Error: %s, %lld, is out of range.", \
     159            "Error: %s, %ld, is out of range.  Must be between %ld and %ld.", \
     160            #NAME, NAME, LOWER, UPPER); \
     161    return RVAL; \
     162}
     163
     164#define PS_ASSERT_LONG_LARGER_THAN_OR_EQUAL(NAME1, NAME2, RVAL) \
     165if (!((NAME1) >= (NAME2))) { \
     166    psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: !(%s >= %s) (%ld %ld).",\
     167            #NAME1, #NAME2, NAME1, NAME2); \
     168    return(RVAL); \
     169}
     170
     171#define PS_ASSERT_S64_WITHIN_RANGE(NAME, LOWER, UPPER, RVAL) \
     172if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \
     173    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
     174            "Error: %s, %" PRId64 ", is out of range.  Must be between %" PRId64 " and %" PRId64 ".", \
    158175            #NAME, NAME, LOWER, UPPER); \
    159176    return RVAL; \
Note: See TracChangeset for help on using the changeset viewer.