Fossil SCM
unused variable includeDotFiles <p>struct utimbuf -> struct _utimbuf (compiler warning with mingw-w64) <p>a few "const" additions (lower memory footprint, allows C-compiler to optimize better)
Commit
6032dd51f2bca8f714a4b499888707fed9a4123d
Parent
7097562813f763f…
8 files changed
+2
-8
+2
-2
+2
-2
+2
-2
+1
-1
+1
-1
+1
-1
+1
-1
+2
-8
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -21,16 +21,10 @@ | ||
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "add.h" |
| 23 | 23 | #include <assert.h> |
| 24 | 24 | #include <dirent.h> |
| 25 | 25 | |
| 26 | -/* | |
| 27 | -** Set to true if files whose names begin with "." should be | |
| 28 | -** included when processing a recursive "add" command. | |
| 29 | -*/ | |
| 30 | -static int includeDotFiles = 0; | |
| 31 | - | |
| 32 | 26 | /* |
| 33 | 27 | ** This routine returns the names of files in a working checkout that |
| 34 | 28 | ** are created by Fossil itself, and hence should not be added, deleted, |
| 35 | 29 | ** or merge, and should be omitted from "clean" and "extra" lists. |
| 36 | 30 | ** |
| @@ -39,11 +33,11 @@ | ||
| 39 | 33 | */ |
| 40 | 34 | const char *fossil_reserved_name(int N){ |
| 41 | 35 | /* Possible names of the local per-checkout database file and |
| 42 | 36 | ** its associated journals |
| 43 | 37 | */ |
| 44 | - static const char *azName[] = { | |
| 38 | + static const char *const azName[] = { | |
| 45 | 39 | "_FOSSIL_", |
| 46 | 40 | "_FOSSIL_-journal", |
| 47 | 41 | "_FOSSIL_-wal", |
| 48 | 42 | "_FOSSIL_-shm", |
| 49 | 43 | ".fslckout", |
| @@ -61,11 +55,11 @@ | ||
| 61 | 55 | }; |
| 62 | 56 | |
| 63 | 57 | /* Names of auxiliary files generated by SQLite when the "manifest" |
| 64 | 58 | ** properity is enabled |
| 65 | 59 | */ |
| 66 | - static const char *azManifest[] = { | |
| 60 | + static const char *const azManifest[] = { | |
| 67 | 61 | "manifest", |
| 68 | 62 | "manifest.uuid", |
| 69 | 63 | }; |
| 70 | 64 | |
| 71 | 65 | /* Cached setting "manifest" */ |
| 72 | 66 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -21,16 +21,10 @@ | |
| 21 | #include "config.h" |
| 22 | #include "add.h" |
| 23 | #include <assert.h> |
| 24 | #include <dirent.h> |
| 25 | |
| 26 | /* |
| 27 | ** Set to true if files whose names begin with "." should be |
| 28 | ** included when processing a recursive "add" command. |
| 29 | */ |
| 30 | static int includeDotFiles = 0; |
| 31 | |
| 32 | /* |
| 33 | ** This routine returns the names of files in a working checkout that |
| 34 | ** are created by Fossil itself, and hence should not be added, deleted, |
| 35 | ** or merge, and should be omitted from "clean" and "extra" lists. |
| 36 | ** |
| @@ -39,11 +33,11 @@ | |
| 39 | */ |
| 40 | const char *fossil_reserved_name(int N){ |
| 41 | /* Possible names of the local per-checkout database file and |
| 42 | ** its associated journals |
| 43 | */ |
| 44 | static const char *azName[] = { |
| 45 | "_FOSSIL_", |
| 46 | "_FOSSIL_-journal", |
| 47 | "_FOSSIL_-wal", |
| 48 | "_FOSSIL_-shm", |
| 49 | ".fslckout", |
| @@ -61,11 +55,11 @@ | |
| 61 | }; |
| 62 | |
| 63 | /* Names of auxiliary files generated by SQLite when the "manifest" |
| 64 | ** properity is enabled |
| 65 | */ |
| 66 | static const char *azManifest[] = { |
| 67 | "manifest", |
| 68 | "manifest.uuid", |
| 69 | }; |
| 70 | |
| 71 | /* Cached setting "manifest" */ |
| 72 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -21,16 +21,10 @@ | |
| 21 | #include "config.h" |
| 22 | #include "add.h" |
| 23 | #include <assert.h> |
| 24 | #include <dirent.h> |
| 25 | |
| 26 | /* |
| 27 | ** This routine returns the names of files in a working checkout that |
| 28 | ** are created by Fossil itself, and hence should not be added, deleted, |
| 29 | ** or merge, and should be omitted from "clean" and "extra" lists. |
| 30 | ** |
| @@ -39,11 +33,11 @@ | |
| 33 | */ |
| 34 | const char *fossil_reserved_name(int N){ |
| 35 | /* Possible names of the local per-checkout database file and |
| 36 | ** its associated journals |
| 37 | */ |
| 38 | static const char *const azName[] = { |
| 39 | "_FOSSIL_", |
| 40 | "_FOSSIL_-journal", |
| 41 | "_FOSSIL_-wal", |
| 42 | "_FOSSIL_-shm", |
| 43 | ".fslckout", |
| @@ -61,11 +55,11 @@ | |
| 55 | }; |
| 56 | |
| 57 | /* Names of auxiliary files generated by SQLite when the "manifest" |
| 58 | ** properity is enabled |
| 59 | */ |
| 60 | static const char *const azManifest[] = { |
| 61 | "manifest", |
| 62 | "manifest.uuid", |
| 63 | }; |
| 64 | |
| 65 | /* Cached setting "manifest" */ |
| 66 |
+2
-2
| --- src/captcha.c | ||
| +++ src/captcha.c | ||
| @@ -98,11 +98,11 @@ | ||
| 98 | 98 | } |
| 99 | 99 | #endif /* CAPTCHA==1 */ |
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | #if CAPTCHA==2 |
| 103 | -static const char *azFont2[] = { | |
| 103 | +static const char *const azFont2[] = { | |
| 104 | 104 | /* 0 */ |
| 105 | 105 | " __ ", |
| 106 | 106 | " / \\ ", |
| 107 | 107 | "| () |", |
| 108 | 108 | " \\__/ ", |
| @@ -223,11 +223,11 @@ | ||
| 223 | 223 | return z; |
| 224 | 224 | } |
| 225 | 225 | #endif /* CAPTCHA==2 */ |
| 226 | 226 | |
| 227 | 227 | #if CAPTCHA==3 |
| 228 | -static const char *azFont3[] = { | |
| 228 | +static const char *const azFont3[] = { | |
| 229 | 229 | /* 0 */ |
| 230 | 230 | " ___ ", |
| 231 | 231 | " / _ \\ ", |
| 232 | 232 | "| | | |", |
| 233 | 233 | "| | | |", |
| 234 | 234 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -98,11 +98,11 @@ | |
| 98 | } |
| 99 | #endif /* CAPTCHA==1 */ |
| 100 | |
| 101 | |
| 102 | #if CAPTCHA==2 |
| 103 | static const char *azFont2[] = { |
| 104 | /* 0 */ |
| 105 | " __ ", |
| 106 | " / \\ ", |
| 107 | "| () |", |
| 108 | " \\__/ ", |
| @@ -223,11 +223,11 @@ | |
| 223 | return z; |
| 224 | } |
| 225 | #endif /* CAPTCHA==2 */ |
| 226 | |
| 227 | #if CAPTCHA==3 |
| 228 | static const char *azFont3[] = { |
| 229 | /* 0 */ |
| 230 | " ___ ", |
| 231 | " / _ \\ ", |
| 232 | "| | | |", |
| 233 | "| | | |", |
| 234 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -98,11 +98,11 @@ | |
| 98 | } |
| 99 | #endif /* CAPTCHA==1 */ |
| 100 | |
| 101 | |
| 102 | #if CAPTCHA==2 |
| 103 | static const char *const azFont2[] = { |
| 104 | /* 0 */ |
| 105 | " __ ", |
| 106 | " / \\ ", |
| 107 | "| () |", |
| 108 | " \\__/ ", |
| @@ -223,11 +223,11 @@ | |
| 223 | return z; |
| 224 | } |
| 225 | #endif /* CAPTCHA==2 */ |
| 226 | |
| 227 | #if CAPTCHA==3 |
| 228 | static const char *const azFont3[] = { |
| 229 | /* 0 */ |
| 230 | " ___ ", |
| 231 | " / _ \\ ", |
| 232 | "| | | |", |
| 233 | "| | | |", |
| 234 |
+2
-2
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1354,13 +1354,13 @@ | ||
| 1354 | 1354 | |
| 1355 | 1355 | |
| 1356 | 1356 | /* |
| 1357 | 1357 | ** Name of days and months. |
| 1358 | 1358 | */ |
| 1359 | -static const char *azDays[] = | |
| 1359 | +static const char *const azDays[] = | |
| 1360 | 1360 | {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", 0}; |
| 1361 | -static const char *azMonths[] = | |
| 1361 | +static const char *const azMonths[] = | |
| 1362 | 1362 | {"Jan", "Feb", "Mar", "Apr", "May", "Jun", |
| 1363 | 1363 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", 0}; |
| 1364 | 1364 | |
| 1365 | 1365 | |
| 1366 | 1366 | /* |
| 1367 | 1367 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1354,13 +1354,13 @@ | |
| 1354 | |
| 1355 | |
| 1356 | /* |
| 1357 | ** Name of days and months. |
| 1358 | */ |
| 1359 | static const char *azDays[] = |
| 1360 | {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", 0}; |
| 1361 | static const char *azMonths[] = |
| 1362 | {"Jan", "Feb", "Mar", "Apr", "May", "Jun", |
| 1363 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", 0}; |
| 1364 | |
| 1365 | |
| 1366 | /* |
| 1367 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1354,13 +1354,13 @@ | |
| 1354 | |
| 1355 | |
| 1356 | /* |
| 1357 | ** Name of days and months. |
| 1358 | */ |
| 1359 | static const char *const azDays[] = |
| 1360 | {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", 0}; |
| 1361 | static const char *const azMonths[] = |
| 1362 | {"Jan", "Feb", "Mar", "Apr", "May", "Jun", |
| 1363 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", 0}; |
| 1364 | |
| 1365 | |
| 1366 | /* |
| 1367 |
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1609,19 +1609,19 @@ | ||
| 1609 | 1609 | |
| 1610 | 1610 | /* |
| 1611 | 1611 | ** Return true if the string zVal represents "true" (or "false"). |
| 1612 | 1612 | */ |
| 1613 | 1613 | int is_truth(const char *zVal){ |
| 1614 | - static const char *azOn[] = { "on", "yes", "true", "1" }; | |
| 1614 | + static const char *const azOn[] = { "on", "yes", "true", "1" }; | |
| 1615 | 1615 | int i; |
| 1616 | 1616 | for(i=0; i<sizeof(azOn)/sizeof(azOn[0]); i++){ |
| 1617 | 1617 | if( fossil_stricmp(zVal,azOn[i])==0 ) return 1; |
| 1618 | 1618 | } |
| 1619 | 1619 | return 0; |
| 1620 | 1620 | } |
| 1621 | 1621 | int is_false(const char *zVal){ |
| 1622 | - static const char *azOff[] = { "off", "no", "false", "0" }; | |
| 1622 | + static const char *const azOff[] = { "off", "no", "false", "0" }; | |
| 1623 | 1623 | int i; |
| 1624 | 1624 | for(i=0; i<sizeof(azOff)/sizeof(azOff[0]); i++){ |
| 1625 | 1625 | if( fossil_stricmp(zVal,azOff[i])==0 ) return 1; |
| 1626 | 1626 | } |
| 1627 | 1627 | return 0; |
| 1628 | 1628 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1609,19 +1609,19 @@ | |
| 1609 | |
| 1610 | /* |
| 1611 | ** Return true if the string zVal represents "true" (or "false"). |
| 1612 | */ |
| 1613 | int is_truth(const char *zVal){ |
| 1614 | static const char *azOn[] = { "on", "yes", "true", "1" }; |
| 1615 | int i; |
| 1616 | for(i=0; i<sizeof(azOn)/sizeof(azOn[0]); i++){ |
| 1617 | if( fossil_stricmp(zVal,azOn[i])==0 ) return 1; |
| 1618 | } |
| 1619 | return 0; |
| 1620 | } |
| 1621 | int is_false(const char *zVal){ |
| 1622 | static const char *azOff[] = { "off", "no", "false", "0" }; |
| 1623 | int i; |
| 1624 | for(i=0; i<sizeof(azOff)/sizeof(azOff[0]); i++){ |
| 1625 | if( fossil_stricmp(zVal,azOff[i])==0 ) return 1; |
| 1626 | } |
| 1627 | return 0; |
| 1628 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1609,19 +1609,19 @@ | |
| 1609 | |
| 1610 | /* |
| 1611 | ** Return true if the string zVal represents "true" (or "false"). |
| 1612 | */ |
| 1613 | int is_truth(const char *zVal){ |
| 1614 | static const char *const azOn[] = { "on", "yes", "true", "1" }; |
| 1615 | int i; |
| 1616 | for(i=0; i<sizeof(azOn)/sizeof(azOn[0]); i++){ |
| 1617 | if( fossil_stricmp(zVal,azOn[i])==0 ) return 1; |
| 1618 | } |
| 1619 | return 0; |
| 1620 | } |
| 1621 | int is_false(const char *zVal){ |
| 1622 | static const char *const azOff[] = { "off", "no", "false", "0" }; |
| 1623 | int i; |
| 1624 | for(i=0; i<sizeof(azOff)/sizeof(azOff[0]); i++){ |
| 1625 | if( fossil_stricmp(zVal,azOff[i])==0 ) return 1; |
| 1626 | } |
| 1627 | return 0; |
| 1628 |
+1
-1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -402,11 +402,11 @@ | ||
| 402 | 402 | memset(tv, 0, sizeof(tv[0])*2); |
| 403 | 403 | tv[0].tv_sec = newMTime; |
| 404 | 404 | tv[1].tv_sec = newMTime; |
| 405 | 405 | utimes(zFilename, tv); |
| 406 | 406 | #else |
| 407 | - struct utimbuf tb; | |
| 407 | + struct _utimbuf tb; | |
| 408 | 408 | wchar_t *zMbcs = fossil_utf8_to_unicode(zFilename); |
| 409 | 409 | tb.actime = newMTime; |
| 410 | 410 | tb.modtime = newMTime; |
| 411 | 411 | _wutime(zMbcs, &tb); |
| 412 | 412 | fossil_mbcs_free(zMbcs); |
| 413 | 413 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -402,11 +402,11 @@ | |
| 402 | memset(tv, 0, sizeof(tv[0])*2); |
| 403 | tv[0].tv_sec = newMTime; |
| 404 | tv[1].tv_sec = newMTime; |
| 405 | utimes(zFilename, tv); |
| 406 | #else |
| 407 | struct utimbuf tb; |
| 408 | wchar_t *zMbcs = fossil_utf8_to_unicode(zFilename); |
| 409 | tb.actime = newMTime; |
| 410 | tb.modtime = newMTime; |
| 411 | _wutime(zMbcs, &tb); |
| 412 | fossil_mbcs_free(zMbcs); |
| 413 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -402,11 +402,11 @@ | |
| 402 | memset(tv, 0, sizeof(tv[0])*2); |
| 403 | tv[0].tv_sec = newMTime; |
| 404 | tv[1].tv_sec = newMTime; |
| 405 | utimes(zFilename, tv); |
| 406 | #else |
| 407 | struct _utimbuf tb; |
| 408 | wchar_t *zMbcs = fossil_utf8_to_unicode(zFilename); |
| 409 | tb.actime = newMTime; |
| 410 | tb.modtime = newMTime; |
| 411 | _wutime(zMbcs, &tb); |
| 412 | fossil_mbcs_free(zMbcs); |
| 413 |
+1
-1
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -170,11 +170,11 @@ | ||
| 170 | 170 | case SQLITE_SELECT: |
| 171 | 171 | case SQLITE_FUNCTION: { |
| 172 | 172 | break; |
| 173 | 173 | } |
| 174 | 174 | case SQLITE_READ: { |
| 175 | - static const char *azAllowed[] = { | |
| 175 | + static const char *const azAllowed[] = { | |
| 176 | 176 | "ticket", |
| 177 | 177 | "blob", |
| 178 | 178 | "filename", |
| 179 | 179 | "mlink", |
| 180 | 180 | "plink", |
| 181 | 181 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -170,11 +170,11 @@ | |
| 170 | case SQLITE_SELECT: |
| 171 | case SQLITE_FUNCTION: { |
| 172 | break; |
| 173 | } |
| 174 | case SQLITE_READ: { |
| 175 | static const char *azAllowed[] = { |
| 176 | "ticket", |
| 177 | "blob", |
| 178 | "filename", |
| 179 | "mlink", |
| 180 | "plink", |
| 181 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -170,11 +170,11 @@ | |
| 170 | case SQLITE_SELECT: |
| 171 | case SQLITE_FUNCTION: { |
| 172 | break; |
| 173 | } |
| 174 | case SQLITE_READ: { |
| 175 | static const char *const azAllowed[] = { |
| 176 | "ticket", |
| 177 | "blob", |
| 178 | "filename", |
| 179 | "mlink", |
| 180 | "plink", |
| 181 |
+1
-1
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -385,11 +385,11 @@ | ||
| 385 | 385 | |
| 386 | 386 | /* |
| 387 | 387 | ** Return TRUE if zFile is a temporary file. Return FALSE if not. |
| 388 | 388 | */ |
| 389 | 389 | static int is_temporary_file(const char *zName){ |
| 390 | - static const char *azTemp[] = { | |
| 390 | + static const char *const azTemp[] = { | |
| 391 | 391 | "baseline", |
| 392 | 392 | "merge", |
| 393 | 393 | "original", |
| 394 | 394 | "output", |
| 395 | 395 | }; |
| 396 | 396 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -385,11 +385,11 @@ | |
| 385 | |
| 386 | /* |
| 387 | ** Return TRUE if zFile is a temporary file. Return FALSE if not. |
| 388 | */ |
| 389 | static int is_temporary_file(const char *zName){ |
| 390 | static const char *azTemp[] = { |
| 391 | "baseline", |
| 392 | "merge", |
| 393 | "original", |
| 394 | "output", |
| 395 | }; |
| 396 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -385,11 +385,11 @@ | |
| 385 | |
| 386 | /* |
| 387 | ** Return TRUE if zFile is a temporary file. Return FALSE if not. |
| 388 | */ |
| 389 | static int is_temporary_file(const char *zName){ |
| 390 | static const char *const azTemp[] = { |
| 391 | "baseline", |
| 392 | "merge", |
| 393 | "original", |
| 394 | "output", |
| 395 | }; |
| 396 |
+1
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -270,11 +270,11 @@ | ||
| 270 | 270 | int rid, /* record id of the file to send */ |
| 271 | 271 | int isPrivate, /* True if rid is a private artifact */ |
| 272 | 272 | Blob *pContent, /* The content of the file to send */ |
| 273 | 273 | Blob *pUuid /* The UUID of the file to send */ |
| 274 | 274 | ){ |
| 275 | - static const char *azQuery[] = { | |
| 275 | + static const char *const azQuery[] = { | |
| 276 | 276 | "SELECT pid FROM plink x" |
| 277 | 277 | " WHERE cid=%d" |
| 278 | 278 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 279 | 279 | " AND NOT EXISTS(SELECT 1 FROM plink y" |
| 280 | 280 | " WHERE y.pid=x.cid AND y.cid=x.pid)", |
| 281 | 281 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -270,11 +270,11 @@ | |
| 270 | int rid, /* record id of the file to send */ |
| 271 | int isPrivate, /* True if rid is a private artifact */ |
| 272 | Blob *pContent, /* The content of the file to send */ |
| 273 | Blob *pUuid /* The UUID of the file to send */ |
| 274 | ){ |
| 275 | static const char *azQuery[] = { |
| 276 | "SELECT pid FROM plink x" |
| 277 | " WHERE cid=%d" |
| 278 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 279 | " AND NOT EXISTS(SELECT 1 FROM plink y" |
| 280 | " WHERE y.pid=x.cid AND y.cid=x.pid)", |
| 281 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -270,11 +270,11 @@ | |
| 270 | int rid, /* record id of the file to send */ |
| 271 | int isPrivate, /* True if rid is a private artifact */ |
| 272 | Blob *pContent, /* The content of the file to send */ |
| 273 | Blob *pUuid /* The UUID of the file to send */ |
| 274 | ){ |
| 275 | static const char *const azQuery[] = { |
| 276 | "SELECT pid FROM plink x" |
| 277 | " WHERE cid=%d" |
| 278 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 279 | " AND NOT EXISTS(SELECT 1 FROM plink y" |
| 280 | " WHERE y.pid=x.cid AND y.cid=x.pid)", |
| 281 |