Fossil SCM
Be strict about compiler warnings for Windows builds.
Commit
57f16ce8e550f3eac0a22d6c83f24d92885e99cc97229a9550f95984831628fe
Parent
e4b49ce37d07f43…
8 files changed
+1
-1
+2
-1
+3
-1
+7
-4
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -2325,11 +2325,11 @@ | ||
| 2325 | 2325 | sqlite3_int64 iMtime = db_column_int64(&q, 6); |
| 2326 | 2326 | double rAge = (iNow - iMtime)/86400.0; |
| 2327 | 2327 | int uid = db_column_int(&q, 8); |
| 2328 | 2328 | const char *zUname = db_column_text(&q, 3); |
| 2329 | 2329 | sqlite3_int64 iContact = db_column_int64(&q, 9); |
| 2330 | - double rContact = (iNow/86400) - iContact; | |
| 2330 | + double rContact = (iNow/86400.0) - iContact; | |
| 2331 | 2331 | @ <tr> |
| 2332 | 2332 | @ <td><a href='%R/alerts?sid=%d(db_column_int(&q,0))'>\ |
| 2333 | 2333 | @ %h(db_column_text(&q,1))</a></td> |
| 2334 | 2334 | @ <td>%h(db_column_text(&q,2))</td> |
| 2335 | 2335 | @ <td>%s(db_column_int(&q,5)?"digest":"")</td> |
| 2336 | 2336 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -2325,11 +2325,11 @@ | |
| 2325 | sqlite3_int64 iMtime = db_column_int64(&q, 6); |
| 2326 | double rAge = (iNow - iMtime)/86400.0; |
| 2327 | int uid = db_column_int(&q, 8); |
| 2328 | const char *zUname = db_column_text(&q, 3); |
| 2329 | sqlite3_int64 iContact = db_column_int64(&q, 9); |
| 2330 | double rContact = (iNow/86400) - iContact; |
| 2331 | @ <tr> |
| 2332 | @ <td><a href='%R/alerts?sid=%d(db_column_int(&q,0))'>\ |
| 2333 | @ %h(db_column_text(&q,1))</a></td> |
| 2334 | @ <td>%h(db_column_text(&q,2))</td> |
| 2335 | @ <td>%s(db_column_int(&q,5)?"digest":"")</td> |
| 2336 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -2325,11 +2325,11 @@ | |
| 2325 | sqlite3_int64 iMtime = db_column_int64(&q, 6); |
| 2326 | double rAge = (iNow - iMtime)/86400.0; |
| 2327 | int uid = db_column_int(&q, 8); |
| 2328 | const char *zUname = db_column_text(&q, 3); |
| 2329 | sqlite3_int64 iContact = db_column_int64(&q, 9); |
| 2330 | double rContact = (iNow/86400.0) - iContact; |
| 2331 | @ <tr> |
| 2332 | @ <td><a href='%R/alerts?sid=%d(db_column_int(&q,0))'>\ |
| 2333 | @ %h(db_column_text(&q,1))</a></td> |
| 2334 | @ <td>%h(db_column_text(&q,2))</td> |
| 2335 | @ <td>%s(db_column_int(&q,5)?"digest":"")</td> |
| 2336 |
+2
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -3355,11 +3355,12 @@ | ||
| 3355 | 3355 | if( strcmp(zLimit,"none")==0 ){ |
| 3356 | 3356 | iLimit = 0; |
| 3357 | 3357 | mxTime = 0; |
| 3358 | 3358 | }else if( sqlite3_strglob("*[0-9]s", zLimit)==0 ){ |
| 3359 | 3359 | iLimit = 0; |
| 3360 | - mxTime = current_time_in_milliseconds() + 1000.0*atof(zLimit); | |
| 3360 | + mxTime = | |
| 3361 | + (sqlite3_int64)(current_time_in_milliseconds() + 1000.0*atof(zLimit)); | |
| 3361 | 3362 | }else{ |
| 3362 | 3363 | iLimit = atoi(zLimit); |
| 3363 | 3364 | if( iLimit<=0 ) iLimit = 30; |
| 3364 | 3365 | mxTime = 0; |
| 3365 | 3366 | } |
| 3366 | 3367 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -3355,11 +3355,12 @@ | |
| 3355 | if( strcmp(zLimit,"none")==0 ){ |
| 3356 | iLimit = 0; |
| 3357 | mxTime = 0; |
| 3358 | }else if( sqlite3_strglob("*[0-9]s", zLimit)==0 ){ |
| 3359 | iLimit = 0; |
| 3360 | mxTime = current_time_in_milliseconds() + 1000.0*atof(zLimit); |
| 3361 | }else{ |
| 3362 | iLimit = atoi(zLimit); |
| 3363 | if( iLimit<=0 ) iLimit = 30; |
| 3364 | mxTime = 0; |
| 3365 | } |
| 3366 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -3355,11 +3355,12 @@ | |
| 3355 | if( strcmp(zLimit,"none")==0 ){ |
| 3356 | iLimit = 0; |
| 3357 | mxTime = 0; |
| 3358 | }else if( sqlite3_strglob("*[0-9]s", zLimit)==0 ){ |
| 3359 | iLimit = 0; |
| 3360 | mxTime = |
| 3361 | (sqlite3_int64)(current_time_in_milliseconds() + 1000.0*atof(zLimit)); |
| 3362 | }else{ |
| 3363 | iLimit = atoi(zLimit); |
| 3364 | if( iLimit<=0 ) iLimit = 30; |
| 3365 | mxTime = 0; |
| 3366 | } |
| 3367 |
+3
-1
| --- src/repolist.c | ||
| +++ src/repolist.c | ||
| @@ -205,11 +205,13 @@ | ||
| 205 | 205 | if( x.isRepolistSkin==2 && !allRepo ){ |
| 206 | 206 | /* Repositories with repolist-skin==2 are omitted from directory |
| 207 | 207 | ** scan lists, but included in "fossil all ui" lists */ |
| 208 | 208 | continue; |
| 209 | 209 | } |
| 210 | - iAge = (rNow - x.rMTime)*86400; | |
| 210 | + /* Assert that the following cast will not narrow in fact. */ | |
| 211 | + assert((rNow - x.rMTime)<=(((unsigned)~0)>>1)/86400.0); | |
| 212 | + iAge = (int)((rNow - x.rMTime)*86400); | |
| 211 | 213 | if( iAge<0 ) x.rMTime = rNow; |
| 212 | 214 | zAge = human_readable_age(rNow - x.rMTime); |
| 213 | 215 | blob_append_sql(&html, "<tr><td valign='top'>"); |
| 214 | 216 | if( sqlite3_strglob("*.fossil", zName)!=0 ){ |
| 215 | 217 | /* The "fossil server DIRECTORY" and "fossil ui DIRECTORY" commands |
| 216 | 218 |
| --- src/repolist.c | |
| +++ src/repolist.c | |
| @@ -205,11 +205,13 @@ | |
| 205 | if( x.isRepolistSkin==2 && !allRepo ){ |
| 206 | /* Repositories with repolist-skin==2 are omitted from directory |
| 207 | ** scan lists, but included in "fossil all ui" lists */ |
| 208 | continue; |
| 209 | } |
| 210 | iAge = (rNow - x.rMTime)*86400; |
| 211 | if( iAge<0 ) x.rMTime = rNow; |
| 212 | zAge = human_readable_age(rNow - x.rMTime); |
| 213 | blob_append_sql(&html, "<tr><td valign='top'>"); |
| 214 | if( sqlite3_strglob("*.fossil", zName)!=0 ){ |
| 215 | /* The "fossil server DIRECTORY" and "fossil ui DIRECTORY" commands |
| 216 |
| --- src/repolist.c | |
| +++ src/repolist.c | |
| @@ -205,11 +205,13 @@ | |
| 205 | if( x.isRepolistSkin==2 && !allRepo ){ |
| 206 | /* Repositories with repolist-skin==2 are omitted from directory |
| 207 | ** scan lists, but included in "fossil all ui" lists */ |
| 208 | continue; |
| 209 | } |
| 210 | /* Assert that the following cast will not narrow in fact. */ |
| 211 | assert((rNow - x.rMTime)<=(((unsigned)~0)>>1)/86400.0); |
| 212 | iAge = (int)((rNow - x.rMTime)*86400); |
| 213 | if( iAge<0 ) x.rMTime = rNow; |
| 214 | zAge = human_readable_age(rNow - x.rMTime); |
| 215 | blob_append_sql(&html, "<tr><td valign='top'>"); |
| 216 | if( sqlite3_strglob("*.fossil", zName)!=0 ){ |
| 217 | /* The "fossil server DIRECTORY" and "fossil ui DIRECTORY" commands |
| 218 |
+7
-4
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -999,14 +999,17 @@ | ||
| 999 | 999 | r = 0; |
| 1000 | 1000 | n = 0; |
| 1001 | 1001 | while( db_step(&q)==SQLITE_ROW ){ |
| 1002 | 1002 | r += db_column_int(&q, 0); |
| 1003 | 1003 | if( n50pct==0 && r>=sumCmpr/2 ) n50pct = n; |
| 1004 | - if( n==(nTotal+99)/100 ) sz1pct = r; | |
| 1005 | - if( n==(nTotal+9)/10 ) sz10pct = r; | |
| 1006 | - if( n==(nTotal+4)/5 ) sz25pct = r; | |
| 1007 | - if( n==(nTotal+1)/2 ){ sz50pct = r; medCmpr = db_column_int(&q,0); } | |
| 1004 | + if( n==(nTotal+99)/100 ) sz1pct = (sqlite3_int64)r; | |
| 1005 | + if( n==(nTotal+9)/10 ) sz10pct = (sqlite3_int64)r; | |
| 1006 | + if( n==(nTotal+4)/5 ) sz25pct = (sqlite3_int64)r; | |
| 1007 | + if( n==(nTotal+1)/2 ){ | |
| 1008 | + sz50pct = (sqlite3_int64)r; | |
| 1009 | + medCmpr = db_column_int(&q,0); | |
| 1010 | + } | |
| 1008 | 1011 | n++; |
| 1009 | 1012 | } |
| 1010 | 1013 | db_finalize(&q); |
| 1011 | 1014 | |
| 1012 | 1015 | @ <h1>Overall Artifact Size Statistics:</h1> |
| 1013 | 1016 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -999,14 +999,17 @@ | |
| 999 | r = 0; |
| 1000 | n = 0; |
| 1001 | while( db_step(&q)==SQLITE_ROW ){ |
| 1002 | r += db_column_int(&q, 0); |
| 1003 | if( n50pct==0 && r>=sumCmpr/2 ) n50pct = n; |
| 1004 | if( n==(nTotal+99)/100 ) sz1pct = r; |
| 1005 | if( n==(nTotal+9)/10 ) sz10pct = r; |
| 1006 | if( n==(nTotal+4)/5 ) sz25pct = r; |
| 1007 | if( n==(nTotal+1)/2 ){ sz50pct = r; medCmpr = db_column_int(&q,0); } |
| 1008 | n++; |
| 1009 | } |
| 1010 | db_finalize(&q); |
| 1011 | |
| 1012 | @ <h1>Overall Artifact Size Statistics:</h1> |
| 1013 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -999,14 +999,17 @@ | |
| 999 | r = 0; |
| 1000 | n = 0; |
| 1001 | while( db_step(&q)==SQLITE_ROW ){ |
| 1002 | r += db_column_int(&q, 0); |
| 1003 | if( n50pct==0 && r>=sumCmpr/2 ) n50pct = n; |
| 1004 | if( n==(nTotal+99)/100 ) sz1pct = (sqlite3_int64)r; |
| 1005 | if( n==(nTotal+9)/10 ) sz10pct = (sqlite3_int64)r; |
| 1006 | if( n==(nTotal+4)/5 ) sz25pct = (sqlite3_int64)r; |
| 1007 | if( n==(nTotal+1)/2 ){ |
| 1008 | sz50pct = (sqlite3_int64)r; |
| 1009 | medCmpr = db_column_int(&q,0); |
| 1010 | } |
| 1011 | n++; |
| 1012 | } |
| 1013 | db_finalize(&q); |
| 1014 | |
| 1015 | @ <h1>Overall Artifact Size Statistics:</h1> |
| 1016 |
+1
-1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -496,11 +496,11 @@ | ||
| 496 | 496 | nPrefix = blob_size(&filename); |
| 497 | 497 | |
| 498 | 498 | pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 499 | 499 | if( pManifest ){ |
| 500 | 500 | int flg, eflg = 0; |
| 501 | - mTime = (pManifest->rDate - 2440587.5)*86400.0; | |
| 501 | + mTime = (unsigned)((pManifest->rDate - 2440587.5)*86400.0); | |
| 502 | 502 | if( pTar ) tar_begin(mTime); |
| 503 | 503 | flg = db_get_manifest_setting(); |
| 504 | 504 | if( flg ){ |
| 505 | 505 | /* eflg is the effective flags, taking include/exclude into account */ |
| 506 | 506 | if( (pInclude==0 || glob_match(pInclude, "manifest")) |
| 507 | 507 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -496,11 +496,11 @@ | |
| 496 | nPrefix = blob_size(&filename); |
| 497 | |
| 498 | pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 499 | if( pManifest ){ |
| 500 | int flg, eflg = 0; |
| 501 | mTime = (pManifest->rDate - 2440587.5)*86400.0; |
| 502 | if( pTar ) tar_begin(mTime); |
| 503 | flg = db_get_manifest_setting(); |
| 504 | if( flg ){ |
| 505 | /* eflg is the effective flags, taking include/exclude into account */ |
| 506 | if( (pInclude==0 || glob_match(pInclude, "manifest")) |
| 507 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -496,11 +496,11 @@ | |
| 496 | nPrefix = blob_size(&filename); |
| 497 | |
| 498 | pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 499 | if( pManifest ){ |
| 500 | int flg, eflg = 0; |
| 501 | mTime = (unsigned)((pManifest->rDate - 2440587.5)*86400.0); |
| 502 | if( pTar ) tar_begin(mTime); |
| 503 | flg = db_get_manifest_setting(); |
| 504 | if( flg ){ |
| 505 | /* eflg is the effective flags, taking include/exclude into account */ |
| 506 | if( (pInclude==0 || glob_match(pInclude, "manifest")) |
| 507 |
+1
-1
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -236,11 +236,11 @@ | ||
| 236 | 236 | */ |
| 237 | 237 | void zip_set_timedate(double rDate){ |
| 238 | 238 | char *zDate = db_text(0, "SELECT datetime(%.17g)", rDate); |
| 239 | 239 | zip_set_timedate_from_str(zDate); |
| 240 | 240 | fossil_free(zDate); |
| 241 | - unixTime = (rDate - 2440587.5)*86400.0; | |
| 241 | + unixTime = (int)((rDate - 2440587.5)*86400.0); | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /* |
| 245 | 245 | ** Append a single file to a growing ZIP archive. |
| 246 | 246 | ** |
| 247 | 247 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -236,11 +236,11 @@ | |
| 236 | */ |
| 237 | void zip_set_timedate(double rDate){ |
| 238 | char *zDate = db_text(0, "SELECT datetime(%.17g)", rDate); |
| 239 | zip_set_timedate_from_str(zDate); |
| 240 | fossil_free(zDate); |
| 241 | unixTime = (rDate - 2440587.5)*86400.0; |
| 242 | } |
| 243 | |
| 244 | /* |
| 245 | ** Append a single file to a growing ZIP archive. |
| 246 | ** |
| 247 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -236,11 +236,11 @@ | |
| 236 | */ |
| 237 | void zip_set_timedate(double rDate){ |
| 238 | char *zDate = db_text(0, "SELECT datetime(%.17g)", rDate); |
| 239 | zip_set_timedate_from_str(zDate); |
| 240 | fossil_free(zDate); |
| 241 | unixTime = (int)((rDate - 2440587.5)*86400.0); |
| 242 | } |
| 243 | |
| 244 | /* |
| 245 | ** Append a single file to a growing ZIP archive. |
| 246 | ** |
| 247 |
+1
-1
| --- tools/makemake.tcl | ||
| +++ tools/makemake.tcl | ||
| @@ -1628,11 +1628,11 @@ | ||
| 1628 | 1628 | |
| 1629 | 1629 | !if $(FOSSIL_ENABLE_TCL)!=0 |
| 1630 | 1630 | INCL = $(INCL) /I"$(TCLINCDIR)" |
| 1631 | 1631 | !endif |
| 1632 | 1632 | |
| 1633 | -CFLAGS = /nologo | |
| 1633 | +CFLAGS = /nologo /W2 /WX | |
| 1634 | 1634 | LDFLAGS = |
| 1635 | 1635 | |
| 1636 | 1636 | CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS |
| 1637 | 1637 | CFLAGS = $(CFLAGS) /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS |
| 1638 | 1638 | |
| 1639 | 1639 |
| --- tools/makemake.tcl | |
| +++ tools/makemake.tcl | |
| @@ -1628,11 +1628,11 @@ | |
| 1628 | |
| 1629 | !if $(FOSSIL_ENABLE_TCL)!=0 |
| 1630 | INCL = $(INCL) /I"$(TCLINCDIR)" |
| 1631 | !endif |
| 1632 | |
| 1633 | CFLAGS = /nologo |
| 1634 | LDFLAGS = |
| 1635 | |
| 1636 | CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS |
| 1637 | CFLAGS = $(CFLAGS) /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS |
| 1638 | |
| 1639 |
| --- tools/makemake.tcl | |
| +++ tools/makemake.tcl | |
| @@ -1628,11 +1628,11 @@ | |
| 1628 | |
| 1629 | !if $(FOSSIL_ENABLE_TCL)!=0 |
| 1630 | INCL = $(INCL) /I"$(TCLINCDIR)" |
| 1631 | !endif |
| 1632 | |
| 1633 | CFLAGS = /nologo /W2 /WX |
| 1634 | LDFLAGS = |
| 1635 | |
| 1636 | CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS |
| 1637 | CFLAGS = $(CFLAGS) /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS |
| 1638 | |
| 1639 |
+1
-1
| --- win/Makefile.msc | ||
| +++ win/Makefile.msc | ||
| @@ -173,11 +173,11 @@ | ||
| 173 | 173 | |
| 174 | 174 | !if $(FOSSIL_ENABLE_TCL)!=0 |
| 175 | 175 | INCL = $(INCL) /I"$(TCLINCDIR)" |
| 176 | 176 | !endif |
| 177 | 177 | |
| 178 | -CFLAGS = /nologo | |
| 178 | +CFLAGS = /nologo /W2 /WX | |
| 179 | 179 | LDFLAGS = |
| 180 | 180 | |
| 181 | 181 | CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS |
| 182 | 182 | CFLAGS = $(CFLAGS) /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS |
| 183 | 183 | |
| 184 | 184 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -173,11 +173,11 @@ | |
| 173 | |
| 174 | !if $(FOSSIL_ENABLE_TCL)!=0 |
| 175 | INCL = $(INCL) /I"$(TCLINCDIR)" |
| 176 | !endif |
| 177 | |
| 178 | CFLAGS = /nologo |
| 179 | LDFLAGS = |
| 180 | |
| 181 | CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS |
| 182 | CFLAGS = $(CFLAGS) /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS |
| 183 | |
| 184 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -173,11 +173,11 @@ | |
| 173 | |
| 174 | !if $(FOSSIL_ENABLE_TCL)!=0 |
| 175 | INCL = $(INCL) /I"$(TCLINCDIR)" |
| 176 | !endif |
| 177 | |
| 178 | CFLAGS = /nologo /W2 /WX |
| 179 | LDFLAGS = |
| 180 | |
| 181 | CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS |
| 182 | CFLAGS = $(CFLAGS) /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS |
| 183 | |
| 184 |