Fossil SCM
unused variable "fossilTimer"
Commit
55d7e2c14a93643e48ba98f4c07730a7742f1ab1
Parent
967d8a711e43040…
1 file changed
+6
-7
+6
-7
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -171,28 +171,27 @@ | ||
| 171 | 171 | getrusage(RUSAGE_SELF, &s); |
| 172 | 172 | if( piUser ){ |
| 173 | 173 | *piUser = ((sqlite3_uint64)s.ru_utime.tv_sec)*1000000 + s.ru_utime.tv_usec; |
| 174 | 174 | } |
| 175 | 175 | if( piKernel ){ |
| 176 | - *piKernel = | |
| 176 | + *piKernel = | |
| 177 | 177 | ((sqlite3_uint64)s.ru_stime.tv_sec)*1000000 + s.ru_stime.tv_usec; |
| 178 | 178 | } |
| 179 | 179 | #endif |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /* |
| 183 | 183 | ** Internal helper type for fossil_timer_xxx(). |
| 184 | 184 | */ |
| 185 | +enum FossilTimerEnum { | |
| 186 | + FOSSIL_TIMER_COUNT = 10 /* Number of timers we can track. */ | |
| 187 | +}; | |
| 185 | 188 | static struct FossilTimer { |
| 186 | 189 | sqlite3_uint64 u; /* "User" CPU times */ |
| 187 | 190 | sqlite3_uint64 s; /* "System" CPU times */ |
| 188 | 191 | int id; /* positive if allocated, else 0. */ |
| 189 | -} fossilTimer = { 0U, 0U, 0 }; | |
| 190 | -enum FossilTimerEnum { | |
| 191 | - FOSSIL_TIMER_COUNT = 10 /* Number of timers we can track. */ | |
| 192 | -}; | |
| 193 | -static struct FossilTimer fossilTimerList[FOSSIL_TIMER_COUNT] = {{0,0,0}}; | |
| 192 | +} fossilTimerList[FOSSIL_TIMER_COUNT] = {{0,0,0}}; | |
| 194 | 193 | |
| 195 | 194 | /* |
| 196 | 195 | ** Stores the current CPU times into the shared timer list |
| 197 | 196 | ** and returns that timer's internal ID. Pass that ID to |
| 198 | 197 | ** fossil_timer_fetch() to get the elapsed time for that |
| @@ -210,11 +209,11 @@ | ||
| 210 | 209 | int i; |
| 211 | 210 | static char once = 0; |
| 212 | 211 | if(!once){ |
| 213 | 212 | once = 1; |
| 214 | 213 | memset(&fossilTimerList, 0, |
| 215 | - sizeof(fossilTimerList)/sizeof(fossilTimerList[0])); | |
| 214 | + count(fossilTimerList)); | |
| 216 | 215 | } |
| 217 | 216 | for( i = 0; i < FOSSIL_TIMER_COUNT; ++i ){ |
| 218 | 217 | struct FossilTimer * ft = &fossilTimerList[i]; |
| 219 | 218 | if(ft->id) continue; |
| 220 | 219 | ft->id = i+1; |
| 221 | 220 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -171,28 +171,27 @@ | |
| 171 | getrusage(RUSAGE_SELF, &s); |
| 172 | if( piUser ){ |
| 173 | *piUser = ((sqlite3_uint64)s.ru_utime.tv_sec)*1000000 + s.ru_utime.tv_usec; |
| 174 | } |
| 175 | if( piKernel ){ |
| 176 | *piKernel = |
| 177 | ((sqlite3_uint64)s.ru_stime.tv_sec)*1000000 + s.ru_stime.tv_usec; |
| 178 | } |
| 179 | #endif |
| 180 | } |
| 181 | |
| 182 | /* |
| 183 | ** Internal helper type for fossil_timer_xxx(). |
| 184 | */ |
| 185 | static struct FossilTimer { |
| 186 | sqlite3_uint64 u; /* "User" CPU times */ |
| 187 | sqlite3_uint64 s; /* "System" CPU times */ |
| 188 | int id; /* positive if allocated, else 0. */ |
| 189 | } fossilTimer = { 0U, 0U, 0 }; |
| 190 | enum FossilTimerEnum { |
| 191 | FOSSIL_TIMER_COUNT = 10 /* Number of timers we can track. */ |
| 192 | }; |
| 193 | static struct FossilTimer fossilTimerList[FOSSIL_TIMER_COUNT] = {{0,0,0}}; |
| 194 | |
| 195 | /* |
| 196 | ** Stores the current CPU times into the shared timer list |
| 197 | ** and returns that timer's internal ID. Pass that ID to |
| 198 | ** fossil_timer_fetch() to get the elapsed time for that |
| @@ -210,11 +209,11 @@ | |
| 210 | int i; |
| 211 | static char once = 0; |
| 212 | if(!once){ |
| 213 | once = 1; |
| 214 | memset(&fossilTimerList, 0, |
| 215 | sizeof(fossilTimerList)/sizeof(fossilTimerList[0])); |
| 216 | } |
| 217 | for( i = 0; i < FOSSIL_TIMER_COUNT; ++i ){ |
| 218 | struct FossilTimer * ft = &fossilTimerList[i]; |
| 219 | if(ft->id) continue; |
| 220 | ft->id = i+1; |
| 221 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -171,28 +171,27 @@ | |
| 171 | getrusage(RUSAGE_SELF, &s); |
| 172 | if( piUser ){ |
| 173 | *piUser = ((sqlite3_uint64)s.ru_utime.tv_sec)*1000000 + s.ru_utime.tv_usec; |
| 174 | } |
| 175 | if( piKernel ){ |
| 176 | *piKernel = |
| 177 | ((sqlite3_uint64)s.ru_stime.tv_sec)*1000000 + s.ru_stime.tv_usec; |
| 178 | } |
| 179 | #endif |
| 180 | } |
| 181 | |
| 182 | /* |
| 183 | ** Internal helper type for fossil_timer_xxx(). |
| 184 | */ |
| 185 | enum FossilTimerEnum { |
| 186 | FOSSIL_TIMER_COUNT = 10 /* Number of timers we can track. */ |
| 187 | }; |
| 188 | static struct FossilTimer { |
| 189 | sqlite3_uint64 u; /* "User" CPU times */ |
| 190 | sqlite3_uint64 s; /* "System" CPU times */ |
| 191 | int id; /* positive if allocated, else 0. */ |
| 192 | } fossilTimerList[FOSSIL_TIMER_COUNT] = {{0,0,0}}; |
| 193 | |
| 194 | /* |
| 195 | ** Stores the current CPU times into the shared timer list |
| 196 | ** and returns that timer's internal ID. Pass that ID to |
| 197 | ** fossil_timer_fetch() to get the elapsed time for that |
| @@ -210,11 +209,11 @@ | |
| 209 | int i; |
| 210 | static char once = 0; |
| 211 | if(!once){ |
| 212 | once = 1; |
| 213 | memset(&fossilTimerList, 0, |
| 214 | count(fossilTimerList)); |
| 215 | } |
| 216 | for( i = 0; i < FOSSIL_TIMER_COUNT; ++i ){ |
| 217 | struct FossilTimer * ft = &fossilTimerList[i]; |
| 218 | if(ft->id) continue; |
| 219 | ft->id = i+1; |
| 220 |