Changeset 5072
- Timestamp:
- Sep 19, 2005, 4:43:53 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 6 edited
-
src/math/psSpline.c (modified) (8 diffs)
-
src/sys/psLogMsg.c (modified) (9 diffs)
-
src/sys/psLogMsg.h (modified) (3 diffs)
-
test/sys/tst_psLogMsg.c (modified) (7 diffs)
-
test/sys/verified/tst_psLogMsg.stderr (modified) (4 diffs)
-
test/sys/verified/tst_psLogMsg.stdout (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psSpline.c
r5070 r5072 7 7 * splines. 8 8 * 9 * @version $Revision: 1.12 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-09- 19 22:50:28$9 * @version $Revision: 1.126 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-09-20 02:43:53 $ 11 11 * 12 12 * … … 43 43 /*****************************************************************************/ 44 44 static void spline1DFree(psSpline1D *tmpSpline); 45 static unsigned int vectorBinDisectF32(psF32 *bins, psS32numBins,psF32 x);46 static unsigned int vectorBinDisectS32(psS32 *bins, psS32numBins,psS32 x);45 static unsigned int vectorBinDisectF32(psF32 *bins,unsigned int numBins,psF32 x); 46 static unsigned int vectorBinDisectS32(psS32 *bins,unsigned int numBins,psS32 x); 47 47 48 48 /*****************************************************************************/ … … 113 113 \ 114 114 psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 4, \ 115 "---- fullInterpolate1D##TYPE() begin (% d-order at x=%f) (%d data points)----\n", n-1, x, n); \115 "---- fullInterpolate1D##TYPE() begin (%u-order at x=%f) (%d data points)----\n", n-1, x, n); \ 116 116 \ 117 117 for (i=0;i<n;i++) { \ … … 123 123 p->data.TYPE[i] = range[i]; \ 124 124 psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 6, \ 125 "p->data.TYPE[% d] is %f\n", i, p->data.TYPE[i]); \125 "p->data.TYPE[%u] is %f\n", i, p->data.TYPE[i]); \ 126 126 \ 127 127 } \ … … 140 140 */ \ 141 141 psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 6, \ 142 "p->data.TYPE[% d] is %f\n", i, p->data.TYPE[i]); \142 "p->data.TYPE[%u] is %f\n", i, p->data.TYPE[i]); \ 143 143 } \ 144 144 } \ … … 841 841 #define FUNC_MACRO_VECTOR_BIN_DISECT(TYPE) \ 842 842 static unsigned int vectorBinDisect##TYPE(ps##TYPE *bins, \ 843 psS32numBins, \843 unsigned int numBins, \ 844 844 ps##TYPE x) \ 845 845 { \ 846 psS32min; \847 psS32max; \848 psS32mid; \846 unsigned int min; \ 847 unsigned int max; \ 848 unsigned int mid; \ 849 849 \ 850 850 psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \ … … 871 871 while (min != max) { \ 872 872 psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \ 873 "(min, mid, max) is (% d, %d, %d): (x, bins) is (%f, %f)\n", \873 "(min, mid, max) is (%u, %u, %u): (x, bins) is (%f, %f)\n", \ 874 874 min, mid, max, x, bins[mid]); \ 875 875 \ 876 876 if (x == bins[mid]) { \ 877 877 psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \ 878 "---- Exiting vectorBinDisect##TYPE(): bin % d\n", mid); \878 "---- Exiting vectorBinDisect##TYPE(): bin %u\n", mid); \ 879 879 return(mid); \ 880 880 } else if (x < bins[mid]) { \ … … 887 887 \ 888 888 psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \ 889 "---- Exiting vectorBinDisect##TYPE(): bin % d\n", min); \889 "---- Exiting vectorBinDisect##TYPE(): bin %u\n", min); \ 890 890 return(min); \ 891 891 } \ -
trunk/psLib/src/sys/psLogMsg.c
r4979 r5072 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.5 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-09- 09 01:11:22$14 * @version $Revision: 1.52 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-09-20 02:43:53 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 51 51 52 52 static FILE *logDest = (FILE *) 1; // flag to initialize to stderr before using. 53 static int logFD = 0; 53 54 static psS32 globalLogLevel = PS_LOG_INFO; // log all messages at this or above 54 55 static psBool logTime = true; // Flag to include time info … … 81 82 } 82 83 84 int psLogGetLevel() 85 { 86 return (globalLogLevel); 87 } 88 83 89 /***************************************************************************** 84 90 psLogSetDestination(): sets the log message destination. … … 94 100 if (logDest == (FILE *) 1) { 95 101 logDest = stderr; 102 logFD = 2; 96 103 } 97 104 if (fd == -1) … … 104 111 } 105 112 logDest = stdout; 113 logFD = 1; 106 114 } else if (fd == 2) { 107 115 // fp = stderr; … … 110 118 } 111 119 logDest = stderr; 120 logFD = 2; 112 121 } else if (fd == 0) { 113 122 // fp = NULL; … … 116 125 } 117 126 logDest = NULL; 127 logFD = 0; 118 128 // return true; 119 129 } else if (fd > 2) { … … 123 133 fp = fdopen(fd, "w"); 124 134 logDest = fp; 135 logFD = fd; 125 136 // fclose(fp); 126 137 // return true; … … 130 141 131 142 } 143 144 int psLogGetDestination(void) 145 { 146 if (logDest == (FILE *) 1) { 147 logFD = 1; 148 } 149 return (logFD); 150 } 151 132 152 133 153 /***************************************************************************** -
trunk/psLib/src/sys/psLogMsg.h
r5057 r5072 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.3 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-09- 15 21:22:22$13 * @version $Revision: 1.34 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-09-20 02:43:53 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 36 36 ); 37 37 38 /** This procedure returns the current log destination file descriptor. If the 39 * destination has not been defined by the use, the descriptor for stdout is returned. 40 * 41 * @return int: The current file descriptor. 42 */ 43 int psLogGetDestination(); 44 38 45 /** This procedure sets the message level for future log messages. Subsequent 39 46 * log messages, with a log level of "mylevel", will only be logged if … … 42 49 * be displayed. The old log level will be returned. 43 50 * 44 * @return int old logging level51 * @return int: old logging level. 45 52 */ 46 53 int psLogSetLevel( 47 54 int level ///< Specifies the system log level 48 55 ); 56 57 /** This procedures returns the current log message level. 58 * 59 * @return int: The current logging level. 60 */ 61 int psLogGetLevel(); 49 62 50 63 /** This procedure sets the log format for future log messages. The argument -
trunk/psLib/test/sys/tst_psLogMsg.c
r4979 r5072 26 26 }, 27 27 { 28 testLogMsg02, 2, "psLogSet Level()", 0, false28 testLogMsg02, 2, "psLogSet/GetLevel()", 0, false 29 29 }, 30 30 { … … 35 35 }, 36 36 { 37 testLogMsg05, 5, "psLogSet Destination()", 0, false37 testLogMsg05, 5, "psLogSet/GetDestination()", 0, false 38 38 }, 39 39 { … … 107 107 psLogSetLevel(4); 108 108 psLogMsg(__func__, 4, "This should be displayed (level %d)\n", 4); 109 psLogMsg(__func__, 4, "This should display level 4 logging -> level %d\n", psLogGetLevel() ); 109 110 110 111 return 0; … … 189 190 // psLogSetDestination("none"); 190 191 psLogSetDestination(0); 192 printf(" File Descriptor = %d \n", psLogGetDestination() ); 191 193 for (i=0;i<10;i++) { 192 194 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); … … 196 198 // psLogSetDestination("dest:stderr"); 197 199 psLogSetDestination(2); 200 printf(" File Descriptor = %d \n", psLogGetDestination() ); 198 201 for (i=0;i<10;i++) { 199 202 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); … … 203 206 // psLogSetDestination("dest:stdout"); 204 207 psLogSetDestination(1); 208 printf(" File Descriptor = %d \n", psLogGetDestination() ); 205 209 for (i=0;i<10;i++) { 206 210 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); … … 211 215 // psLogSetDestination("file:log.txt"); 212 216 psLogSetDestination(fd); 217 printf(" File Descriptor = %d \n", psLogGetDestination() ); 213 218 for (i=0;i<10;i++) { 214 219 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); -
trunk/psLib/test/sys/verified/tst_psLogMsg.stderr
r4979 r5072 35 35 /***************************** TESTPOINT ******************************************\ 36 36 * TestFile: tst_psLogMsg.c * 37 * TestPoint: psLogMsg{psLogSet Level()}*37 * TestPoint: psLogMsg{psLogSet/GetLevel()} * 38 38 * TestType: Positive * 39 39 \**********************************************************************************/ … … 61 61 <DATE><TIME>|<HOST>|4|testLogMsg02 62 62 This should be displayed (level 4) 63 <DATE><TIME>|<HOST>|4|testLogMsg02 64 This should display level 4 logging -> level 4 63 65 64 ---> TESTPOINT PASSED (psLogMsg{psLogSet Level()} | tst_psLogMsg.c)66 ---> TESTPOINT PASSED (psLogMsg{psLogSet/GetLevel()} | tst_psLogMsg.c) 65 67 66 68 /***************************** TESTPOINT ******************************************\ … … 152 154 /***************************** TESTPOINT ******************************************\ 153 155 * TestFile: tst_psLogMsg.c * 154 * TestPoint: psLogMsg{psLogSet Destination()}*156 * TestPoint: psLogMsg{psLogSet/GetDestination()} * 155 157 * TestType: Positive * 156 158 \**********************************************************************************/ … … 165 167 Hello World! My level is 3 166 168 167 ---> TESTPOINT PASSED (psLogMsg{psLogSet Destination()} | tst_psLogMsg.c)169 ---> TESTPOINT PASSED (psLogMsg{psLogSet/GetDestination()} | tst_psLogMsg.c) 168 170 169 171 /***************************** TESTPOINT ******************************************\ -
trunk/psLib/test/sys/verified/tst_psLogMsg.stdout
r4979 r5072 1 1 --------------- psLogSetDestination(PS_LOG_NONE) ---------------- 2 File Descriptor = 0 2 3 ------------- psLogSetDestination(PS_LOG_TO_STDERR) ------------- 4 File Descriptor = 2 3 5 ------------- psLogSetDestination(PS_LOG_TO_STDOUT) ------------- 6 File Descriptor = 1 4 7 <DATE><TIME>|<HOST>|A|testLogMsg05 5 8 Hello World! My level is 0 … … 11 14 Hello World! My level is 3 12 15 --------------- psLogSetDestination(file:log.txt) --------------- 16 File Descriptor = 3 13 17 --------------------- The Contents of log.txt ------------------- 14 18 <DATE><TIME>|<HOST>|A|testLogMsg05
Note:
See TracChangeset
for help on using the changeset viewer.
