| | @@ -84,17 +84,17 @@ |
| 84 | 84 | ** Print the timing results. |
| 85 | 85 | */ |
| 86 | 86 | static double endTimer(void){ |
| 87 | 87 | struct rusage sEnd; |
| 88 | 88 | getrusage(RUSAGE_SELF, &sEnd); |
| 89 | | - return timeDiff(&sBegin.ru_utime, &sEnd.ru_utime) |
| 90 | | - + timeDiff(&sBegin.ru_stime, &sEnd.ru_stime); |
| 91 | 89 | #if 0 |
| 92 | 90 | printf("CPU Time: user %f sys %f\n", |
| 93 | 91 | timeDiff(&sBegin.ru_utime, &sEnd.ru_utime), |
| 94 | 92 | timeDiff(&sBegin.ru_stime, &sEnd.ru_stime)); |
| 95 | 93 | #endif |
| 94 | + return timeDiff(&sBegin.ru_utime, &sEnd.ru_utime) |
| 95 | + + timeDiff(&sBegin.ru_stime, &sEnd.ru_stime); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | #define BEGIN_TIMER beginTimer() |
| 99 | 99 | #define END_TIMER endTimer() |
| 100 | 100 | #define HAS_TIMER 1 |
| | @@ -162,10 +162,11 @@ |
| 162 | 162 | FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd; |
| 163 | 163 | getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelEnd, &ftUserEnd); |
| 164 | 164 | return timeDiff(&ftUserBegin, &ftUserEnd) + |
| 165 | 165 | timeDiff(&ftKernelBegin, &ftKernelEnd); |
| 166 | 166 | } |
| 167 | + return 0.0; |
| 167 | 168 | } |
| 168 | 169 | |
| 169 | 170 | #define BEGIN_TIMER beginTimer() |
| 170 | 171 | #define END_TIMER endTimer() |
| 171 | 172 | #define HAS_TIMER hasTimer() |
| | @@ -912,11 +913,10 @@ |
| 912 | 913 | cson_array * target ){ |
| 913 | 914 | char const * p = zStr /* current byte */; |
| 914 | 915 | char const * head /* current start-of-token */; |
| 915 | 916 | unsigned int len = 0 /* current token's length */; |
| 916 | 917 | int rc = 0 /* return code (number of added elements)*/; |
| 917 | | - char skipWs = fossil_isspace(separator) ? 0 : 1; |
| 918 | 918 | assert( zStr && target ); |
| 919 | 919 | while( fossil_isspace(*p) ){ |
| 920 | 920 | ++p; |
| 921 | 921 | } |
| 922 | 922 | head = p; |
| | @@ -1015,11 +1015,10 @@ |
| 1015 | 1015 | ** This must only be called once, or an assertion may be triggered. |
| 1016 | 1016 | */ |
| 1017 | 1017 | static void json_mode_bootstrap(){ |
| 1018 | 1018 | static char once = 0 /* guard against multiple runs */; |
| 1019 | 1019 | char const * zPath = P("PATH_INFO"); |
| 1020 | | - cson_value * pathSplit = NULL; |
| 1021 | 1020 | assert( (0==once) && "json_mode_bootstrap() called too many times!"); |
| 1022 | 1021 | if( once ){ |
| 1023 | 1022 | return; |
| 1024 | 1023 | }else{ |
| 1025 | 1024 | once = 1; |
| | @@ -1151,11 +1150,10 @@ |
| 1151 | 1150 | g.json.errorDetailParanoia = 0 /*disable error code dumb-down for CLI mode*/; |
| 1152 | 1151 | } |
| 1153 | 1152 | |
| 1154 | 1153 | {/* set up JSON output formatting options. */ |
| 1155 | 1154 | int indent = -1; |
| 1156 | | - char const * indentStr = NULL; |
| 1157 | 1155 | indent = json_find_option_int("indent",NULL,"I",-1); |
| 1158 | 1156 | g.json.outOpt.indentation = (0>indent) |
| 1159 | 1157 | ? (g.isHTTP ? 0 : 1) |
| 1160 | 1158 | : (unsigned char)indent; |
| 1161 | 1159 | g.json.outOpt.addNewline = g.isHTTP |
| | @@ -1331,11 +1329,10 @@ |
| 1331 | 1329 | if(!g.json.cmd.a){ |
| 1332 | 1330 | return NULL; |
| 1333 | 1331 | }else{ |
| 1334 | 1332 | cson_value * rc = NULL; |
| 1335 | 1333 | Blob path = empty_blob; |
| 1336 | | - char const * part; |
| 1337 | 1334 | unsigned int aLen = g.json.dispatchDepth+1; /*cson_array_length_get(g.json.cmd.a);*/ |
| 1338 | 1335 | unsigned int i = 1; |
| 1339 | 1336 | for( ; i < aLen; ++i ){ |
| 1340 | 1337 | char const * part = cson_string_cstr(cson_value_get_string(cson_array_get(g.json.cmd.a, i))); |
| 1341 | 1338 | if(!part){ |
| 1342 | 1339 | |