Fossil SCM

Minor compiler warning in shell.c (already fixed in SQLite). "char const" -> "const char" for consistancy.

jan.nijtmans 2015-01-28 09:24 trunk
Commit 5330d107b25626e1441fab860bcd9b0f331557ec
+4 -4
--- src/db.c
+++ src/db.c
@@ -770,12 +770,12 @@
770770
void db_sym2rid_function(
771771
sqlite3_context *context,
772772
int argc,
773773
sqlite3_value **argv
774774
){
775
- char const * arg;
776
- char const * type;
775
+ const char *arg;
776
+ const char *type;
777777
if(1 != argc && 2 != argc){
778778
sqlite3_result_error(context, "Expecting one or two arguments", -1);
779779
return;
780780
}
781781
arg = (const char*)sqlite3_value_text(argv[0]);
@@ -1181,11 +1181,11 @@
11811181
11821182
/* Verify that the PLINK table has a new column added by the
11831183
** 2014-11-28 schema change. Create it if necessary. This code
11841184
** can be removed in the future, once all users have upgraded to the
11851185
** 2014-11-28 or later schema.
1186
- */
1186
+ */
11871187
if( !db_table_has_column("repository","plink","baseid") ){
11881188
db_multi_exec(
11891189
"ALTER TABLE %s.plink ADD COLUMN baseid;", db_name("repository")
11901190
);
11911191
}
@@ -1192,11 +1192,11 @@
11921192
11931193
/* Verify that the MLINK table has the newer columns added by the
11941194
** 2015-01-24 schema change. Create them if necessary. This code
11951195
** can be removed in the future, once all users have upgraded to the
11961196
** 2015-01-24 or later schema.
1197
- */
1197
+ */
11981198
if( !db_table_has_column("repository","mlink","isaux") ){
11991199
db_begin_transaction();
12001200
db_multi_exec(
12011201
"ALTER TABLE %s.mlink ADD COLUMN pmid INTEGER DEFAULT 0;"
12021202
"ALTER TABLE %s.mlink ADD COLUMN isaux INTEGER DEFAULT 0;",
12031203
--- src/db.c
+++ src/db.c
@@ -770,12 +770,12 @@
770 void db_sym2rid_function(
771 sqlite3_context *context,
772 int argc,
773 sqlite3_value **argv
774 ){
775 char const * arg;
776 char const * type;
777 if(1 != argc && 2 != argc){
778 sqlite3_result_error(context, "Expecting one or two arguments", -1);
779 return;
780 }
781 arg = (const char*)sqlite3_value_text(argv[0]);
@@ -1181,11 +1181,11 @@
1181
1182 /* Verify that the PLINK table has a new column added by the
1183 ** 2014-11-28 schema change. Create it if necessary. This code
1184 ** can be removed in the future, once all users have upgraded to the
1185 ** 2014-11-28 or later schema.
1186 */
1187 if( !db_table_has_column("repository","plink","baseid") ){
1188 db_multi_exec(
1189 "ALTER TABLE %s.plink ADD COLUMN baseid;", db_name("repository")
1190 );
1191 }
@@ -1192,11 +1192,11 @@
1192
1193 /* Verify that the MLINK table has the newer columns added by the
1194 ** 2015-01-24 schema change. Create them if necessary. This code
1195 ** can be removed in the future, once all users have upgraded to the
1196 ** 2015-01-24 or later schema.
1197 */
1198 if( !db_table_has_column("repository","mlink","isaux") ){
1199 db_begin_transaction();
1200 db_multi_exec(
1201 "ALTER TABLE %s.mlink ADD COLUMN pmid INTEGER DEFAULT 0;"
1202 "ALTER TABLE %s.mlink ADD COLUMN isaux INTEGER DEFAULT 0;",
1203
--- src/db.c
+++ src/db.c
@@ -770,12 +770,12 @@
770 void db_sym2rid_function(
771 sqlite3_context *context,
772 int argc,
773 sqlite3_value **argv
774 ){
775 const char *arg;
776 const char *type;
777 if(1 != argc && 2 != argc){
778 sqlite3_result_error(context, "Expecting one or two arguments", -1);
779 return;
780 }
781 arg = (const char*)sqlite3_value_text(argv[0]);
@@ -1181,11 +1181,11 @@
1181
1182 /* Verify that the PLINK table has a new column added by the
1183 ** 2014-11-28 schema change. Create it if necessary. This code
1184 ** can be removed in the future, once all users have upgraded to the
1185 ** 2014-11-28 or later schema.
1186 */
1187 if( !db_table_has_column("repository","plink","baseid") ){
1188 db_multi_exec(
1189 "ALTER TABLE %s.plink ADD COLUMN baseid;", db_name("repository")
1190 );
1191 }
@@ -1192,11 +1192,11 @@
1192
1193 /* Verify that the MLINK table has the newer columns added by the
1194 ** 2015-01-24 schema change. Create them if necessary. This code
1195 ** can be removed in the future, once all users have upgraded to the
1196 ** 2015-01-24 or later schema.
1197 */
1198 if( !db_table_has_column("repository","mlink","isaux") ){
1199 db_begin_transaction();
1200 db_multi_exec(
1201 "ALTER TABLE %s.mlink ADD COLUMN pmid INTEGER DEFAULT 0;"
1202 "ALTER TABLE %s.mlink ADD COLUMN isaux INTEGER DEFAULT 0;",
1203
+6 -6
--- src/http.c
+++ src/http.c
@@ -155,11 +155,11 @@
155155
blob_reset(&x);
156156
return ( c!='n' && c!='N' );
157157
}
158158
159159
/*
160
-** Get the HTTP Basic Authorization credentials from the user
160
+** Get the HTTP Basic Authorization credentials from the user
161161
** when 401 is received.
162162
*/
163163
char *prompt_for_httpauth_creds(void){
164164
Blob x;
165165
char *zUser;
@@ -266,11 +266,11 @@
266266
transport_send(&g.url, &hdr);
267267
transport_send(&g.url, &payload);
268268
blob_reset(&hdr);
269269
blob_reset(&payload);
270270
transport_flip(&g.url);
271
-
271
+
272272
/*
273273
** Read and interpret the server reply
274274
*/
275275
closeConnection = 1;
276276
iLength = -1;
@@ -333,11 +333,11 @@
333333
for(i=9; zLine[i] && zLine[i]==' '; i++){}
334334
if( zLine[i]==0 ){
335335
fossil_warning("malformed redirect: %s", zLine);
336336
goto write_err;
337337
}
338
- j = strlen(zLine) - 1;
338
+ j = strlen(zLine) - 1;
339339
while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
340340
j -= 4;
341341
zLine[j] = 0;
342342
}
343343
transport_close(&g.url);
@@ -349,11 +349,11 @@
349349
g.zHttpAuth = get_httpauth();
350350
return http_exchange(pSend, pReply, useLogin, maxRedirect);
351351
}else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
352352
if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
353353
isCompressed = 0;
354
- }else if( fossil_strnicmp(&zLine[14],
354
+ }else if( fossil_strnicmp(&zLine[14],
355355
"application/x-fossil-uncompressed", -1)==0 ){
356356
isCompressed = 0;
357357
}else if( fossil_strnicmp(&zLine[14], "application/x-fossil", -1)!=0 ){
358358
isError = 1;
359359
}
@@ -411,12 +411,12 @@
411411
}else{
412412
transport_rewind(&g.url);
413413
}
414414
return 0;
415415
416
- /*
416
+ /*
417417
** Jump to here if an error is seen.
418418
*/
419419
write_err:
420420
transport_close(&g.url);
421
- return 1;
421
+ return 1;
422422
}
423423
--- src/http.c
+++ src/http.c
@@ -155,11 +155,11 @@
155 blob_reset(&x);
156 return ( c!='n' && c!='N' );
157 }
158
159 /*
160 ** Get the HTTP Basic Authorization credentials from the user
161 ** when 401 is received.
162 */
163 char *prompt_for_httpauth_creds(void){
164 Blob x;
165 char *zUser;
@@ -266,11 +266,11 @@
266 transport_send(&g.url, &hdr);
267 transport_send(&g.url, &payload);
268 blob_reset(&hdr);
269 blob_reset(&payload);
270 transport_flip(&g.url);
271
272 /*
273 ** Read and interpret the server reply
274 */
275 closeConnection = 1;
276 iLength = -1;
@@ -333,11 +333,11 @@
333 for(i=9; zLine[i] && zLine[i]==' '; i++){}
334 if( zLine[i]==0 ){
335 fossil_warning("malformed redirect: %s", zLine);
336 goto write_err;
337 }
338 j = strlen(zLine) - 1;
339 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
340 j -= 4;
341 zLine[j] = 0;
342 }
343 transport_close(&g.url);
@@ -349,11 +349,11 @@
349 g.zHttpAuth = get_httpauth();
350 return http_exchange(pSend, pReply, useLogin, maxRedirect);
351 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
352 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
353 isCompressed = 0;
354 }else if( fossil_strnicmp(&zLine[14],
355 "application/x-fossil-uncompressed", -1)==0 ){
356 isCompressed = 0;
357 }else if( fossil_strnicmp(&zLine[14], "application/x-fossil", -1)!=0 ){
358 isError = 1;
359 }
@@ -411,12 +411,12 @@
411 }else{
412 transport_rewind(&g.url);
413 }
414 return 0;
415
416 /*
417 ** Jump to here if an error is seen.
418 */
419 write_err:
420 transport_close(&g.url);
421 return 1;
422 }
423
--- src/http.c
+++ src/http.c
@@ -155,11 +155,11 @@
155 blob_reset(&x);
156 return ( c!='n' && c!='N' );
157 }
158
159 /*
160 ** Get the HTTP Basic Authorization credentials from the user
161 ** when 401 is received.
162 */
163 char *prompt_for_httpauth_creds(void){
164 Blob x;
165 char *zUser;
@@ -266,11 +266,11 @@
266 transport_send(&g.url, &hdr);
267 transport_send(&g.url, &payload);
268 blob_reset(&hdr);
269 blob_reset(&payload);
270 transport_flip(&g.url);
271
272 /*
273 ** Read and interpret the server reply
274 */
275 closeConnection = 1;
276 iLength = -1;
@@ -333,11 +333,11 @@
333 for(i=9; zLine[i] && zLine[i]==' '; i++){}
334 if( zLine[i]==0 ){
335 fossil_warning("malformed redirect: %s", zLine);
336 goto write_err;
337 }
338 j = strlen(zLine) - 1;
339 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
340 j -= 4;
341 zLine[j] = 0;
342 }
343 transport_close(&g.url);
@@ -349,11 +349,11 @@
349 g.zHttpAuth = get_httpauth();
350 return http_exchange(pSend, pReply, useLogin, maxRedirect);
351 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
352 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
353 isCompressed = 0;
354 }else if( fossil_strnicmp(&zLine[14],
355 "application/x-fossil-uncompressed", -1)==0 ){
356 isCompressed = 0;
357 }else if( fossil_strnicmp(&zLine[14], "application/x-fossil", -1)!=0 ){
358 isError = 1;
359 }
@@ -411,12 +411,12 @@
411 }else{
412 transport_rewind(&g.url);
413 }
414 return 0;
415
416 /*
417 ** Jump to here if an error is seen.
418 */
419 write_err:
420 transport_close(&g.url);
421 return 1;
422 }
423
--- src/http_transport.c
+++ src/http_transport.c
@@ -87,11 +87,11 @@
8787
8888
/*
8989
** SSH initialization of the transport layer
9090
*/
9191
int transport_ssh_open(UrlData *pUrlData){
92
- /* For SSH we need to create and run SSH fossil http
92
+ /* For SSH we need to create and run SSH fossil http
9393
** to talk to the remote machine.
9494
*/
9595
const char *zSsh; /* The base SSH command */
9696
Blob zCmd; /* The SSH command */
9797
char *zHost; /* The host name to contact */
9898
--- src/http_transport.c
+++ src/http_transport.c
@@ -87,11 +87,11 @@
87
88 /*
89 ** SSH initialization of the transport layer
90 */
91 int transport_ssh_open(UrlData *pUrlData){
92 /* For SSH we need to create and run SSH fossil http
93 ** to talk to the remote machine.
94 */
95 const char *zSsh; /* The base SSH command */
96 Blob zCmd; /* The SSH command */
97 char *zHost; /* The host name to contact */
98
--- src/http_transport.c
+++ src/http_transport.c
@@ -87,11 +87,11 @@
87
88 /*
89 ** SSH initialization of the transport layer
90 */
91 int transport_ssh_open(UrlData *pUrlData){
92 /* For SSH we need to create and run SSH fossil http
93 ** to talk to the remote machine.
94 */
95 const char *zSsh; /* The base SSH command */
96 Blob zCmd; /* The SSH command */
97 char *zHost; /* The host name to contact */
98
+5 -5
--- src/md5.c
+++ src/md5.c
@@ -177,11 +177,11 @@
177177
178178
/*
179179
* Update context to reflect the concatenation of another buffer full
180180
* of bytes.
181181
*/
182
-static
182
+static
183183
void MD5Update(MD5Context *pCtx, const unsigned char *buf, unsigned int len){
184184
struct Context *ctx = (struct Context *)pCtx;
185185
uint32 t;
186186
187187
/* Update bitcount */
@@ -224,11 +224,11 @@
224224
225225
memcpy(ctx->in, buf, len);
226226
}
227227
228228
/*
229
- * Final wrapup - pad to 64-byte boundary with the bit pattern
229
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
230230
* 1 0* (64-bit count of bits processed, MSB-first)
231231
*/
232232
static void MD5Final(unsigned char digest[16], MD5Context *pCtx){
233233
struct Context *ctx = (struct Context *)pCtx;
234234
unsigned count;
@@ -274,11 +274,11 @@
274274
** "unsigned char digest[16]" in the calling function. The MD5
275275
** digest is stored in the first 16 bytes. zBuf should
276276
** be "char zBuf[33]".
277277
*/
278278
static void DigestToBase16(unsigned char *digest, char *zBuf){
279
- static char const zEncode[] = "0123456789abcdef";
279
+ static const char zEncode[] = "0123456789abcdef";
280280
int i, j;
281281
282282
for(j=i=0; i<16; i++){
283283
int a = digest[i];
284284
zBuf[j++] = zEncode[(a>>4)&0xf];
@@ -343,11 +343,11 @@
343343
return zResult;
344344
}
345345
346346
/*
347347
** Finish the incremental MD5 checksum. Store the result in blob pOut
348
-** if pOut!=0. Also return a pointer to the result.
348
+** if pOut!=0. Also return a pointer to the result.
349349
**
350350
** This resets the incremental checksum preparing for the next round
351351
** of computation. The return pointer points to a static buffer that
352352
** is overwritten by subsequent calls to this function.
353353
*/
@@ -431,11 +431,11 @@
431431
*/
432432
void md5sum_test(void){
433433
int i;
434434
Blob in;
435435
Blob cksum;
436
-
436
+
437437
for(i=2; i<g.argc; i++){
438438
blob_init(&cksum, "********** not found ***********", -1);
439439
if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
440440
blob_read_from_channel(&in, stdin, -1);
441441
md5sum_blob(&in, &cksum);
442442
--- src/md5.c
+++ src/md5.c
@@ -177,11 +177,11 @@
177
178 /*
179 * Update context to reflect the concatenation of another buffer full
180 * of bytes.
181 */
182 static
183 void MD5Update(MD5Context *pCtx, const unsigned char *buf, unsigned int len){
184 struct Context *ctx = (struct Context *)pCtx;
185 uint32 t;
186
187 /* Update bitcount */
@@ -224,11 +224,11 @@
224
225 memcpy(ctx->in, buf, len);
226 }
227
228 /*
229 * Final wrapup - pad to 64-byte boundary with the bit pattern
230 * 1 0* (64-bit count of bits processed, MSB-first)
231 */
232 static void MD5Final(unsigned char digest[16], MD5Context *pCtx){
233 struct Context *ctx = (struct Context *)pCtx;
234 unsigned count;
@@ -274,11 +274,11 @@
274 ** "unsigned char digest[16]" in the calling function. The MD5
275 ** digest is stored in the first 16 bytes. zBuf should
276 ** be "char zBuf[33]".
277 */
278 static void DigestToBase16(unsigned char *digest, char *zBuf){
279 static char const zEncode[] = "0123456789abcdef";
280 int i, j;
281
282 for(j=i=0; i<16; i++){
283 int a = digest[i];
284 zBuf[j++] = zEncode[(a>>4)&0xf];
@@ -343,11 +343,11 @@
343 return zResult;
344 }
345
346 /*
347 ** Finish the incremental MD5 checksum. Store the result in blob pOut
348 ** if pOut!=0. Also return a pointer to the result.
349 **
350 ** This resets the incremental checksum preparing for the next round
351 ** of computation. The return pointer points to a static buffer that
352 ** is overwritten by subsequent calls to this function.
353 */
@@ -431,11 +431,11 @@
431 */
432 void md5sum_test(void){
433 int i;
434 Blob in;
435 Blob cksum;
436
437 for(i=2; i<g.argc; i++){
438 blob_init(&cksum, "********** not found ***********", -1);
439 if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
440 blob_read_from_channel(&in, stdin, -1);
441 md5sum_blob(&in, &cksum);
442
--- src/md5.c
+++ src/md5.c
@@ -177,11 +177,11 @@
177
178 /*
179 * Update context to reflect the concatenation of another buffer full
180 * of bytes.
181 */
182 static
183 void MD5Update(MD5Context *pCtx, const unsigned char *buf, unsigned int len){
184 struct Context *ctx = (struct Context *)pCtx;
185 uint32 t;
186
187 /* Update bitcount */
@@ -224,11 +224,11 @@
224
225 memcpy(ctx->in, buf, len);
226 }
227
228 /*
229 * Final wrapup - pad to 64-byte boundary with the bit pattern
230 * 1 0* (64-bit count of bits processed, MSB-first)
231 */
232 static void MD5Final(unsigned char digest[16], MD5Context *pCtx){
233 struct Context *ctx = (struct Context *)pCtx;
234 unsigned count;
@@ -274,11 +274,11 @@
274 ** "unsigned char digest[16]" in the calling function. The MD5
275 ** digest is stored in the first 16 bytes. zBuf should
276 ** be "char zBuf[33]".
277 */
278 static void DigestToBase16(unsigned char *digest, char *zBuf){
279 static const char zEncode[] = "0123456789abcdef";
280 int i, j;
281
282 for(j=i=0; i<16; i++){
283 int a = digest[i];
284 zBuf[j++] = zEncode[(a>>4)&0xf];
@@ -343,11 +343,11 @@
343 return zResult;
344 }
345
346 /*
347 ** Finish the incremental MD5 checksum. Store the result in blob pOut
348 ** if pOut!=0. Also return a pointer to the result.
349 **
350 ** This resets the incremental checksum preparing for the next round
351 ** of computation. The return pointer points to a static buffer that
352 ** is overwritten by subsequent calls to this function.
353 */
@@ -431,11 +431,11 @@
431 */
432 void md5sum_test(void){
433 int i;
434 Blob in;
435 Blob cksum;
436
437 for(i=2; i<g.argc; i++){
438 blob_init(&cksum, "********** not found ***********", -1);
439 if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
440 blob_read_from_channel(&in, stdin, -1);
441 md5sum_blob(&in, &cksum);
442
+9 -9
--- src/regexp.c
+++ src/regexp.c
@@ -127,11 +127,11 @@
127127
pSet->aState[pSet->nState++] = newState;
128128
}
129129
130130
/* Extract the next unicode character from *pzIn and return it. Advance
131131
** *pzIn to the first byte past the end of the character returned. To
132
-** be clear: this routine converts utf8 to unicode. This routine is
132
+** be clear: this routine converts utf8 to unicode. This routine is
133133
** optimized for the common case where the next character is a single byte.
134134
*/
135135
static unsigned re_next_char(ReInput *p){
136136
unsigned c;
137137
if( p->i>=p->mx ) return 0;
@@ -191,16 +191,16 @@
191191
int rc = 0;
192192
ReInput in;
193193
194194
in.z = zIn;
195195
in.i = 0;
196
- in.mx = nIn>=0 ? nIn : strlen((char const*)zIn);
196
+ in.mx = nIn>=0 ? nIn : strlen((const char*)zIn);
197197
198198
/* Look for the initial prefix match, if there is one. */
199199
if( pRe->nInit ){
200200
unsigned char x = pRe->zInit[0];
201
- while( in.i+pRe->nInit<=in.mx
201
+ while( in.i+pRe->nInit<=in.mx
202202
&& (zIn[in.i]!=x ||
203203
strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0)
204204
){
205205
in.i++;
206206
}
@@ -303,11 +303,11 @@
303303
}
304304
}
305305
}
306306
if( pRe->aOp[x]==RE_OP_CC_EXC ) hit = !hit;
307307
if( hit ) re_add_state(pNext, x+n);
308
- break;
308
+ break;
309309
}
310310
}
311311
}
312312
}
313313
for(i=0; i<pNext->nState; i++){
@@ -464,11 +464,11 @@
464464
const char *zErr;
465465
while( (c = p->xNextChar(&p->sIn))!=0 ){
466466
iStart = p->nState;
467467
switch( c ){
468468
case '|':
469
- case '$':
469
+ case '$':
470470
case ')': {
471471
p->sIn.i--;
472472
return 0;
473473
}
474474
case '(': {
@@ -480,11 +480,11 @@
480480
}
481481
case '.': {
482482
if( rePeek(p)=='*' ){
483483
re_append(p, RE_OP_ANYSTAR, 0);
484484
p->sIn.i++;
485
- }else{
485
+ }else{
486486
re_append(p, RE_OP_ANY, 0);
487487
}
488488
break;
489489
}
490490
case '*': {
@@ -652,11 +652,11 @@
652652
}
653653
654654
/* The following is a performance optimization. If the regex begins with
655655
** ".*" (if the input regex lacks an initial "^") and afterwards there are
656656
** one or more matching characters, enter those matching characters into
657
- ** zInit[]. The re_match() routine can then search ahead in the input
657
+ ** zInit[]. The re_match() routine can then search ahead in the input
658658
** string looking for the initial match without having to run the whole
659659
** regex engine over the string. Do not worry able trying to match
660660
** unicode characters beyond plane 0 - those are very rare and this is
661661
** just an optimization. */
662662
if( pRe->aOp[0]==RE_OP_ANYSTAR ){
@@ -689,12 +689,12 @@
689689
** A REGEXP B
690690
**
691691
** is implemented as regexp(B,A).
692692
*/
693693
static void re_sql_func(
694
- sqlite3_context *context,
695
- int argc,
694
+ sqlite3_context *context,
695
+ int argc,
696696
sqlite3_value **argv
697697
){
698698
ReCompiled *pRe; /* Compiled regular expression */
699699
const char *zPattern; /* The regular expression */
700700
const unsigned char *zStr;/* String being searched */
701701
--- src/regexp.c
+++ src/regexp.c
@@ -127,11 +127,11 @@
127 pSet->aState[pSet->nState++] = newState;
128 }
129
130 /* Extract the next unicode character from *pzIn and return it. Advance
131 ** *pzIn to the first byte past the end of the character returned. To
132 ** be clear: this routine converts utf8 to unicode. This routine is
133 ** optimized for the common case where the next character is a single byte.
134 */
135 static unsigned re_next_char(ReInput *p){
136 unsigned c;
137 if( p->i>=p->mx ) return 0;
@@ -191,16 +191,16 @@
191 int rc = 0;
192 ReInput in;
193
194 in.z = zIn;
195 in.i = 0;
196 in.mx = nIn>=0 ? nIn : strlen((char const*)zIn);
197
198 /* Look for the initial prefix match, if there is one. */
199 if( pRe->nInit ){
200 unsigned char x = pRe->zInit[0];
201 while( in.i+pRe->nInit<=in.mx
202 && (zIn[in.i]!=x ||
203 strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0)
204 ){
205 in.i++;
206 }
@@ -303,11 +303,11 @@
303 }
304 }
305 }
306 if( pRe->aOp[x]==RE_OP_CC_EXC ) hit = !hit;
307 if( hit ) re_add_state(pNext, x+n);
308 break;
309 }
310 }
311 }
312 }
313 for(i=0; i<pNext->nState; i++){
@@ -464,11 +464,11 @@
464 const char *zErr;
465 while( (c = p->xNextChar(&p->sIn))!=0 ){
466 iStart = p->nState;
467 switch( c ){
468 case '|':
469 case '$':
470 case ')': {
471 p->sIn.i--;
472 return 0;
473 }
474 case '(': {
@@ -480,11 +480,11 @@
480 }
481 case '.': {
482 if( rePeek(p)=='*' ){
483 re_append(p, RE_OP_ANYSTAR, 0);
484 p->sIn.i++;
485 }else{
486 re_append(p, RE_OP_ANY, 0);
487 }
488 break;
489 }
490 case '*': {
@@ -652,11 +652,11 @@
652 }
653
654 /* The following is a performance optimization. If the regex begins with
655 ** ".*" (if the input regex lacks an initial "^") and afterwards there are
656 ** one or more matching characters, enter those matching characters into
657 ** zInit[]. The re_match() routine can then search ahead in the input
658 ** string looking for the initial match without having to run the whole
659 ** regex engine over the string. Do not worry able trying to match
660 ** unicode characters beyond plane 0 - those are very rare and this is
661 ** just an optimization. */
662 if( pRe->aOp[0]==RE_OP_ANYSTAR ){
@@ -689,12 +689,12 @@
689 ** A REGEXP B
690 **
691 ** is implemented as regexp(B,A).
692 */
693 static void re_sql_func(
694 sqlite3_context *context,
695 int argc,
696 sqlite3_value **argv
697 ){
698 ReCompiled *pRe; /* Compiled regular expression */
699 const char *zPattern; /* The regular expression */
700 const unsigned char *zStr;/* String being searched */
701
--- src/regexp.c
+++ src/regexp.c
@@ -127,11 +127,11 @@
127 pSet->aState[pSet->nState++] = newState;
128 }
129
130 /* Extract the next unicode character from *pzIn and return it. Advance
131 ** *pzIn to the first byte past the end of the character returned. To
132 ** be clear: this routine converts utf8 to unicode. This routine is
133 ** optimized for the common case where the next character is a single byte.
134 */
135 static unsigned re_next_char(ReInput *p){
136 unsigned c;
137 if( p->i>=p->mx ) return 0;
@@ -191,16 +191,16 @@
191 int rc = 0;
192 ReInput in;
193
194 in.z = zIn;
195 in.i = 0;
196 in.mx = nIn>=0 ? nIn : strlen((const char*)zIn);
197
198 /* Look for the initial prefix match, if there is one. */
199 if( pRe->nInit ){
200 unsigned char x = pRe->zInit[0];
201 while( in.i+pRe->nInit<=in.mx
202 && (zIn[in.i]!=x ||
203 strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0)
204 ){
205 in.i++;
206 }
@@ -303,11 +303,11 @@
303 }
304 }
305 }
306 if( pRe->aOp[x]==RE_OP_CC_EXC ) hit = !hit;
307 if( hit ) re_add_state(pNext, x+n);
308 break;
309 }
310 }
311 }
312 }
313 for(i=0; i<pNext->nState; i++){
@@ -464,11 +464,11 @@
464 const char *zErr;
465 while( (c = p->xNextChar(&p->sIn))!=0 ){
466 iStart = p->nState;
467 switch( c ){
468 case '|':
469 case '$':
470 case ')': {
471 p->sIn.i--;
472 return 0;
473 }
474 case '(': {
@@ -480,11 +480,11 @@
480 }
481 case '.': {
482 if( rePeek(p)=='*' ){
483 re_append(p, RE_OP_ANYSTAR, 0);
484 p->sIn.i++;
485 }else{
486 re_append(p, RE_OP_ANY, 0);
487 }
488 break;
489 }
490 case '*': {
@@ -652,11 +652,11 @@
652 }
653
654 /* The following is a performance optimization. If the regex begins with
655 ** ".*" (if the input regex lacks an initial "^") and afterwards there are
656 ** one or more matching characters, enter those matching characters into
657 ** zInit[]. The re_match() routine can then search ahead in the input
658 ** string looking for the initial match without having to run the whole
659 ** regex engine over the string. Do not worry able trying to match
660 ** unicode characters beyond plane 0 - those are very rare and this is
661 ** just an optimization. */
662 if( pRe->aOp[0]==RE_OP_ANYSTAR ){
@@ -689,12 +689,12 @@
689 ** A REGEXP B
690 **
691 ** is implemented as regexp(B,A).
692 */
693 static void re_sql_func(
694 sqlite3_context *context,
695 int argc,
696 sqlite3_value **argv
697 ){
698 ReCompiled *pRe; /* Compiled regular expression */
699 const char *zPattern; /* The regular expression */
700 const unsigned char *zStr;/* String being searched */
701
+4 -4
--- src/setup.c
+++ src/setup.c
@@ -2138,14 +2138,14 @@
21382138
@ <th>User</th>
21392139
@ <th>Page</th>
21402140
@ <th width="60%%">Message</th>
21412141
@ </thead><tbody>
21422142
while( SQLITE_ROW == db_step(&stLog) ){
2143
- char const * zTime = db_column_text(&stLog, 0);
2144
- char const * zUser = db_column_text(&stLog, 1);
2145
- char const * zPage = db_column_text(&stLog, 2);
2146
- char const * zMessage = db_column_text(&stLog, 3);
2143
+ const char *zTime = db_column_text(&stLog, 0);
2144
+ const char *zUser = db_column_text(&stLog, 1);
2145
+ const char *zPage = db_column_text(&stLog, 2);
2146
+ const char *zMessage = db_column_text(&stLog, 3);
21472147
@ <tr class="row%d(counter++%2)">
21482148
@ <td class="adminTime">%s(zTime)</td>
21492149
@ <td>%s(zUser)</td>
21502150
@ <td>%s(zPage)</td>
21512151
@ <td>%h(zMessage)</td>
21522152
--- src/setup.c
+++ src/setup.c
@@ -2138,14 +2138,14 @@
2138 @ <th>User</th>
2139 @ <th>Page</th>
2140 @ <th width="60%%">Message</th>
2141 @ </thead><tbody>
2142 while( SQLITE_ROW == db_step(&stLog) ){
2143 char const * zTime = db_column_text(&stLog, 0);
2144 char const * zUser = db_column_text(&stLog, 1);
2145 char const * zPage = db_column_text(&stLog, 2);
2146 char const * zMessage = db_column_text(&stLog, 3);
2147 @ <tr class="row%d(counter++%2)">
2148 @ <td class="adminTime">%s(zTime)</td>
2149 @ <td>%s(zUser)</td>
2150 @ <td>%s(zPage)</td>
2151 @ <td>%h(zMessage)</td>
2152
--- src/setup.c
+++ src/setup.c
@@ -2138,14 +2138,14 @@
2138 @ <th>User</th>
2139 @ <th>Page</th>
2140 @ <th width="60%%">Message</th>
2141 @ </thead><tbody>
2142 while( SQLITE_ROW == db_step(&stLog) ){
2143 const char *zTime = db_column_text(&stLog, 0);
2144 const char *zUser = db_column_text(&stLog, 1);
2145 const char *zPage = db_column_text(&stLog, 2);
2146 const char *zMessage = db_column_text(&stLog, 3);
2147 @ <tr class="row%d(counter++%2)">
2148 @ <td class="adminTime">%s(zTime)</td>
2149 @ <td>%s(zUser)</td>
2150 @ <td>%s(zPage)</td>
2151 @ <td>%h(zMessage)</td>
2152
+7 -7
--- src/sha1.c
+++ src/sha1.c
@@ -64,11 +64,11 @@
6464
^block[(i+2)&15]^block[i&15],1))
6565
6666
/*
6767
* (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1
6868
*
69
- * Rl0() for little-endian and Rb0() for big-endian. Endianness is
69
+ * Rl0() for little-endian and Rb0() for big-endian. Endianness is
7070
* determined at run-time.
7171
*/
7272
#define Rl0(v,w,x,y,z,i) \
7373
z+=((w&(x^y))^y)+blk0le(i)+0x5A827999+rol(v,5);w=ror(w,2);
7474
#define Rb0(v,w,x,y,z,i) \
@@ -217,11 +217,11 @@
217217
** "unsigned char digest[20]" in the calling function. The SHA1
218218
** digest is stored in the first 20 bytes. zBuf should
219219
** be "char zBuf[41]".
220220
*/
221221
static void DigestToBase16(unsigned char *digest, char *zBuf){
222
- static char const zEncode[] = "0123456789abcdef";
222
+ static const char zEncode[] = "0123456789abcdef";
223223
int ix;
224224
225225
for(ix=0; ix<20; ix++){
226226
*zBuf++ = zEncode[(*digest>>4)&0xf];
227227
*zBuf++ = zEncode[*digest++ & 0xf];
@@ -258,11 +258,11 @@
258258
sha1sum_step_text(blob_buffer(p), blob_size(p));
259259
}
260260
261261
/*
262262
** Finish the incremental SHA1 checksum. Store the result in blob pOut
263
-** if pOut!=0. Also return a pointer to the result.
263
+** if pOut!=0. Also return a pointer to the result.
264264
**
265265
** This resets the incremental checksum preparing for the next round
266266
** of computation. The return pointer points to a static buffer that
267267
** is overwritten by subsequent calls to this function.
268268
*/
@@ -295,11 +295,11 @@
295295
296296
if( file_wd_islink(zFilename) ){
297297
/* Instead of file content, return sha1 of link destination path */
298298
Blob destinationPath;
299299
int rc;
300
-
300
+
301301
blob_read_link(&destinationPath, zFilename);
302302
rc = sha1sum_blob(&destinationPath, pCksum);
303303
blob_reset(&destinationPath);
304304
return rc;
305305
}
@@ -363,11 +363,11 @@
363363
return mprintf("%s", zDigest);
364364
}
365365
366366
/*
367367
** Convert a cleartext password for a specific user into a SHA1 hash.
368
-**
368
+**
369369
** The algorithm here is:
370370
**
371371
** SHA1( project-code + "/" + login + "/" + password )
372372
**
373373
** In words: The users login name and password are appended to the
@@ -375,11 +375,11 @@
375375
**
376376
** The result of this function is the shared secret used by a client
377377
** to authenticate to a server for the sync protocol. It is also the
378378
** value stored in the USER.PW field of the database. By mixing in the
379379
** login name and the project id with the hash, different shared secrets
380
-** are obtained even if two users select the same password, or if a
380
+** are obtained even if two users select the same password, or if a
381381
** single user selects the same password for multiple projects.
382382
*/
383383
char *sha1_shared_secret(
384384
const char *zPw, /* The password to encrypt */
385385
const char *zLogin, /* Username */
@@ -457,11 +457,11 @@
457457
*/
458458
void sha1sum_test(void){
459459
int i;
460460
Blob in;
461461
Blob cksum;
462
-
462
+
463463
for(i=2; i<g.argc; i++){
464464
blob_init(&cksum, "************** not found ***************", -1);
465465
if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
466466
blob_read_from_channel(&in, stdin, -1);
467467
sha1sum_blob(&in, &cksum);
468468
--- src/sha1.c
+++ src/sha1.c
@@ -64,11 +64,11 @@
64 ^block[(i+2)&15]^block[i&15],1))
65
66 /*
67 * (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1
68 *
69 * Rl0() for little-endian and Rb0() for big-endian. Endianness is
70 * determined at run-time.
71 */
72 #define Rl0(v,w,x,y,z,i) \
73 z+=((w&(x^y))^y)+blk0le(i)+0x5A827999+rol(v,5);w=ror(w,2);
74 #define Rb0(v,w,x,y,z,i) \
@@ -217,11 +217,11 @@
217 ** "unsigned char digest[20]" in the calling function. The SHA1
218 ** digest is stored in the first 20 bytes. zBuf should
219 ** be "char zBuf[41]".
220 */
221 static void DigestToBase16(unsigned char *digest, char *zBuf){
222 static char const zEncode[] = "0123456789abcdef";
223 int ix;
224
225 for(ix=0; ix<20; ix++){
226 *zBuf++ = zEncode[(*digest>>4)&0xf];
227 *zBuf++ = zEncode[*digest++ & 0xf];
@@ -258,11 +258,11 @@
258 sha1sum_step_text(blob_buffer(p), blob_size(p));
259 }
260
261 /*
262 ** Finish the incremental SHA1 checksum. Store the result in blob pOut
263 ** if pOut!=0. Also return a pointer to the result.
264 **
265 ** This resets the incremental checksum preparing for the next round
266 ** of computation. The return pointer points to a static buffer that
267 ** is overwritten by subsequent calls to this function.
268 */
@@ -295,11 +295,11 @@
295
296 if( file_wd_islink(zFilename) ){
297 /* Instead of file content, return sha1 of link destination path */
298 Blob destinationPath;
299 int rc;
300
301 blob_read_link(&destinationPath, zFilename);
302 rc = sha1sum_blob(&destinationPath, pCksum);
303 blob_reset(&destinationPath);
304 return rc;
305 }
@@ -363,11 +363,11 @@
363 return mprintf("%s", zDigest);
364 }
365
366 /*
367 ** Convert a cleartext password for a specific user into a SHA1 hash.
368 **
369 ** The algorithm here is:
370 **
371 ** SHA1( project-code + "/" + login + "/" + password )
372 **
373 ** In words: The users login name and password are appended to the
@@ -375,11 +375,11 @@
375 **
376 ** The result of this function is the shared secret used by a client
377 ** to authenticate to a server for the sync protocol. It is also the
378 ** value stored in the USER.PW field of the database. By mixing in the
379 ** login name and the project id with the hash, different shared secrets
380 ** are obtained even if two users select the same password, or if a
381 ** single user selects the same password for multiple projects.
382 */
383 char *sha1_shared_secret(
384 const char *zPw, /* The password to encrypt */
385 const char *zLogin, /* Username */
@@ -457,11 +457,11 @@
457 */
458 void sha1sum_test(void){
459 int i;
460 Blob in;
461 Blob cksum;
462
463 for(i=2; i<g.argc; i++){
464 blob_init(&cksum, "************** not found ***************", -1);
465 if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
466 blob_read_from_channel(&in, stdin, -1);
467 sha1sum_blob(&in, &cksum);
468
--- src/sha1.c
+++ src/sha1.c
@@ -64,11 +64,11 @@
64 ^block[(i+2)&15]^block[i&15],1))
65
66 /*
67 * (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1
68 *
69 * Rl0() for little-endian and Rb0() for big-endian. Endianness is
70 * determined at run-time.
71 */
72 #define Rl0(v,w,x,y,z,i) \
73 z+=((w&(x^y))^y)+blk0le(i)+0x5A827999+rol(v,5);w=ror(w,2);
74 #define Rb0(v,w,x,y,z,i) \
@@ -217,11 +217,11 @@
217 ** "unsigned char digest[20]" in the calling function. The SHA1
218 ** digest is stored in the first 20 bytes. zBuf should
219 ** be "char zBuf[41]".
220 */
221 static void DigestToBase16(unsigned char *digest, char *zBuf){
222 static const char zEncode[] = "0123456789abcdef";
223 int ix;
224
225 for(ix=0; ix<20; ix++){
226 *zBuf++ = zEncode[(*digest>>4)&0xf];
227 *zBuf++ = zEncode[*digest++ & 0xf];
@@ -258,11 +258,11 @@
258 sha1sum_step_text(blob_buffer(p), blob_size(p));
259 }
260
261 /*
262 ** Finish the incremental SHA1 checksum. Store the result in blob pOut
263 ** if pOut!=0. Also return a pointer to the result.
264 **
265 ** This resets the incremental checksum preparing for the next round
266 ** of computation. The return pointer points to a static buffer that
267 ** is overwritten by subsequent calls to this function.
268 */
@@ -295,11 +295,11 @@
295
296 if( file_wd_islink(zFilename) ){
297 /* Instead of file content, return sha1 of link destination path */
298 Blob destinationPath;
299 int rc;
300
301 blob_read_link(&destinationPath, zFilename);
302 rc = sha1sum_blob(&destinationPath, pCksum);
303 blob_reset(&destinationPath);
304 return rc;
305 }
@@ -363,11 +363,11 @@
363 return mprintf("%s", zDigest);
364 }
365
366 /*
367 ** Convert a cleartext password for a specific user into a SHA1 hash.
368 **
369 ** The algorithm here is:
370 **
371 ** SHA1( project-code + "/" + login + "/" + password )
372 **
373 ** In words: The users login name and password are appended to the
@@ -375,11 +375,11 @@
375 **
376 ** The result of this function is the shared secret used by a client
377 ** to authenticate to a server for the sync protocol. It is also the
378 ** value stored in the USER.PW field of the database. By mixing in the
379 ** login name and the project id with the hash, different shared secrets
380 ** are obtained even if two users select the same password, or if a
381 ** single user selects the same password for multiple projects.
382 */
383 char *sha1_shared_secret(
384 const char *zPw, /* The password to encrypt */
385 const char *zLogin, /* Username */
@@ -457,11 +457,11 @@
457 */
458 void sha1sum_test(void){
459 int i;
460 Blob in;
461 Blob cksum;
462
463 for(i=2; i<g.argc; i++){
464 blob_init(&cksum, "************** not found ***************", -1);
465 if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
466 blob_read_from_channel(&in, stdin, -1);
467 sha1sum_blob(&in, &cksum);
468
+2 -2
--- src/shell.c
+++ src/shell.c
@@ -111,15 +111,15 @@
111111
** to be disabled in some cases (ex: when generating CSV output and when
112112
** rendering quoted strings that contain \n characters). The following
113113
** routines take care of that.
114114
*/
115115
#if defined(_WIN32) || defined(WIN32)
116
-static setBinaryMode(FILE *out){
116
+static void setBinaryMode(FILE *out){
117117
fflush(out);
118118
_setmode(_fileno(out), _O_BINARY);
119119
}
120
-static setTextMode(FILE *out){
120
+static void setTextMode(FILE *out){
121121
fflush(out);
122122
_setmode(_fileno(out), _O_TEXT);
123123
}
124124
#else
125125
# define setBinaryMode(X)
126126
--- src/shell.c
+++ src/shell.c
@@ -111,15 +111,15 @@
111 ** to be disabled in some cases (ex: when generating CSV output and when
112 ** rendering quoted strings that contain \n characters). The following
113 ** routines take care of that.
114 */
115 #if defined(_WIN32) || defined(WIN32)
116 static setBinaryMode(FILE *out){
117 fflush(out);
118 _setmode(_fileno(out), _O_BINARY);
119 }
120 static setTextMode(FILE *out){
121 fflush(out);
122 _setmode(_fileno(out), _O_TEXT);
123 }
124 #else
125 # define setBinaryMode(X)
126
--- src/shell.c
+++ src/shell.c
@@ -111,15 +111,15 @@
111 ** to be disabled in some cases (ex: when generating CSV output and when
112 ** rendering quoted strings that contain \n characters). The following
113 ** routines take care of that.
114 */
115 #if defined(_WIN32) || defined(WIN32)
116 static void setBinaryMode(FILE *out){
117 fflush(out);
118 _setmode(_fileno(out), _O_BINARY);
119 }
120 static void setTextMode(FILE *out){
121 fflush(out);
122 _setmode(_fileno(out), _O_TEXT);
123 }
124 #else
125 # define setBinaryMode(X)
126
+2 -2
--- src/th_main.c
+++ src/th_main.c
@@ -391,15 +391,15 @@
391391
int argc,
392392
const char **argv,
393393
int *argl
394394
){
395395
int rc = 0;
396
- char const * zArg;
396
+ const char *zArg;
397397
if( argc!=2 ){
398398
return Th_WrongNumArgs(interp, "hasfeature STRING");
399399
}
400
- zArg = (char const*)argv[1];
400
+ zArg = (const char *)argv[1];
401401
if(NULL==zArg){
402402
/* placeholder for following ifdefs... */
403403
}
404404
#if defined(FOSSIL_ENABLE_SSL)
405405
else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){
406406
--- src/th_main.c
+++ src/th_main.c
@@ -391,15 +391,15 @@
391 int argc,
392 const char **argv,
393 int *argl
394 ){
395 int rc = 0;
396 char const * zArg;
397 if( argc!=2 ){
398 return Th_WrongNumArgs(interp, "hasfeature STRING");
399 }
400 zArg = (char const*)argv[1];
401 if(NULL==zArg){
402 /* placeholder for following ifdefs... */
403 }
404 #if defined(FOSSIL_ENABLE_SSL)
405 else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){
406
--- src/th_main.c
+++ src/th_main.c
@@ -391,15 +391,15 @@
391 int argc,
392 const char **argv,
393 int *argl
394 ){
395 int rc = 0;
396 const char *zArg;
397 if( argc!=2 ){
398 return Th_WrongNumArgs(interp, "hasfeature STRING");
399 }
400 zArg = (const char *)argv[1];
401 if(NULL==zArg){
402 /* placeholder for following ifdefs... */
403 }
404 #if defined(FOSSIL_ENABLE_SSL)
405 else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){
406

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button