Changeset 8627 for trunk/psLib/src/sys
- Timestamp:
- Aug 25, 2006, 6:34:28 PM (20 years ago)
- Location:
- trunk/psLib/src/sys
- Files:
-
- 7 edited
-
psAbort.h (modified) (3 diffs)
-
psAssert.h (modified) (2 diffs)
-
psConfigure.c (modified) (2 diffs)
-
psError.h (modified) (5 diffs)
-
psLogMsg.h (modified) (3 diffs)
-
psMemory.c (modified) (2 diffs)
-
psTrace.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psAbort.h
r4307 r8627 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $15 * @date $Date: 200 5-06-17 23:39:51$14 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-08-26 04:34:28 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 * 38 38 */ 39 #ifdef __GNUC__ 40 void psAbort( 41 const char *name, ///< Source of abort such as file or function detected 42 const char *format, ///< A printf style formatting statement defining msg 43 ... 44 ) __attribute__((format(printf, 2, 3))); 45 #else // __GNUC__ 39 46 void psAbort( 40 47 const char *name, ///< Source of abort such as file or function detected … … 42 49 ... 43 50 ); 51 #endif // __GNUC__ 44 52 45 53 /** @} */ // Doxygen - End of SystemGroup Functions -
trunk/psLib/src/sys/psAssert.h
r8409 r8627 3 3 4 4 #include <assert.h> 5 #include <inttypes.h> 6 5 7 #include "psError.h" 6 8 #include "psLogMsg.h" … … 155 157 if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \ 156 158 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) \ 165 if (!((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) \ 172 if ((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 ".", \ 158 175 #NAME, NAME, LOWER, UPPER); \ 159 176 return RVAL; \ -
trunk/psLib/src/sys/psConfigure.c
r8232 r8627 13 13 * @author Robert DeSonia, MHPCC 14 14 * 15 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $16 * @date $Date: 2006-08- 08 23:32:23$15 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-08-26 04:34:28 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 80 80 nCorrupted = psMemCheckCorruption(false); 81 81 if (nCorrupted > 0) { 82 psError(PS_ERR_UNKNOWN, true, "%d memory blocks corrupted; list written to %s.\n", nCorrupted );82 psError(PS_ERR_UNKNOWN, true, "%d memory blocks corrupted; list written to %s.\n", nCorrupted, memCheckName); 83 83 } else { 84 84 psLogMsg(__func__, PS_LOG_INFO, "No memory corruption found.\n"); -
trunk/psLib/src/sys/psError.h
r8231 r8627 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-08- 08 23:11:25$14 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-08-26 04:34:28 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 92 92 * 93 93 */ 94 #ifdef __GNUC__ 94 95 void psErrorStackPrint( 95 96 FILE* fd, ///< destination file descriptor 96 const char* format, ///< printf-style format of header line 97 ... ///< any parameters required in fmt 98 ); 97 const char* format, ///< printf-style format of header line 98 ... ///< any parameters required in fmt 99 ) __attribute__((format(printf, 2, 3))); 100 #else // __GNUC__ 101 void psErrorStackPrint( 102 FILE* fd, ///< destination file descriptor 103 const char* format, ///< printf-style format of header line 104 ... ///< any parameters required in fmt 105 ); 106 #endif // __GNUC__ 107 99 108 100 109 #ifndef SWIG … … 155 164 * @return psErrorcode the given error code 156 165 */ 166 #ifdef __GNUC__ 157 167 psErrorCode p_psError( 158 168 const char* filename, ///< file name … … 163 173 const char* format, ///< printf-style format of header line 164 174 ... ///< any parameters required in fmt 165 ); 175 ) __attribute__((format(printf, 6, 7))); 176 #else // __GNUC__ 177 psErrorCode p_psError( 178 const char* filename, ///< file name 179 unsigned int lineno, ///< line number in file 180 const char* func, ///< function name 181 psErrorCode code, ///< Error class code 182 bool new, ///< true if error originates at this location 183 const char* format, ///< printf-style format of header line 184 ... ///< any parameters required in fmt 185 ); 186 #endif // __GNUC__ 166 187 167 188 /** Logs a warning message. … … 172 193 * 173 194 */ 195 #ifdef __GNUC__ 174 196 void p_psWarning( 175 197 const char* file, ///< file name 176 198 int lineno, ///< line number in file 177 199 const char* func, ///< function name 178 const char* fmt, ///< printf-style format of header line 179 ... ///< any parameters required in fmt 180 ); 200 const char* format, ///< printf-style format of header line 201 ... ///< any parameters required in fmt 202 ) __attribute__((format(printf, 4, 5))); 203 #else // __GNUC__ 204 void p_psWarning( 205 const char* file, ///< file name 206 int lineno, ///< line number in file 207 const char* func, ///< function name 208 const char* format, ///< printf-style format of header line 209 ... ///< any parameters required in fmt 210 ); 211 #endif // __GNUC__ 181 212 182 213 -
trunk/psLib/src/sys/psLogMsg.h
r7587 r8627 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-0 6-16 23:01:10$13 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-08-26 04:34:28 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 90 90 * 91 91 */ 92 #ifdef __GNUC__ 93 void psLogMsg( 94 const char *name, ///< name of the log source 95 int level, ///< severity level of this log message 96 const char *format, ///< printf-style format command 97 ... 98 ) __attribute__((format(printf, 3, 4))); 99 #else // __GNUC__ 92 100 void psLogMsg( 93 101 const char *name, ///< name of the log source … … 96 104 ... 97 105 ); 106 #endif // __GNUC__ 98 107 99 108 #ifndef SWIG -
trunk/psLib/src/sys/psMemory.c
r8540 r8627 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1. 79$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-08-2 4 02:17:17$10 * @version $Revision: 1.80 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-08-26 04:34:28 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 530 530 ptr = memExhaustedCallback(size); 531 531 if (ptr == NULL) { 532 psAbort(__func__, "Failed to reallocate % ld bytes at %s:%d", size, file, lineno);532 psAbort(__func__, "Failed to reallocate %zd bytes at %s:%d", size, file, lineno); 533 533 } 534 534 } -
trunk/psLib/src/sys/psTrace.h
r8404 r8627 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1. 49$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-08- 17 01:39:03$11 * @version $Revision: 1.50 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-08-26 04:34:28 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 89 89 ); 90 90 91 #else 91 #else // DOXYGEN 92 #ifdef __GNUC__ 92 93 /// Send a trace message 93 94 void p_psTrace( … … 99 100 const char *format, ///< printf-style format command 100 101 ... ///< trace message arguments 102 ) __attribute__((format(printf, 6, 7))); 103 #else // __GNUC__ 104 void p_psTrace( 105 const char* file, ///< file name 106 int lineno, ///< line number in file 107 const char* func, ///< function name 108 const char *facil, ///< facilty of interest 109 psS32 level, ///< desired trace level 110 const char *format, ///< printf-style format command 111 ... ///< trace message arguments 101 112 ); 102 113 #endif // __GNUC__ 103 114 #ifndef SWIG 104 115 #define psTrace(facil, level, ...) p_psTrace(__FILE__,__LINE__,__func__,facil, level, __VA_ARGS__) … … 110 121 va_list ap ///< varargs argument list 111 122 ); 112 113 123 #endif /* SWIG */ 114 115 124 #endif /* DOXYGEN */ 116 125
Note:
See TracChangeset
for help on using the changeset viewer.
