Fossil SCM
Minor compiler warning in shell.c (already fixed in SQLite). "char const" -> "const char" for consistancy.
Commit
5330d107b25626e1441fab860bcd9b0f331557ec
Parent
6115de1504137b9…
9 files changed
+4
-4
+6
-6
+1
-1
+5
-5
+9
-9
+4
-4
+7
-7
+2
-2
+2
-2
M
src/db.c
+4
-4
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -770,12 +770,12 @@ | ||
| 770 | 770 | void db_sym2rid_function( |
| 771 | 771 | sqlite3_context *context, |
| 772 | 772 | int argc, |
| 773 | 773 | sqlite3_value **argv |
| 774 | 774 | ){ |
| 775 | - char const * arg; | |
| 776 | - char const * type; | |
| 775 | + const char *arg; | |
| 776 | + const char *type; | |
| 777 | 777 | if(1 != argc && 2 != argc){ |
| 778 | 778 | sqlite3_result_error(context, "Expecting one or two arguments", -1); |
| 779 | 779 | return; |
| 780 | 780 | } |
| 781 | 781 | arg = (const char*)sqlite3_value_text(argv[0]); |
| @@ -1181,11 +1181,11 @@ | ||
| 1181 | 1181 | |
| 1182 | 1182 | /* Verify that the PLINK table has a new column added by the |
| 1183 | 1183 | ** 2014-11-28 schema change. Create it if necessary. This code |
| 1184 | 1184 | ** can be removed in the future, once all users have upgraded to the |
| 1185 | 1185 | ** 2014-11-28 or later schema. |
| 1186 | - */ | |
| 1186 | + */ | |
| 1187 | 1187 | if( !db_table_has_column("repository","plink","baseid") ){ |
| 1188 | 1188 | db_multi_exec( |
| 1189 | 1189 | "ALTER TABLE %s.plink ADD COLUMN baseid;", db_name("repository") |
| 1190 | 1190 | ); |
| 1191 | 1191 | } |
| @@ -1192,11 +1192,11 @@ | ||
| 1192 | 1192 | |
| 1193 | 1193 | /* Verify that the MLINK table has the newer columns added by the |
| 1194 | 1194 | ** 2015-01-24 schema change. Create them if necessary. This code |
| 1195 | 1195 | ** can be removed in the future, once all users have upgraded to the |
| 1196 | 1196 | ** 2015-01-24 or later schema. |
| 1197 | - */ | |
| 1197 | + */ | |
| 1198 | 1198 | if( !db_table_has_column("repository","mlink","isaux") ){ |
| 1199 | 1199 | db_begin_transaction(); |
| 1200 | 1200 | db_multi_exec( |
| 1201 | 1201 | "ALTER TABLE %s.mlink ADD COLUMN pmid INTEGER DEFAULT 0;" |
| 1202 | 1202 | "ALTER TABLE %s.mlink ADD COLUMN isaux INTEGER DEFAULT 0;", |
| 1203 | 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 | 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 @@ | ||
| 155 | 155 | blob_reset(&x); |
| 156 | 156 | return ( c!='n' && c!='N' ); |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /* |
| 160 | -** Get the HTTP Basic Authorization credentials from the user | |
| 160 | +** Get the HTTP Basic Authorization credentials from the user | |
| 161 | 161 | ** when 401 is received. |
| 162 | 162 | */ |
| 163 | 163 | char *prompt_for_httpauth_creds(void){ |
| 164 | 164 | Blob x; |
| 165 | 165 | char *zUser; |
| @@ -266,11 +266,11 @@ | ||
| 266 | 266 | transport_send(&g.url, &hdr); |
| 267 | 267 | transport_send(&g.url, &payload); |
| 268 | 268 | blob_reset(&hdr); |
| 269 | 269 | blob_reset(&payload); |
| 270 | 270 | transport_flip(&g.url); |
| 271 | - | |
| 271 | + | |
| 272 | 272 | /* |
| 273 | 273 | ** Read and interpret the server reply |
| 274 | 274 | */ |
| 275 | 275 | closeConnection = 1; |
| 276 | 276 | iLength = -1; |
| @@ -333,11 +333,11 @@ | ||
| 333 | 333 | for(i=9; zLine[i] && zLine[i]==' '; i++){} |
| 334 | 334 | if( zLine[i]==0 ){ |
| 335 | 335 | fossil_warning("malformed redirect: %s", zLine); |
| 336 | 336 | goto write_err; |
| 337 | 337 | } |
| 338 | - j = strlen(zLine) - 1; | |
| 338 | + j = strlen(zLine) - 1; | |
| 339 | 339 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 340 | 340 | j -= 4; |
| 341 | 341 | zLine[j] = 0; |
| 342 | 342 | } |
| 343 | 343 | transport_close(&g.url); |
| @@ -349,11 +349,11 @@ | ||
| 349 | 349 | g.zHttpAuth = get_httpauth(); |
| 350 | 350 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 351 | 351 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 352 | 352 | if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){ |
| 353 | 353 | isCompressed = 0; |
| 354 | - }else if( fossil_strnicmp(&zLine[14], | |
| 354 | + }else if( fossil_strnicmp(&zLine[14], | |
| 355 | 355 | "application/x-fossil-uncompressed", -1)==0 ){ |
| 356 | 356 | isCompressed = 0; |
| 357 | 357 | }else if( fossil_strnicmp(&zLine[14], "application/x-fossil", -1)!=0 ){ |
| 358 | 358 | isError = 1; |
| 359 | 359 | } |
| @@ -411,12 +411,12 @@ | ||
| 411 | 411 | }else{ |
| 412 | 412 | transport_rewind(&g.url); |
| 413 | 413 | } |
| 414 | 414 | return 0; |
| 415 | 415 | |
| 416 | - /* | |
| 416 | + /* | |
| 417 | 417 | ** Jump to here if an error is seen. |
| 418 | 418 | */ |
| 419 | 419 | write_err: |
| 420 | 420 | transport_close(&g.url); |
| 421 | - return 1; | |
| 421 | + return 1; | |
| 422 | 422 | } |
| 423 | 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.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 |
+1
-1
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -87,11 +87,11 @@ | ||
| 87 | 87 | |
| 88 | 88 | /* |
| 89 | 89 | ** SSH initialization of the transport layer |
| 90 | 90 | */ |
| 91 | 91 | 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 | |
| 93 | 93 | ** to talk to the remote machine. |
| 94 | 94 | */ |
| 95 | 95 | const char *zSsh; /* The base SSH command */ |
| 96 | 96 | Blob zCmd; /* The SSH command */ |
| 97 | 97 | char *zHost; /* The host name to contact */ |
| 98 | 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 |
| --- 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 @@ | ||
| 177 | 177 | |
| 178 | 178 | /* |
| 179 | 179 | * Update context to reflect the concatenation of another buffer full |
| 180 | 180 | * of bytes. |
| 181 | 181 | */ |
| 182 | -static | |
| 182 | +static | |
| 183 | 183 | void MD5Update(MD5Context *pCtx, const unsigned char *buf, unsigned int len){ |
| 184 | 184 | struct Context *ctx = (struct Context *)pCtx; |
| 185 | 185 | uint32 t; |
| 186 | 186 | |
| 187 | 187 | /* Update bitcount */ |
| @@ -224,11 +224,11 @@ | ||
| 224 | 224 | |
| 225 | 225 | memcpy(ctx->in, buf, len); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /* |
| 229 | - * Final wrapup - pad to 64-byte boundary with the bit pattern | |
| 229 | + * Final wrapup - pad to 64-byte boundary with the bit pattern | |
| 230 | 230 | * 1 0* (64-bit count of bits processed, MSB-first) |
| 231 | 231 | */ |
| 232 | 232 | static void MD5Final(unsigned char digest[16], MD5Context *pCtx){ |
| 233 | 233 | struct Context *ctx = (struct Context *)pCtx; |
| 234 | 234 | unsigned count; |
| @@ -274,11 +274,11 @@ | ||
| 274 | 274 | ** "unsigned char digest[16]" in the calling function. The MD5 |
| 275 | 275 | ** digest is stored in the first 16 bytes. zBuf should |
| 276 | 276 | ** be "char zBuf[33]". |
| 277 | 277 | */ |
| 278 | 278 | static void DigestToBase16(unsigned char *digest, char *zBuf){ |
| 279 | - static char const zEncode[] = "0123456789abcdef"; | |
| 279 | + static const char zEncode[] = "0123456789abcdef"; | |
| 280 | 280 | int i, j; |
| 281 | 281 | |
| 282 | 282 | for(j=i=0; i<16; i++){ |
| 283 | 283 | int a = digest[i]; |
| 284 | 284 | zBuf[j++] = zEncode[(a>>4)&0xf]; |
| @@ -343,11 +343,11 @@ | ||
| 343 | 343 | return zResult; |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /* |
| 347 | 347 | ** 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. | |
| 349 | 349 | ** |
| 350 | 350 | ** This resets the incremental checksum preparing for the next round |
| 351 | 351 | ** of computation. The return pointer points to a static buffer that |
| 352 | 352 | ** is overwritten by subsequent calls to this function. |
| 353 | 353 | */ |
| @@ -431,11 +431,11 @@ | ||
| 431 | 431 | */ |
| 432 | 432 | void md5sum_test(void){ |
| 433 | 433 | int i; |
| 434 | 434 | Blob in; |
| 435 | 435 | Blob cksum; |
| 436 | - | |
| 436 | + | |
| 437 | 437 | for(i=2; i<g.argc; i++){ |
| 438 | 438 | blob_init(&cksum, "********** not found ***********", -1); |
| 439 | 439 | if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){ |
| 440 | 440 | blob_read_from_channel(&in, stdin, -1); |
| 441 | 441 | md5sum_blob(&in, &cksum); |
| 442 | 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 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 @@ | ||
| 127 | 127 | pSet->aState[pSet->nState++] = newState; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /* Extract the next unicode character from *pzIn and return it. Advance |
| 131 | 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 | |
| 132 | +** be clear: this routine converts utf8 to unicode. This routine is | |
| 133 | 133 | ** optimized for the common case where the next character is a single byte. |
| 134 | 134 | */ |
| 135 | 135 | static unsigned re_next_char(ReInput *p){ |
| 136 | 136 | unsigned c; |
| 137 | 137 | if( p->i>=p->mx ) return 0; |
| @@ -191,16 +191,16 @@ | ||
| 191 | 191 | int rc = 0; |
| 192 | 192 | ReInput in; |
| 193 | 193 | |
| 194 | 194 | in.z = zIn; |
| 195 | 195 | in.i = 0; |
| 196 | - in.mx = nIn>=0 ? nIn : strlen((char const*)zIn); | |
| 196 | + in.mx = nIn>=0 ? nIn : strlen((const char*)zIn); | |
| 197 | 197 | |
| 198 | 198 | /* Look for the initial prefix match, if there is one. */ |
| 199 | 199 | if( pRe->nInit ){ |
| 200 | 200 | unsigned char x = pRe->zInit[0]; |
| 201 | - while( in.i+pRe->nInit<=in.mx | |
| 201 | + while( in.i+pRe->nInit<=in.mx | |
| 202 | 202 | && (zIn[in.i]!=x || |
| 203 | 203 | strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0) |
| 204 | 204 | ){ |
| 205 | 205 | in.i++; |
| 206 | 206 | } |
| @@ -303,11 +303,11 @@ | ||
| 303 | 303 | } |
| 304 | 304 | } |
| 305 | 305 | } |
| 306 | 306 | if( pRe->aOp[x]==RE_OP_CC_EXC ) hit = !hit; |
| 307 | 307 | if( hit ) re_add_state(pNext, x+n); |
| 308 | - break; | |
| 308 | + break; | |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | for(i=0; i<pNext->nState; i++){ |
| @@ -464,11 +464,11 @@ | ||
| 464 | 464 | const char *zErr; |
| 465 | 465 | while( (c = p->xNextChar(&p->sIn))!=0 ){ |
| 466 | 466 | iStart = p->nState; |
| 467 | 467 | switch( c ){ |
| 468 | 468 | case '|': |
| 469 | - case '$': | |
| 469 | + case '$': | |
| 470 | 470 | case ')': { |
| 471 | 471 | p->sIn.i--; |
| 472 | 472 | return 0; |
| 473 | 473 | } |
| 474 | 474 | case '(': { |
| @@ -480,11 +480,11 @@ | ||
| 480 | 480 | } |
| 481 | 481 | case '.': { |
| 482 | 482 | if( rePeek(p)=='*' ){ |
| 483 | 483 | re_append(p, RE_OP_ANYSTAR, 0); |
| 484 | 484 | p->sIn.i++; |
| 485 | - }else{ | |
| 485 | + }else{ | |
| 486 | 486 | re_append(p, RE_OP_ANY, 0); |
| 487 | 487 | } |
| 488 | 488 | break; |
| 489 | 489 | } |
| 490 | 490 | case '*': { |
| @@ -652,11 +652,11 @@ | ||
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 | /* The following is a performance optimization. If the regex begins with |
| 655 | 655 | ** ".*" (if the input regex lacks an initial "^") and afterwards there are |
| 656 | 656 | ** 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 | |
| 658 | 658 | ** string looking for the initial match without having to run the whole |
| 659 | 659 | ** regex engine over the string. Do not worry able trying to match |
| 660 | 660 | ** unicode characters beyond plane 0 - those are very rare and this is |
| 661 | 661 | ** just an optimization. */ |
| 662 | 662 | if( pRe->aOp[0]==RE_OP_ANYSTAR ){ |
| @@ -689,12 +689,12 @@ | ||
| 689 | 689 | ** A REGEXP B |
| 690 | 690 | ** |
| 691 | 691 | ** is implemented as regexp(B,A). |
| 692 | 692 | */ |
| 693 | 693 | static void re_sql_func( |
| 694 | - sqlite3_context *context, | |
| 695 | - int argc, | |
| 694 | + sqlite3_context *context, | |
| 695 | + int argc, | |
| 696 | 696 | sqlite3_value **argv |
| 697 | 697 | ){ |
| 698 | 698 | ReCompiled *pRe; /* Compiled regular expression */ |
| 699 | 699 | const char *zPattern; /* The regular expression */ |
| 700 | 700 | const unsigned char *zStr;/* String being searched */ |
| 701 | 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((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 @@ | ||
| 2138 | 2138 | @ <th>User</th> |
| 2139 | 2139 | @ <th>Page</th> |
| 2140 | 2140 | @ <th width="60%%">Message</th> |
| 2141 | 2141 | @ </thead><tbody> |
| 2142 | 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); | |
| 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 | 2147 | @ <tr class="row%d(counter++%2)"> |
| 2148 | 2148 | @ <td class="adminTime">%s(zTime)</td> |
| 2149 | 2149 | @ <td>%s(zUser)</td> |
| 2150 | 2150 | @ <td>%s(zPage)</td> |
| 2151 | 2151 | @ <td>%h(zMessage)</td> |
| 2152 | 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 | 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 @@ | ||
| 64 | 64 | ^block[(i+2)&15]^block[i&15],1)) |
| 65 | 65 | |
| 66 | 66 | /* |
| 67 | 67 | * (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1 |
| 68 | 68 | * |
| 69 | - * Rl0() for little-endian and Rb0() for big-endian. Endianness is | |
| 69 | + * Rl0() for little-endian and Rb0() for big-endian. Endianness is | |
| 70 | 70 | * determined at run-time. |
| 71 | 71 | */ |
| 72 | 72 | #define Rl0(v,w,x,y,z,i) \ |
| 73 | 73 | z+=((w&(x^y))^y)+blk0le(i)+0x5A827999+rol(v,5);w=ror(w,2); |
| 74 | 74 | #define Rb0(v,w,x,y,z,i) \ |
| @@ -217,11 +217,11 @@ | ||
| 217 | 217 | ** "unsigned char digest[20]" in the calling function. The SHA1 |
| 218 | 218 | ** digest is stored in the first 20 bytes. zBuf should |
| 219 | 219 | ** be "char zBuf[41]". |
| 220 | 220 | */ |
| 221 | 221 | static void DigestToBase16(unsigned char *digest, char *zBuf){ |
| 222 | - static char const zEncode[] = "0123456789abcdef"; | |
| 222 | + static const char zEncode[] = "0123456789abcdef"; | |
| 223 | 223 | int ix; |
| 224 | 224 | |
| 225 | 225 | for(ix=0; ix<20; ix++){ |
| 226 | 226 | *zBuf++ = zEncode[(*digest>>4)&0xf]; |
| 227 | 227 | *zBuf++ = zEncode[*digest++ & 0xf]; |
| @@ -258,11 +258,11 @@ | ||
| 258 | 258 | sha1sum_step_text(blob_buffer(p), blob_size(p)); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /* |
| 262 | 262 | ** 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. | |
| 264 | 264 | ** |
| 265 | 265 | ** This resets the incremental checksum preparing for the next round |
| 266 | 266 | ** of computation. The return pointer points to a static buffer that |
| 267 | 267 | ** is overwritten by subsequent calls to this function. |
| 268 | 268 | */ |
| @@ -295,11 +295,11 @@ | ||
| 295 | 295 | |
| 296 | 296 | if( file_wd_islink(zFilename) ){ |
| 297 | 297 | /* Instead of file content, return sha1 of link destination path */ |
| 298 | 298 | Blob destinationPath; |
| 299 | 299 | int rc; |
| 300 | - | |
| 300 | + | |
| 301 | 301 | blob_read_link(&destinationPath, zFilename); |
| 302 | 302 | rc = sha1sum_blob(&destinationPath, pCksum); |
| 303 | 303 | blob_reset(&destinationPath); |
| 304 | 304 | return rc; |
| 305 | 305 | } |
| @@ -363,11 +363,11 @@ | ||
| 363 | 363 | return mprintf("%s", zDigest); |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | /* |
| 367 | 367 | ** Convert a cleartext password for a specific user into a SHA1 hash. |
| 368 | -** | |
| 368 | +** | |
| 369 | 369 | ** The algorithm here is: |
| 370 | 370 | ** |
| 371 | 371 | ** SHA1( project-code + "/" + login + "/" + password ) |
| 372 | 372 | ** |
| 373 | 373 | ** In words: The users login name and password are appended to the |
| @@ -375,11 +375,11 @@ | ||
| 375 | 375 | ** |
| 376 | 376 | ** The result of this function is the shared secret used by a client |
| 377 | 377 | ** to authenticate to a server for the sync protocol. It is also the |
| 378 | 378 | ** value stored in the USER.PW field of the database. By mixing in the |
| 379 | 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 | |
| 380 | +** are obtained even if two users select the same password, or if a | |
| 381 | 381 | ** single user selects the same password for multiple projects. |
| 382 | 382 | */ |
| 383 | 383 | char *sha1_shared_secret( |
| 384 | 384 | const char *zPw, /* The password to encrypt */ |
| 385 | 385 | const char *zLogin, /* Username */ |
| @@ -457,11 +457,11 @@ | ||
| 457 | 457 | */ |
| 458 | 458 | void sha1sum_test(void){ |
| 459 | 459 | int i; |
| 460 | 460 | Blob in; |
| 461 | 461 | Blob cksum; |
| 462 | - | |
| 462 | + | |
| 463 | 463 | for(i=2; i<g.argc; i++){ |
| 464 | 464 | blob_init(&cksum, "************** not found ***************", -1); |
| 465 | 465 | if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){ |
| 466 | 466 | blob_read_from_channel(&in, stdin, -1); |
| 467 | 467 | sha1sum_blob(&in, &cksum); |
| 468 | 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 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 @@ | ||
| 111 | 111 | ** to be disabled in some cases (ex: when generating CSV output and when |
| 112 | 112 | ** rendering quoted strings that contain \n characters). The following |
| 113 | 113 | ** routines take care of that. |
| 114 | 114 | */ |
| 115 | 115 | #if defined(_WIN32) || defined(WIN32) |
| 116 | -static setBinaryMode(FILE *out){ | |
| 116 | +static void setBinaryMode(FILE *out){ | |
| 117 | 117 | fflush(out); |
| 118 | 118 | _setmode(_fileno(out), _O_BINARY); |
| 119 | 119 | } |
| 120 | -static setTextMode(FILE *out){ | |
| 120 | +static void setTextMode(FILE *out){ | |
| 121 | 121 | fflush(out); |
| 122 | 122 | _setmode(_fileno(out), _O_TEXT); |
| 123 | 123 | } |
| 124 | 124 | #else |
| 125 | 125 | # define setBinaryMode(X) |
| 126 | 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 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 @@ | ||
| 391 | 391 | int argc, |
| 392 | 392 | const char **argv, |
| 393 | 393 | int *argl |
| 394 | 394 | ){ |
| 395 | 395 | int rc = 0; |
| 396 | - char const * zArg; | |
| 396 | + const char *zArg; | |
| 397 | 397 | if( argc!=2 ){ |
| 398 | 398 | return Th_WrongNumArgs(interp, "hasfeature STRING"); |
| 399 | 399 | } |
| 400 | - zArg = (char const*)argv[1]; | |
| 400 | + zArg = (const char *)argv[1]; | |
| 401 | 401 | if(NULL==zArg){ |
| 402 | 402 | /* placeholder for following ifdefs... */ |
| 403 | 403 | } |
| 404 | 404 | #if defined(FOSSIL_ENABLE_SSL) |
| 405 | 405 | else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){ |
| 406 | 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 | 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 |