Fossil SCM
Fix a multitude of harmless compiler warnings.
Commit
53db40e6fcd69e5b82af628a90b2ed46140dbc8999f1a86a2e3bcf35bf89a8ab
Parent
5ad62aba37c1031…
38 files changed
+1
-1
+1
-1
+7
-7
+4
-4
+2
-2
+2
-2
+1
-1
+4
-4
+2
-2
+1
-1
+11
-10
+2
-2
+7
-7
+1
-1
+1
-1
+3
-3
+2
-2
+1
-1
+1
-1
+1
-1
+1
-1
+5
-5
+1
-1
+6
-6
+19
-17
+1
-1
+2
-2
+1
-1
+1
-1
+1
-1
+1
-1
+2
-2
+1
-1
+1
-1
+2
-2
+4
-4
+7
-7
+3
-3
~
extsrc/cson_amalgamation.c
~
src/backoffice.c
~
src/bag.c
~
src/blob.c
~
src/browse.c
~
src/capabilities.c
~
src/cgi.c
~
src/comformat.c
~
src/content.c
~
src/db.c
~
src/delta.c
~
src/deltacmd.c
~
src/diff.c
~
src/doc.c
~
src/encode.c
~
src/extcgi.c
~
src/file.c
~
src/fileedit.c
~
src/forum.c
~
src/http_ssl.c
~
src/http_transport.c
~
src/import.c
~
src/lookslike.c
~
src/main.c
~
src/markdown.c
~
src/merge3.c
~
src/printf.c
~
src/rebuild.c
~
src/tar.c
~
src/th.c
~
src/th_main.c
~
src/timeline.c
~
src/tkt.c
~
src/user.c
~
src/util.c
~
src/wikiformat.c
~
src/xfer.c
~
src/zip.c
+1
-1
| --- extsrc/cson_amalgamation.c | ||
| +++ extsrc/cson_amalgamation.c | ||
| @@ -5389,11 +5389,11 @@ | ||
| 5389 | 5389 | cson_string * colName = NULL; |
| 5390 | 5390 | int i = 0; |
| 5391 | 5391 | int rc = 0; |
| 5392 | 5392 | cson_value * currentValue = NULL; |
| 5393 | 5393 | int const colCount = sqlite3_column_count(st); |
| 5394 | - if( !colCount || (colCount>cson_array_length_get(colNames)) ) { | |
| 5394 | + if( !colCount || (colCount>(int)cson_array_length_get(colNames)) ) { | |
| 5395 | 5395 | return NULL; |
| 5396 | 5396 | } |
| 5397 | 5397 | rootV = cson_value_new_object(); |
| 5398 | 5398 | if(!rootV) return NULL; |
| 5399 | 5399 | root = cson_value_get_object(rootV); |
| 5400 | 5400 |
| --- extsrc/cson_amalgamation.c | |
| +++ extsrc/cson_amalgamation.c | |
| @@ -5389,11 +5389,11 @@ | |
| 5389 | cson_string * colName = NULL; |
| 5390 | int i = 0; |
| 5391 | int rc = 0; |
| 5392 | cson_value * currentValue = NULL; |
| 5393 | int const colCount = sqlite3_column_count(st); |
| 5394 | if( !colCount || (colCount>cson_array_length_get(colNames)) ) { |
| 5395 | return NULL; |
| 5396 | } |
| 5397 | rootV = cson_value_new_object(); |
| 5398 | if(!rootV) return NULL; |
| 5399 | root = cson_value_get_object(rootV); |
| 5400 |
| --- extsrc/cson_amalgamation.c | |
| +++ extsrc/cson_amalgamation.c | |
| @@ -5389,11 +5389,11 @@ | |
| 5389 | cson_string * colName = NULL; |
| 5390 | int i = 0; |
| 5391 | int rc = 0; |
| 5392 | cson_value * currentValue = NULL; |
| 5393 | int const colCount = sqlite3_column_count(st); |
| 5394 | if( !colCount || (colCount>(int)cson_array_length_get(colNames)) ) { |
| 5395 | return NULL; |
| 5396 | } |
| 5397 | rootV = cson_value_new_object(); |
| 5398 | if(!rootV) return NULL; |
| 5399 | root = cson_value_get_object(rootV); |
| 5400 |
+1
-1
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -541,11 +541,11 @@ | ||
| 541 | 541 | backofficeTrace("/***** Backoffice Interrupt %d *****/\n", GETPID()); |
| 542 | 542 | db_end_transaction(0); |
| 543 | 543 | break; |
| 544 | 544 | } |
| 545 | 545 | }else{ |
| 546 | - if( lastWarning+warningDelay < tmNow ){ | |
| 546 | + if( (sqlite3_uint64)(lastWarning+warningDelay) < tmNow ){ | |
| 547 | 547 | fossil_warning( |
| 548 | 548 | "backoffice process %lld still running after %d seconds", |
| 549 | 549 | x.idCurrent, (int)(BKOFCE_LEASE_TIME + tmNow - x.tmCurrent)); |
| 550 | 550 | lastWarning = tmNow; |
| 551 | 551 | warningDelay *= 2; |
| 552 | 552 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -541,11 +541,11 @@ | |
| 541 | backofficeTrace("/***** Backoffice Interrupt %d *****/\n", GETPID()); |
| 542 | db_end_transaction(0); |
| 543 | break; |
| 544 | } |
| 545 | }else{ |
| 546 | if( lastWarning+warningDelay < tmNow ){ |
| 547 | fossil_warning( |
| 548 | "backoffice process %lld still running after %d seconds", |
| 549 | x.idCurrent, (int)(BKOFCE_LEASE_TIME + tmNow - x.tmCurrent)); |
| 550 | lastWarning = tmNow; |
| 551 | warningDelay *= 2; |
| 552 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -541,11 +541,11 @@ | |
| 541 | backofficeTrace("/***** Backoffice Interrupt %d *****/\n", GETPID()); |
| 542 | db_end_transaction(0); |
| 543 | break; |
| 544 | } |
| 545 | }else{ |
| 546 | if( (sqlite3_uint64)(lastWarning+warningDelay) < tmNow ){ |
| 547 | fossil_warning( |
| 548 | "backoffice process %lld still running after %d seconds", |
| 549 | x.idCurrent, (int)(BKOFCE_LEASE_TIME + tmNow - x.tmCurrent)); |
| 550 | lastWarning = tmNow; |
| 551 | warningDelay *= 2; |
| 552 |
+7
-7
| --- src/bag.c | ||
| +++ src/bag.c | ||
| @@ -101,11 +101,11 @@ | ||
| 101 | 101 | int e = old.a[i]; |
| 102 | 102 | if( e>0 ){ |
| 103 | 103 | unsigned h = bag_hash(e)%newSize; |
| 104 | 104 | while( p->a[h] ){ |
| 105 | 105 | h++; |
| 106 | - if( h==newSize ) h = 0; | |
| 106 | + if( (int)h==newSize ) h = 0; | |
| 107 | 107 | } |
| 108 | 108 | p->a[h] = e; |
| 109 | 109 | nLive++; |
| 110 | 110 | }else if( e<0 ){ |
| 111 | 111 | nDel++; |
| @@ -131,11 +131,11 @@ | ||
| 131 | 131 | bag_resize(p, n + 20 ); |
| 132 | 132 | } |
| 133 | 133 | h = bag_hash(e)%p->sz; |
| 134 | 134 | while( p->a[h]>0 && p->a[h]!=e ){ |
| 135 | 135 | h++; |
| 136 | - if( h>=p->sz ) h = 0; | |
| 136 | + if( (int)h>=p->sz ) h = 0; | |
| 137 | 137 | } |
| 138 | 138 | if( p->a[h]<=0 ){ |
| 139 | 139 | if( p->a[h]==0 ) p->used++; |
| 140 | 140 | p->a[h] = e; |
| 141 | 141 | p->cnt++; |
| @@ -154,11 +154,11 @@ | ||
| 154 | 154 | return 0; |
| 155 | 155 | } |
| 156 | 156 | h = bag_hash(e)%p->sz; |
| 157 | 157 | while( p->a[h] && p->a[h]!=e ){ |
| 158 | 158 | h++; |
| 159 | - if( h>=p->sz ) h = 0; | |
| 159 | + if( (int)h>=p->sz ) h = 0; | |
| 160 | 160 | } |
| 161 | 161 | return p->a[h]==e; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /* |
| @@ -170,11 +170,11 @@ | ||
| 170 | 170 | assert( e>0 ); |
| 171 | 171 | if( p->sz==0 ) return; |
| 172 | 172 | h = bag_hash(e)%p->sz; |
| 173 | 173 | while( p->a[h] && p->a[h]!=e ){ |
| 174 | 174 | h++; |
| 175 | - if( h>=p->sz ) h = 0; | |
| 175 | + if( (int)h>=p->sz ) h = 0; | |
| 176 | 176 | } |
| 177 | 177 | if( p->a[h] ){ |
| 178 | 178 | int nx = h+1; |
| 179 | 179 | if( nx>=p->sz ) nx = 0; |
| 180 | 180 | if( p->a[nx]==0 ){ |
| @@ -217,21 +217,21 @@ | ||
| 217 | 217 | assert( p->sz>0 ); |
| 218 | 218 | assert( e>0 ); |
| 219 | 219 | h = bag_hash(e)%p->sz; |
| 220 | 220 | while( p->a[h] && p->a[h]!=e ){ |
| 221 | 221 | h++; |
| 222 | - if( h>=p->sz ) h = 0; | |
| 222 | + if( (int)h>=p->sz ) h = 0; | |
| 223 | 223 | } |
| 224 | 224 | assert( p->a[h] ); |
| 225 | 225 | h++; |
| 226 | - while( h<p->sz && p->a[h]<=0 ){ | |
| 226 | + while( (int)h<p->sz && p->a[h]<=0 ){ | |
| 227 | 227 | h++; |
| 228 | 228 | } |
| 229 | - return h<p->sz ? p->a[h] : 0; | |
| 229 | + return (int)h<p->sz ? p->a[h] : 0; | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /* |
| 233 | 233 | ** Return the number of elements in the bag. |
| 234 | 234 | */ |
| 235 | 235 | int bag_count(Bag *p){ |
| 236 | 236 | return p->cnt; |
| 237 | 237 | } |
| 238 | 238 |
| --- src/bag.c | |
| +++ src/bag.c | |
| @@ -101,11 +101,11 @@ | |
| 101 | int e = old.a[i]; |
| 102 | if( e>0 ){ |
| 103 | unsigned h = bag_hash(e)%newSize; |
| 104 | while( p->a[h] ){ |
| 105 | h++; |
| 106 | if( h==newSize ) h = 0; |
| 107 | } |
| 108 | p->a[h] = e; |
| 109 | nLive++; |
| 110 | }else if( e<0 ){ |
| 111 | nDel++; |
| @@ -131,11 +131,11 @@ | |
| 131 | bag_resize(p, n + 20 ); |
| 132 | } |
| 133 | h = bag_hash(e)%p->sz; |
| 134 | while( p->a[h]>0 && p->a[h]!=e ){ |
| 135 | h++; |
| 136 | if( h>=p->sz ) h = 0; |
| 137 | } |
| 138 | if( p->a[h]<=0 ){ |
| 139 | if( p->a[h]==0 ) p->used++; |
| 140 | p->a[h] = e; |
| 141 | p->cnt++; |
| @@ -154,11 +154,11 @@ | |
| 154 | return 0; |
| 155 | } |
| 156 | h = bag_hash(e)%p->sz; |
| 157 | while( p->a[h] && p->a[h]!=e ){ |
| 158 | h++; |
| 159 | if( h>=p->sz ) h = 0; |
| 160 | } |
| 161 | return p->a[h]==e; |
| 162 | } |
| 163 | |
| 164 | /* |
| @@ -170,11 +170,11 @@ | |
| 170 | assert( e>0 ); |
| 171 | if( p->sz==0 ) return; |
| 172 | h = bag_hash(e)%p->sz; |
| 173 | while( p->a[h] && p->a[h]!=e ){ |
| 174 | h++; |
| 175 | if( h>=p->sz ) h = 0; |
| 176 | } |
| 177 | if( p->a[h] ){ |
| 178 | int nx = h+1; |
| 179 | if( nx>=p->sz ) nx = 0; |
| 180 | if( p->a[nx]==0 ){ |
| @@ -217,21 +217,21 @@ | |
| 217 | assert( p->sz>0 ); |
| 218 | assert( e>0 ); |
| 219 | h = bag_hash(e)%p->sz; |
| 220 | while( p->a[h] && p->a[h]!=e ){ |
| 221 | h++; |
| 222 | if( h>=p->sz ) h = 0; |
| 223 | } |
| 224 | assert( p->a[h] ); |
| 225 | h++; |
| 226 | while( h<p->sz && p->a[h]<=0 ){ |
| 227 | h++; |
| 228 | } |
| 229 | return h<p->sz ? p->a[h] : 0; |
| 230 | } |
| 231 | |
| 232 | /* |
| 233 | ** Return the number of elements in the bag. |
| 234 | */ |
| 235 | int bag_count(Bag *p){ |
| 236 | return p->cnt; |
| 237 | } |
| 238 |
| --- src/bag.c | |
| +++ src/bag.c | |
| @@ -101,11 +101,11 @@ | |
| 101 | int e = old.a[i]; |
| 102 | if( e>0 ){ |
| 103 | unsigned h = bag_hash(e)%newSize; |
| 104 | while( p->a[h] ){ |
| 105 | h++; |
| 106 | if( (int)h==newSize ) h = 0; |
| 107 | } |
| 108 | p->a[h] = e; |
| 109 | nLive++; |
| 110 | }else if( e<0 ){ |
| 111 | nDel++; |
| @@ -131,11 +131,11 @@ | |
| 131 | bag_resize(p, n + 20 ); |
| 132 | } |
| 133 | h = bag_hash(e)%p->sz; |
| 134 | while( p->a[h]>0 && p->a[h]!=e ){ |
| 135 | h++; |
| 136 | if( (int)h>=p->sz ) h = 0; |
| 137 | } |
| 138 | if( p->a[h]<=0 ){ |
| 139 | if( p->a[h]==0 ) p->used++; |
| 140 | p->a[h] = e; |
| 141 | p->cnt++; |
| @@ -154,11 +154,11 @@ | |
| 154 | return 0; |
| 155 | } |
| 156 | h = bag_hash(e)%p->sz; |
| 157 | while( p->a[h] && p->a[h]!=e ){ |
| 158 | h++; |
| 159 | if( (int)h>=p->sz ) h = 0; |
| 160 | } |
| 161 | return p->a[h]==e; |
| 162 | } |
| 163 | |
| 164 | /* |
| @@ -170,11 +170,11 @@ | |
| 170 | assert( e>0 ); |
| 171 | if( p->sz==0 ) return; |
| 172 | h = bag_hash(e)%p->sz; |
| 173 | while( p->a[h] && p->a[h]!=e ){ |
| 174 | h++; |
| 175 | if( (int)h>=p->sz ) h = 0; |
| 176 | } |
| 177 | if( p->a[h] ){ |
| 178 | int nx = h+1; |
| 179 | if( nx>=p->sz ) nx = 0; |
| 180 | if( p->a[nx]==0 ){ |
| @@ -217,21 +217,21 @@ | |
| 217 | assert( p->sz>0 ); |
| 218 | assert( e>0 ); |
| 219 | h = bag_hash(e)%p->sz; |
| 220 | while( p->a[h] && p->a[h]!=e ){ |
| 221 | h++; |
| 222 | if( (int)h>=p->sz ) h = 0; |
| 223 | } |
| 224 | assert( p->a[h] ); |
| 225 | h++; |
| 226 | while( (int)h<p->sz && p->a[h]<=0 ){ |
| 227 | h++; |
| 228 | } |
| 229 | return (int)h<p->sz ? p->a[h] : 0; |
| 230 | } |
| 231 | |
| 232 | /* |
| 233 | ** Return the number of elements in the bag. |
| 234 | */ |
| 235 | int bag_count(Bag *p){ |
| 236 | return p->cnt; |
| 237 | } |
| 238 |
+4
-4
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -678,11 +678,11 @@ | ||
| 678 | 678 | |
| 679 | 679 | /* |
| 680 | 680 | ** Truncate a blob back to zero length |
| 681 | 681 | */ |
| 682 | 682 | void blob_truncate(Blob *p, int sz){ |
| 683 | - if( sz>=0 && sz<p->nUsed ) p->nUsed = sz; | |
| 683 | + if( sz>=0 && sz<(int)(p->nUsed) ) p->nUsed = sz; | |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | /* |
| 687 | 687 | ** Seek the cursor in a blob to the indicated offset. |
| 688 | 688 | */ |
| @@ -1163,11 +1163,11 @@ | ||
| 1163 | 1163 | return 0; |
| 1164 | 1164 | } |
| 1165 | 1165 | blob_is_init(pBlob); |
| 1166 | 1166 | nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out); |
| 1167 | 1167 | fclose(out); |
| 1168 | - if( nWrote!=blob_size(pBlob) ){ | |
| 1168 | + if( nWrote!=(int)blob_size(pBlob) ){ | |
| 1169 | 1169 | fossil_fatal_recursive("short write: %d of %d bytes to %s", nWrote, |
| 1170 | 1170 | blob_size(pBlob), zFilename); |
| 1171 | 1171 | } |
| 1172 | 1172 | } |
| 1173 | 1173 | return nWrote; |
| @@ -1361,11 +1361,11 @@ | ||
| 1361 | 1361 | int i, n; |
| 1362 | 1362 | for(i=n=0; i<j; i++){ |
| 1363 | 1363 | if( z[i]=='\n' ) n++; |
| 1364 | 1364 | } |
| 1365 | 1365 | j += n; |
| 1366 | - if( j>=p->nAlloc ){ | |
| 1366 | + if( j>=(int)(p->nAlloc) ){ | |
| 1367 | 1367 | blob_resize(p, j); |
| 1368 | 1368 | z = p->aData; |
| 1369 | 1369 | } |
| 1370 | 1370 | p->nUsed = j; |
| 1371 | 1371 | z[j] = 0; |
| @@ -1416,11 +1416,11 @@ | ||
| 1416 | 1416 | } |
| 1417 | 1417 | n++; |
| 1418 | 1418 | } |
| 1419 | 1419 | } |
| 1420 | 1420 | j += n; |
| 1421 | - if( j>=p->nAlloc ){ | |
| 1421 | + if( j>=(int)(p->nAlloc) ){ | |
| 1422 | 1422 | blob_resize(p, j); |
| 1423 | 1423 | z = (unsigned char *)p->aData; |
| 1424 | 1424 | } |
| 1425 | 1425 | p->nUsed = j; |
| 1426 | 1426 | z[j] = 0; |
| 1427 | 1427 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -678,11 +678,11 @@ | |
| 678 | |
| 679 | /* |
| 680 | ** Truncate a blob back to zero length |
| 681 | */ |
| 682 | void blob_truncate(Blob *p, int sz){ |
| 683 | if( sz>=0 && sz<p->nUsed ) p->nUsed = sz; |
| 684 | } |
| 685 | |
| 686 | /* |
| 687 | ** Seek the cursor in a blob to the indicated offset. |
| 688 | */ |
| @@ -1163,11 +1163,11 @@ | |
| 1163 | return 0; |
| 1164 | } |
| 1165 | blob_is_init(pBlob); |
| 1166 | nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out); |
| 1167 | fclose(out); |
| 1168 | if( nWrote!=blob_size(pBlob) ){ |
| 1169 | fossil_fatal_recursive("short write: %d of %d bytes to %s", nWrote, |
| 1170 | blob_size(pBlob), zFilename); |
| 1171 | } |
| 1172 | } |
| 1173 | return nWrote; |
| @@ -1361,11 +1361,11 @@ | |
| 1361 | int i, n; |
| 1362 | for(i=n=0; i<j; i++){ |
| 1363 | if( z[i]=='\n' ) n++; |
| 1364 | } |
| 1365 | j += n; |
| 1366 | if( j>=p->nAlloc ){ |
| 1367 | blob_resize(p, j); |
| 1368 | z = p->aData; |
| 1369 | } |
| 1370 | p->nUsed = j; |
| 1371 | z[j] = 0; |
| @@ -1416,11 +1416,11 @@ | |
| 1416 | } |
| 1417 | n++; |
| 1418 | } |
| 1419 | } |
| 1420 | j += n; |
| 1421 | if( j>=p->nAlloc ){ |
| 1422 | blob_resize(p, j); |
| 1423 | z = (unsigned char *)p->aData; |
| 1424 | } |
| 1425 | p->nUsed = j; |
| 1426 | z[j] = 0; |
| 1427 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -678,11 +678,11 @@ | |
| 678 | |
| 679 | /* |
| 680 | ** Truncate a blob back to zero length |
| 681 | */ |
| 682 | void blob_truncate(Blob *p, int sz){ |
| 683 | if( sz>=0 && sz<(int)(p->nUsed) ) p->nUsed = sz; |
| 684 | } |
| 685 | |
| 686 | /* |
| 687 | ** Seek the cursor in a blob to the indicated offset. |
| 688 | */ |
| @@ -1163,11 +1163,11 @@ | |
| 1163 | return 0; |
| 1164 | } |
| 1165 | blob_is_init(pBlob); |
| 1166 | nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out); |
| 1167 | fclose(out); |
| 1168 | if( nWrote!=(int)blob_size(pBlob) ){ |
| 1169 | fossil_fatal_recursive("short write: %d of %d bytes to %s", nWrote, |
| 1170 | blob_size(pBlob), zFilename); |
| 1171 | } |
| 1172 | } |
| 1173 | return nWrote; |
| @@ -1361,11 +1361,11 @@ | |
| 1361 | int i, n; |
| 1362 | for(i=n=0; i<j; i++){ |
| 1363 | if( z[i]=='\n' ) n++; |
| 1364 | } |
| 1365 | j += n; |
| 1366 | if( j>=(int)(p->nAlloc) ){ |
| 1367 | blob_resize(p, j); |
| 1368 | z = p->aData; |
| 1369 | } |
| 1370 | p->nUsed = j; |
| 1371 | z[j] = 0; |
| @@ -1416,11 +1416,11 @@ | |
| 1416 | } |
| 1417 | n++; |
| 1418 | } |
| 1419 | } |
| 1420 | j += n; |
| 1421 | if( j>=(int)(p->nAlloc) ){ |
| 1422 | blob_resize(p, j); |
| 1423 | z = (unsigned char *)p->aData; |
| 1424 | } |
| 1425 | p->nUsed = j; |
| 1426 | z[j] = 0; |
| 1427 |
+2
-2
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -894,19 +894,19 @@ | ||
| 894 | 894 | relinkTree(&sTree, p); |
| 895 | 895 | } |
| 896 | 896 | for(p=sTree.pFirst, nDir=0; p; p=p->pNext){ |
| 897 | 897 | const char *zLastClass = p->pSibling==0 ? " last" : ""; |
| 898 | 898 | if( p->pChild ){ |
| 899 | - const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : ""; | |
| 899 | + const char *zSubdirClass = (int)(p->nFullName)==nD-1 ? " subdir" : ""; | |
| 900 | 900 | @ <li class="dir%s(zSubdirClass)%s(zLastClass)"><div class="filetreeline"> |
| 901 | 901 | @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a> |
| 902 | 902 | if( p->mtime>0.0 ){ |
| 903 | 903 | char *zAge = human_readable_age(rNow - p->mtime); |
| 904 | 904 | @ <div class="filetreeage">%s(zAge)</div> |
| 905 | 905 | } |
| 906 | 906 | @ </div> |
| 907 | - if( startExpanded || p->nFullName<=nD ){ | |
| 907 | + if( startExpanded || (int)(p->nFullName)<=nD ){ | |
| 908 | 908 | @ <ul id="dir%d(nDir)"> |
| 909 | 909 | }else{ |
| 910 | 910 | @ <ul id="dir%d(nDir)" class="collapsed"> |
| 911 | 911 | } |
| 912 | 912 | nDir++; |
| 913 | 913 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -894,19 +894,19 @@ | |
| 894 | relinkTree(&sTree, p); |
| 895 | } |
| 896 | for(p=sTree.pFirst, nDir=0; p; p=p->pNext){ |
| 897 | const char *zLastClass = p->pSibling==0 ? " last" : ""; |
| 898 | if( p->pChild ){ |
| 899 | const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : ""; |
| 900 | @ <li class="dir%s(zSubdirClass)%s(zLastClass)"><div class="filetreeline"> |
| 901 | @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a> |
| 902 | if( p->mtime>0.0 ){ |
| 903 | char *zAge = human_readable_age(rNow - p->mtime); |
| 904 | @ <div class="filetreeage">%s(zAge)</div> |
| 905 | } |
| 906 | @ </div> |
| 907 | if( startExpanded || p->nFullName<=nD ){ |
| 908 | @ <ul id="dir%d(nDir)"> |
| 909 | }else{ |
| 910 | @ <ul id="dir%d(nDir)" class="collapsed"> |
| 911 | } |
| 912 | nDir++; |
| 913 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -894,19 +894,19 @@ | |
| 894 | relinkTree(&sTree, p); |
| 895 | } |
| 896 | for(p=sTree.pFirst, nDir=0; p; p=p->pNext){ |
| 897 | const char *zLastClass = p->pSibling==0 ? " last" : ""; |
| 898 | if( p->pChild ){ |
| 899 | const char *zSubdirClass = (int)(p->nFullName)==nD-1 ? " subdir" : ""; |
| 900 | @ <li class="dir%s(zSubdirClass)%s(zLastClass)"><div class="filetreeline"> |
| 901 | @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a> |
| 902 | if( p->mtime>0.0 ){ |
| 903 | char *zAge = human_readable_age(rNow - p->mtime); |
| 904 | @ <div class="filetreeage">%s(zAge)</div> |
| 905 | } |
| 906 | @ </div> |
| 907 | if( startExpanded || (int)(p->nFullName)<=nD ){ |
| 908 | @ <ul id="dir%d(nDir)"> |
| 909 | }else{ |
| 910 | @ <ul id="dir%d(nDir)" class="collapsed"> |
| 911 | } |
| 912 | nDir++; |
| 913 |
+2
-2
| --- src/capabilities.c | ||
| +++ src/capabilities.c | ||
| @@ -323,11 +323,11 @@ | ||
| 323 | 323 | if( done ) return; |
| 324 | 324 | db_prepare(&q, "SELECT fullcap(cap) FROM user"); |
| 325 | 325 | while( db_step(&q)==SQLITE_ROW ){ |
| 326 | 326 | const char *zCap = db_column_text(&q, 0); |
| 327 | 327 | if( zCap==0 || zCap[0]==0 ) continue; |
| 328 | - for(i=0; i<sizeof(aCap)/sizeof(aCap[0]); i++){ | |
| 328 | + for(i=0; i<(int)(sizeof(aCap)/sizeof(aCap[0])); i++){ | |
| 329 | 329 | if( strchr(zCap, aCap[i].cCap) ) aCap[i].nUser++; |
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | db_finalize(&q); |
| 333 | 333 | done = 1; |
| @@ -341,11 +341,11 @@ | ||
| 341 | 341 | void capabilities_table(unsigned mClass){ |
| 342 | 342 | int i; |
| 343 | 343 | if( g.perm.Admin ) capabilities_count(); |
| 344 | 344 | @ <table> |
| 345 | 345 | @ <tbody> |
| 346 | - for(i=0; i<sizeof(aCap)/sizeof(aCap[0]); i++){ | |
| 346 | + for(i=0; i<(int)(sizeof(aCap)/sizeof(aCap[0])); i++){ | |
| 347 | 347 | int n; |
| 348 | 348 | if( (aCap[i].eClass & mClass)==0 ) continue; |
| 349 | 349 | @ <tr><th valign="top">%c(aCap[i].cCap)</th> |
| 350 | 350 | @ <td>%h(aCap[i].zAbbrev)</td><td>%h(aCap[i].zOneLiner)</td>\ |
| 351 | 351 | n = aCap[i].nUser; |
| 352 | 352 |
| --- src/capabilities.c | |
| +++ src/capabilities.c | |
| @@ -323,11 +323,11 @@ | |
| 323 | if( done ) return; |
| 324 | db_prepare(&q, "SELECT fullcap(cap) FROM user"); |
| 325 | while( db_step(&q)==SQLITE_ROW ){ |
| 326 | const char *zCap = db_column_text(&q, 0); |
| 327 | if( zCap==0 || zCap[0]==0 ) continue; |
| 328 | for(i=0; i<sizeof(aCap)/sizeof(aCap[0]); i++){ |
| 329 | if( strchr(zCap, aCap[i].cCap) ) aCap[i].nUser++; |
| 330 | } |
| 331 | } |
| 332 | db_finalize(&q); |
| 333 | done = 1; |
| @@ -341,11 +341,11 @@ | |
| 341 | void capabilities_table(unsigned mClass){ |
| 342 | int i; |
| 343 | if( g.perm.Admin ) capabilities_count(); |
| 344 | @ <table> |
| 345 | @ <tbody> |
| 346 | for(i=0; i<sizeof(aCap)/sizeof(aCap[0]); i++){ |
| 347 | int n; |
| 348 | if( (aCap[i].eClass & mClass)==0 ) continue; |
| 349 | @ <tr><th valign="top">%c(aCap[i].cCap)</th> |
| 350 | @ <td>%h(aCap[i].zAbbrev)</td><td>%h(aCap[i].zOneLiner)</td>\ |
| 351 | n = aCap[i].nUser; |
| 352 |
| --- src/capabilities.c | |
| +++ src/capabilities.c | |
| @@ -323,11 +323,11 @@ | |
| 323 | if( done ) return; |
| 324 | db_prepare(&q, "SELECT fullcap(cap) FROM user"); |
| 325 | while( db_step(&q)==SQLITE_ROW ){ |
| 326 | const char *zCap = db_column_text(&q, 0); |
| 327 | if( zCap==0 || zCap[0]==0 ) continue; |
| 328 | for(i=0; i<(int)(sizeof(aCap)/sizeof(aCap[0])); i++){ |
| 329 | if( strchr(zCap, aCap[i].cCap) ) aCap[i].nUser++; |
| 330 | } |
| 331 | } |
| 332 | db_finalize(&q); |
| 333 | done = 1; |
| @@ -341,11 +341,11 @@ | |
| 341 | void capabilities_table(unsigned mClass){ |
| 342 | int i; |
| 343 | if( g.perm.Admin ) capabilities_count(); |
| 344 | @ <table> |
| 345 | @ <tbody> |
| 346 | for(i=0; i<(int)(sizeof(aCap)/sizeof(aCap[0])); i++){ |
| 347 | int n; |
| 348 | if( (aCap[i].eClass & mClass)==0 ) continue; |
| 349 | @ <tr><th valign="top">%c(aCap[i].cCap)</th> |
| 350 | @ <td>%h(aCap[i].zAbbrev)</td><td>%h(aCap[i].zOneLiner)</td>\ |
| 351 | n = aCap[i].nUser; |
| 352 |
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -2400,11 +2400,11 @@ | ||
| 2400 | 2400 | while( iPort<=mxPort ){ |
| 2401 | 2401 | memset(&inaddr, 0, sizeof(inaddr)); |
| 2402 | 2402 | inaddr.sin_family = AF_INET; |
| 2403 | 2403 | if( zIpAddr ){ |
| 2404 | 2404 | inaddr.sin_addr.s_addr = inet_addr(zIpAddr); |
| 2405 | - if( inaddr.sin_addr.s_addr == (-1) ){ | |
| 2405 | + if( inaddr.sin_addr.s_addr == INADDR_NONE ){ | |
| 2406 | 2406 | fossil_fatal("not a valid IP address: %s", zIpAddr); |
| 2407 | 2407 | } |
| 2408 | 2408 | }else if( flags & HTTP_SERVER_LOCALHOST ){ |
| 2409 | 2409 | inaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); |
| 2410 | 2410 | }else{ |
| 2411 | 2411 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -2400,11 +2400,11 @@ | |
| 2400 | while( iPort<=mxPort ){ |
| 2401 | memset(&inaddr, 0, sizeof(inaddr)); |
| 2402 | inaddr.sin_family = AF_INET; |
| 2403 | if( zIpAddr ){ |
| 2404 | inaddr.sin_addr.s_addr = inet_addr(zIpAddr); |
| 2405 | if( inaddr.sin_addr.s_addr == (-1) ){ |
| 2406 | fossil_fatal("not a valid IP address: %s", zIpAddr); |
| 2407 | } |
| 2408 | }else if( flags & HTTP_SERVER_LOCALHOST ){ |
| 2409 | inaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); |
| 2410 | }else{ |
| 2411 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -2400,11 +2400,11 @@ | |
| 2400 | while( iPort<=mxPort ){ |
| 2401 | memset(&inaddr, 0, sizeof(inaddr)); |
| 2402 | inaddr.sin_family = AF_INET; |
| 2403 | if( zIpAddr ){ |
| 2404 | inaddr.sin_addr.s_addr = inet_addr(zIpAddr); |
| 2405 | if( inaddr.sin_addr.s_addr == INADDR_NONE ){ |
| 2406 | fossil_fatal("not a valid IP address: %s", zIpAddr); |
| 2407 | } |
| 2408 | }else if( flags & HTTP_SERVER_LOCALHOST ){ |
| 2409 | inaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); |
| 2410 | }else{ |
| 2411 |
+4
-4
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -213,21 +213,21 @@ | ||
| 213 | 213 | if( lineChars<=0 ) return; |
| 214 | 214 | #if 0 |
| 215 | 215 | assert( indent<sizeof(zBuf)-5 ); /* See following comments to explain */ |
| 216 | 216 | assert( origIndent<sizeof(zBuf)-5 ); /* these limits. */ |
| 217 | 217 | #endif |
| 218 | - if( indent>sizeof(zBuf)-6 ){ | |
| 218 | + if( indent>(int)sizeof(zBuf)-6 ){ | |
| 219 | 219 | /* Limit initial indent to fit output buffer. */ |
| 220 | 220 | indent = sizeof(zBuf)-6; |
| 221 | 221 | } |
| 222 | 222 | comment_calc_indent(zLine, indent, trimCrLf, trimSpace, &index); |
| 223 | 223 | if( indent>0 ){ |
| 224 | 224 | for(i=0; i<indent; i++){ |
| 225 | 225 | zBuf[iBuf++] = ' '; |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | - if( origIndent>sizeof(zBuf)-6 ){ | |
| 228 | + if( origIndent>(int)sizeof(zBuf)-6 ){ | |
| 229 | 229 | /* Limit line indent to fit output buffer. */ |
| 230 | 230 | origIndent = sizeof(zBuf)-6; |
| 231 | 231 | } |
| 232 | 232 | maxChars = lineChars; |
| 233 | 233 | for(;;){ |
| @@ -234,11 +234,11 @@ | ||
| 234 | 234 | int useChars = 1; |
| 235 | 235 | char c = zLine[index]; |
| 236 | 236 | /* Flush the output buffer if there's no space left for at least one more |
| 237 | 237 | ** (potentially 4-byte) UTF-8 sequence, one level of indentation spaces, |
| 238 | 238 | ** a new line, and a terminating NULL. */ |
| 239 | - if( iBuf>sizeof(zBuf)-origIndent-6 ){ | |
| 239 | + if( iBuf>(int)sizeof(zBuf)-origIndent-6 ){ | |
| 240 | 240 | zBuf[iBuf]=0; |
| 241 | 241 | iBuf=0; |
| 242 | 242 | fossil_print("%s", zBuf); |
| 243 | 243 | } |
| 244 | 244 | if( c==0 ){ |
| @@ -348,11 +348,11 @@ | ||
| 348 | 348 | if( zText==0 ) zText = "(NULL)"; |
| 349 | 349 | if( maxChars<=0 ){ |
| 350 | 350 | maxChars = strlen(zText); |
| 351 | 351 | } |
| 352 | 352 | /* Ensure the buffer can hold the longest-possible UTF-8 sequences. */ |
| 353 | - if( maxChars >= (sizeof(zBuffer)/4-1) ){ | |
| 353 | + if( maxChars >= ((int)sizeof(zBuffer)/4-1) ){ | |
| 354 | 354 | zBuf = fossil_malloc(maxChars*4+1); |
| 355 | 355 | }else{ |
| 356 | 356 | zBuf = zBuffer; |
| 357 | 357 | } |
| 358 | 358 | for(;;){ |
| 359 | 359 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -213,21 +213,21 @@ | |
| 213 | if( lineChars<=0 ) return; |
| 214 | #if 0 |
| 215 | assert( indent<sizeof(zBuf)-5 ); /* See following comments to explain */ |
| 216 | assert( origIndent<sizeof(zBuf)-5 ); /* these limits. */ |
| 217 | #endif |
| 218 | if( indent>sizeof(zBuf)-6 ){ |
| 219 | /* Limit initial indent to fit output buffer. */ |
| 220 | indent = sizeof(zBuf)-6; |
| 221 | } |
| 222 | comment_calc_indent(zLine, indent, trimCrLf, trimSpace, &index); |
| 223 | if( indent>0 ){ |
| 224 | for(i=0; i<indent; i++){ |
| 225 | zBuf[iBuf++] = ' '; |
| 226 | } |
| 227 | } |
| 228 | if( origIndent>sizeof(zBuf)-6 ){ |
| 229 | /* Limit line indent to fit output buffer. */ |
| 230 | origIndent = sizeof(zBuf)-6; |
| 231 | } |
| 232 | maxChars = lineChars; |
| 233 | for(;;){ |
| @@ -234,11 +234,11 @@ | |
| 234 | int useChars = 1; |
| 235 | char c = zLine[index]; |
| 236 | /* Flush the output buffer if there's no space left for at least one more |
| 237 | ** (potentially 4-byte) UTF-8 sequence, one level of indentation spaces, |
| 238 | ** a new line, and a terminating NULL. */ |
| 239 | if( iBuf>sizeof(zBuf)-origIndent-6 ){ |
| 240 | zBuf[iBuf]=0; |
| 241 | iBuf=0; |
| 242 | fossil_print("%s", zBuf); |
| 243 | } |
| 244 | if( c==0 ){ |
| @@ -348,11 +348,11 @@ | |
| 348 | if( zText==0 ) zText = "(NULL)"; |
| 349 | if( maxChars<=0 ){ |
| 350 | maxChars = strlen(zText); |
| 351 | } |
| 352 | /* Ensure the buffer can hold the longest-possible UTF-8 sequences. */ |
| 353 | if( maxChars >= (sizeof(zBuffer)/4-1) ){ |
| 354 | zBuf = fossil_malloc(maxChars*4+1); |
| 355 | }else{ |
| 356 | zBuf = zBuffer; |
| 357 | } |
| 358 | for(;;){ |
| 359 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -213,21 +213,21 @@ | |
| 213 | if( lineChars<=0 ) return; |
| 214 | #if 0 |
| 215 | assert( indent<sizeof(zBuf)-5 ); /* See following comments to explain */ |
| 216 | assert( origIndent<sizeof(zBuf)-5 ); /* these limits. */ |
| 217 | #endif |
| 218 | if( indent>(int)sizeof(zBuf)-6 ){ |
| 219 | /* Limit initial indent to fit output buffer. */ |
| 220 | indent = sizeof(zBuf)-6; |
| 221 | } |
| 222 | comment_calc_indent(zLine, indent, trimCrLf, trimSpace, &index); |
| 223 | if( indent>0 ){ |
| 224 | for(i=0; i<indent; i++){ |
| 225 | zBuf[iBuf++] = ' '; |
| 226 | } |
| 227 | } |
| 228 | if( origIndent>(int)sizeof(zBuf)-6 ){ |
| 229 | /* Limit line indent to fit output buffer. */ |
| 230 | origIndent = sizeof(zBuf)-6; |
| 231 | } |
| 232 | maxChars = lineChars; |
| 233 | for(;;){ |
| @@ -234,11 +234,11 @@ | |
| 234 | int useChars = 1; |
| 235 | char c = zLine[index]; |
| 236 | /* Flush the output buffer if there's no space left for at least one more |
| 237 | ** (potentially 4-byte) UTF-8 sequence, one level of indentation spaces, |
| 238 | ** a new line, and a terminating NULL. */ |
| 239 | if( iBuf>(int)sizeof(zBuf)-origIndent-6 ){ |
| 240 | zBuf[iBuf]=0; |
| 241 | iBuf=0; |
| 242 | fossil_print("%s", zBuf); |
| 243 | } |
| 244 | if( c==0 ){ |
| @@ -348,11 +348,11 @@ | |
| 348 | if( zText==0 ) zText = "(NULL)"; |
| 349 | if( maxChars<=0 ){ |
| 350 | maxChars = strlen(zText); |
| 351 | } |
| 352 | /* Ensure the buffer can hold the longest-possible UTF-8 sequences. */ |
| 353 | if( maxChars >= ((int)sizeof(zBuffer)/4-1) ){ |
| 354 | zBuf = fossil_malloc(maxChars*4+1); |
| 355 | }else{ |
| 356 | zBuf = zBuffer; |
| 357 | } |
| 358 | for(;;){ |
| 359 |
+2
-2
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -1029,11 +1029,11 @@ | ||
| 1029 | 1029 | if( size<0 ){ |
| 1030 | 1030 | fossil_print("skip phantom %d %s\n", rid, zUuid); |
| 1031 | 1031 | continue; /* Ignore phantoms */ |
| 1032 | 1032 | } |
| 1033 | 1033 | content_get(rid, &content); |
| 1034 | - if( blob_size(&content)!=size ){ | |
| 1034 | + if( (int)blob_size(&content)!=size ){ | |
| 1035 | 1035 | fossil_print("size mismatch on artifact %d: wanted %d but got %d\n", |
| 1036 | 1036 | rid, size, blob_size(&content)); |
| 1037 | 1037 | nErr++; |
| 1038 | 1038 | } |
| 1039 | 1039 | if( !hname_verify_hash(&content, zUuid, nUuid) ){ |
| @@ -1048,11 +1048,11 @@ | ||
| 1048 | 1048 | char zFirstLine[400]; |
| 1049 | 1049 | blob_zero(&err); |
| 1050 | 1050 | |
| 1051 | 1051 | z = blob_buffer(&content); |
| 1052 | 1052 | n = blob_size(&content); |
| 1053 | - for(i=0; i<n && z[i] && z[i]!='\n' && i<sizeof(zFirstLine)-1; i++){} | |
| 1053 | + for(i=0; i<n && z[i] && z[i]!='\n' && i<(int)sizeof(zFirstLine)-1; i++){} | |
| 1054 | 1054 | memcpy(zFirstLine, z, i); |
| 1055 | 1055 | zFirstLine[i] = 0; |
| 1056 | 1056 | p = manifest_parse(&content, 0, &err); |
| 1057 | 1057 | if( p==0 ){ |
| 1058 | 1058 | fossil_print("manifest_parse failed for %s:\n%s\n", |
| 1059 | 1059 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -1029,11 +1029,11 @@ | |
| 1029 | if( size<0 ){ |
| 1030 | fossil_print("skip phantom %d %s\n", rid, zUuid); |
| 1031 | continue; /* Ignore phantoms */ |
| 1032 | } |
| 1033 | content_get(rid, &content); |
| 1034 | if( blob_size(&content)!=size ){ |
| 1035 | fossil_print("size mismatch on artifact %d: wanted %d but got %d\n", |
| 1036 | rid, size, blob_size(&content)); |
| 1037 | nErr++; |
| 1038 | } |
| 1039 | if( !hname_verify_hash(&content, zUuid, nUuid) ){ |
| @@ -1048,11 +1048,11 @@ | |
| 1048 | char zFirstLine[400]; |
| 1049 | blob_zero(&err); |
| 1050 | |
| 1051 | z = blob_buffer(&content); |
| 1052 | n = blob_size(&content); |
| 1053 | for(i=0; i<n && z[i] && z[i]!='\n' && i<sizeof(zFirstLine)-1; i++){} |
| 1054 | memcpy(zFirstLine, z, i); |
| 1055 | zFirstLine[i] = 0; |
| 1056 | p = manifest_parse(&content, 0, &err); |
| 1057 | if( p==0 ){ |
| 1058 | fossil_print("manifest_parse failed for %s:\n%s\n", |
| 1059 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -1029,11 +1029,11 @@ | |
| 1029 | if( size<0 ){ |
| 1030 | fossil_print("skip phantom %d %s\n", rid, zUuid); |
| 1031 | continue; /* Ignore phantoms */ |
| 1032 | } |
| 1033 | content_get(rid, &content); |
| 1034 | if( (int)blob_size(&content)!=size ){ |
| 1035 | fossil_print("size mismatch on artifact %d: wanted %d but got %d\n", |
| 1036 | rid, size, blob_size(&content)); |
| 1037 | nErr++; |
| 1038 | } |
| 1039 | if( !hname_verify_hash(&content, zUuid, nUuid) ){ |
| @@ -1048,11 +1048,11 @@ | |
| 1048 | char zFirstLine[400]; |
| 1049 | blob_zero(&err); |
| 1050 | |
| 1051 | z = blob_buffer(&content); |
| 1052 | n = blob_size(&content); |
| 1053 | for(i=0; i<n && z[i] && z[i]!='\n' && i<(int)sizeof(zFirstLine)-1; i++){} |
| 1054 | memcpy(zFirstLine, z, i); |
| 1055 | zFirstLine[i] = 0; |
| 1056 | p = manifest_parse(&content, 0, &err); |
| 1057 | if( p==0 ){ |
| 1058 | fossil_print("manifest_parse failed for %s:\n%s\n", |
| 1059 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -4746,11 +4746,11 @@ | ||
| 4746 | 4746 | if( globalFlag && fossil_strcmp(pSetting->name, "manifest")==0 ){ |
| 4747 | 4747 | fossil_fatal("cannot set 'manifest' globally"); |
| 4748 | 4748 | } |
| 4749 | 4749 | if( unsetFlag || g.argc==4 ){ |
| 4750 | 4750 | int isManifest = fossil_strcmp(pSetting->name, "manifest")==0; |
| 4751 | - if( n!=strlen(pSetting[0].name) && pSetting[1].name && | |
| 4751 | + if( n!=(int)strlen(pSetting[0].name) && pSetting[1].name && | |
| 4752 | 4752 | fossil_strncmp(pSetting[1].name, zName, n)==0 ){ |
| 4753 | 4753 | Blob x; |
| 4754 | 4754 | int i; |
| 4755 | 4755 | blob_init(&x,0,0); |
| 4756 | 4756 | for(i=0; pSetting[i].name; i++){ |
| 4757 | 4757 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -4746,11 +4746,11 @@ | |
| 4746 | if( globalFlag && fossil_strcmp(pSetting->name, "manifest")==0 ){ |
| 4747 | fossil_fatal("cannot set 'manifest' globally"); |
| 4748 | } |
| 4749 | if( unsetFlag || g.argc==4 ){ |
| 4750 | int isManifest = fossil_strcmp(pSetting->name, "manifest")==0; |
| 4751 | if( n!=strlen(pSetting[0].name) && pSetting[1].name && |
| 4752 | fossil_strncmp(pSetting[1].name, zName, n)==0 ){ |
| 4753 | Blob x; |
| 4754 | int i; |
| 4755 | blob_init(&x,0,0); |
| 4756 | for(i=0; pSetting[i].name; i++){ |
| 4757 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -4746,11 +4746,11 @@ | |
| 4746 | if( globalFlag && fossil_strcmp(pSetting->name, "manifest")==0 ){ |
| 4747 | fossil_fatal("cannot set 'manifest' globally"); |
| 4748 | } |
| 4749 | if( unsetFlag || g.argc==4 ){ |
| 4750 | int isManifest = fossil_strcmp(pSetting->name, "manifest")==0; |
| 4751 | if( n!=(int)strlen(pSetting[0].name) && pSetting[1].name && |
| 4752 | fossil_strncmp(pSetting[1].name, zName, n)==0 ){ |
| 4753 | Blob x; |
| 4754 | int i; |
| 4755 | blob_init(&x,0,0); |
| 4756 | for(i=0; pSetting[i].name; i++){ |
| 4757 |
+11
-10
| --- src/delta.c | ||
| +++ src/delta.c | ||
| @@ -204,11 +204,12 @@ | ||
| 204 | 204 | |
| 205 | 205 | /* |
| 206 | 206 | ** Return the number digits in the base-64 representation of a positive integer |
| 207 | 207 | */ |
| 208 | 208 | static int digit_count(int v){ |
| 209 | - unsigned int i, x; | |
| 209 | + unsigned int i; | |
| 210 | + int x; | |
| 210 | 211 | for(i=1, x=64; v>=x; i++, x <<= 6){} |
| 211 | 212 | return i; |
| 212 | 213 | } |
| 213 | 214 | |
| 214 | 215 | #ifdef __GNUC__ |
| @@ -379,21 +380,21 @@ | ||
| 379 | 380 | */ |
| 380 | 381 | nHash = lenSrc/NHASH; |
| 381 | 382 | collide = fossil_malloc( nHash*2*sizeof(int) ); |
| 382 | 383 | memset(collide, -1, nHash*2*sizeof(int)); |
| 383 | 384 | landmark = &collide[nHash]; |
| 384 | - for(i=0; i<lenSrc-NHASH; i+=NHASH){ | |
| 385 | + for(i=0; i<(int)lenSrc-NHASH; i+=NHASH){ | |
| 385 | 386 | int hv = hash_once(&zSrc[i]) % nHash; |
| 386 | 387 | collide[i/NHASH] = landmark[hv]; |
| 387 | 388 | landmark[hv] = i/NHASH; |
| 388 | 389 | } |
| 389 | 390 | |
| 390 | 391 | /* Begin scanning the target file and generating copy commands and |
| 391 | 392 | ** literal sections of the delta. |
| 392 | 393 | */ |
| 393 | 394 | base = 0; /* We have already generated everything before zOut[base] */ |
| 394 | - while( base+NHASH<lenOut ){ | |
| 395 | + while( base+NHASH<(int)lenOut ){ | |
| 395 | 396 | int iSrc, iBlock; |
| 396 | 397 | unsigned int bestCnt, bestOfst=0, bestLitsz=0; |
| 397 | 398 | hash_init(&h, &zOut[base]); |
| 398 | 399 | i = 0; /* Trying to match a landmark against zOut[base+i] */ |
| 399 | 400 | bestCnt = 0; |
| @@ -449,11 +450,11 @@ | ||
| 449 | 450 | DEBUG2( printf("MATCH %d bytes at %d: [%s] litsz=%d\n", |
| 450 | 451 | cnt, ofst, print16(&zSrc[ofst]), litsz); ) |
| 451 | 452 | /* sz will hold the number of bytes needed to encode the "insert" |
| 452 | 453 | ** command and the copy command, not counting the "insert" text */ |
| 453 | 454 | sz = digit_count(i-k)+digit_count(cnt)+digit_count(ofst)+3; |
| 454 | - if( cnt>=sz && cnt>bestCnt ){ | |
| 455 | + if( cnt>=sz && cnt>(int)bestCnt ){ | |
| 455 | 456 | /* Remember this match only if it is the best so far and it |
| 456 | 457 | ** does not increase the file size */ |
| 457 | 458 | bestCnt = cnt; |
| 458 | 459 | bestOfst = iSrc-k; |
| 459 | 460 | bestLitsz = litsz; |
| @@ -481,20 +482,20 @@ | ||
| 481 | 482 | putInt(bestCnt, &zDelta); |
| 482 | 483 | *(zDelta++) = '@'; |
| 483 | 484 | putInt(bestOfst, &zDelta); |
| 484 | 485 | DEBUG2( printf("copy %d bytes from %d\n", bestCnt, bestOfst); ) |
| 485 | 486 | *(zDelta++) = ','; |
| 486 | - if( bestOfst + bestCnt -1 > lastRead ){ | |
| 487 | + if( (int)(bestOfst + bestCnt -1) > lastRead ){ | |
| 487 | 488 | lastRead = bestOfst + bestCnt - 1; |
| 488 | 489 | DEBUG2( printf("lastRead becomes %d\n", lastRead); ) |
| 489 | 490 | } |
| 490 | 491 | bestCnt = 0; |
| 491 | 492 | break; |
| 492 | 493 | } |
| 493 | 494 | |
| 494 | 495 | /* If we reach this point, it means no match is found so far */ |
| 495 | - if( base+i+NHASH>=lenOut ){ | |
| 496 | + if( base+i+NHASH>=(int)lenOut ){ | |
| 496 | 497 | /* We have reached the end of the file and have not found any |
| 497 | 498 | ** matches. Do an "insert" for everything that does not match */ |
| 498 | 499 | putInt(lenOut-base, &zDelta); |
| 499 | 500 | *(zDelta++) = ':'; |
| 500 | 501 | memcpy(zDelta, &zOut[base], lenOut-base); |
| @@ -509,11 +510,11 @@ | ||
| 509 | 510 | } |
| 510 | 511 | } |
| 511 | 512 | /* Output a final "insert" record to get all the text at the end of |
| 512 | 513 | ** the file that does not match anything in the source file. |
| 513 | 514 | */ |
| 514 | - if( base<lenOut ){ | |
| 515 | + if( base<(int)lenOut ){ | |
| 515 | 516 | putInt(lenOut-base, &zDelta); |
| 516 | 517 | *(zDelta++) = ':'; |
| 517 | 518 | memcpy(zDelta, &zOut[base], lenOut-base); |
| 518 | 519 | zDelta += lenOut-base; |
| 519 | 520 | } |
| @@ -599,11 +600,11 @@ | ||
| 599 | 600 | total += cnt; |
| 600 | 601 | if( total>limit ){ |
| 601 | 602 | /* ERROR: copy exceeds output file size */ |
| 602 | 603 | return -1; |
| 603 | 604 | } |
| 604 | - if( ofst+cnt > lenSrc ){ | |
| 605 | + if( (int)(ofst+cnt) > lenSrc ){ | |
| 605 | 606 | /* ERROR: copy extends past end of input */ |
| 606 | 607 | return -1; |
| 607 | 608 | } |
| 608 | 609 | memcpy(zOut, &zSrc[ofst], cnt); |
| 609 | 610 | zOut += cnt; |
| @@ -615,11 +616,11 @@ | ||
| 615 | 616 | if( total>limit ){ |
| 616 | 617 | /* ERROR: insert command gives an output larger than predicted */ |
| 617 | 618 | return -1; |
| 618 | 619 | } |
| 619 | 620 | DEBUG1( printf("INSERT %d\n", cnt); ) |
| 620 | - if( cnt>lenDelta ){ | |
| 621 | + if( (int)cnt>lenDelta ){ | |
| 621 | 622 | /* ERROR: insert count exceeds size of delta */ |
| 622 | 623 | return -1; |
| 623 | 624 | } |
| 624 | 625 | memcpy(zOut, zDelta, cnt); |
| 625 | 626 | zOut += cnt; |
| @@ -688,11 +689,11 @@ | ||
| 688 | 689 | break; |
| 689 | 690 | } |
| 690 | 691 | case ':': { |
| 691 | 692 | zDelta++; lenDelta--; |
| 692 | 693 | nInsert += cnt; |
| 693 | - if( cnt>lenDelta ){ | |
| 694 | + if( (int)cnt>lenDelta ){ | |
| 694 | 695 | /* ERROR: insert count exceeds size of delta */ |
| 695 | 696 | return -1; |
| 696 | 697 | } |
| 697 | 698 | zDelta += cnt; |
| 698 | 699 | lenDelta -= cnt; |
| 699 | 700 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -204,11 +204,12 @@ | |
| 204 | |
| 205 | /* |
| 206 | ** Return the number digits in the base-64 representation of a positive integer |
| 207 | */ |
| 208 | static int digit_count(int v){ |
| 209 | unsigned int i, x; |
| 210 | for(i=1, x=64; v>=x; i++, x <<= 6){} |
| 211 | return i; |
| 212 | } |
| 213 | |
| 214 | #ifdef __GNUC__ |
| @@ -379,21 +380,21 @@ | |
| 379 | */ |
| 380 | nHash = lenSrc/NHASH; |
| 381 | collide = fossil_malloc( nHash*2*sizeof(int) ); |
| 382 | memset(collide, -1, nHash*2*sizeof(int)); |
| 383 | landmark = &collide[nHash]; |
| 384 | for(i=0; i<lenSrc-NHASH; i+=NHASH){ |
| 385 | int hv = hash_once(&zSrc[i]) % nHash; |
| 386 | collide[i/NHASH] = landmark[hv]; |
| 387 | landmark[hv] = i/NHASH; |
| 388 | } |
| 389 | |
| 390 | /* Begin scanning the target file and generating copy commands and |
| 391 | ** literal sections of the delta. |
| 392 | */ |
| 393 | base = 0; /* We have already generated everything before zOut[base] */ |
| 394 | while( base+NHASH<lenOut ){ |
| 395 | int iSrc, iBlock; |
| 396 | unsigned int bestCnt, bestOfst=0, bestLitsz=0; |
| 397 | hash_init(&h, &zOut[base]); |
| 398 | i = 0; /* Trying to match a landmark against zOut[base+i] */ |
| 399 | bestCnt = 0; |
| @@ -449,11 +450,11 @@ | |
| 449 | DEBUG2( printf("MATCH %d bytes at %d: [%s] litsz=%d\n", |
| 450 | cnt, ofst, print16(&zSrc[ofst]), litsz); ) |
| 451 | /* sz will hold the number of bytes needed to encode the "insert" |
| 452 | ** command and the copy command, not counting the "insert" text */ |
| 453 | sz = digit_count(i-k)+digit_count(cnt)+digit_count(ofst)+3; |
| 454 | if( cnt>=sz && cnt>bestCnt ){ |
| 455 | /* Remember this match only if it is the best so far and it |
| 456 | ** does not increase the file size */ |
| 457 | bestCnt = cnt; |
| 458 | bestOfst = iSrc-k; |
| 459 | bestLitsz = litsz; |
| @@ -481,20 +482,20 @@ | |
| 481 | putInt(bestCnt, &zDelta); |
| 482 | *(zDelta++) = '@'; |
| 483 | putInt(bestOfst, &zDelta); |
| 484 | DEBUG2( printf("copy %d bytes from %d\n", bestCnt, bestOfst); ) |
| 485 | *(zDelta++) = ','; |
| 486 | if( bestOfst + bestCnt -1 > lastRead ){ |
| 487 | lastRead = bestOfst + bestCnt - 1; |
| 488 | DEBUG2( printf("lastRead becomes %d\n", lastRead); ) |
| 489 | } |
| 490 | bestCnt = 0; |
| 491 | break; |
| 492 | } |
| 493 | |
| 494 | /* If we reach this point, it means no match is found so far */ |
| 495 | if( base+i+NHASH>=lenOut ){ |
| 496 | /* We have reached the end of the file and have not found any |
| 497 | ** matches. Do an "insert" for everything that does not match */ |
| 498 | putInt(lenOut-base, &zDelta); |
| 499 | *(zDelta++) = ':'; |
| 500 | memcpy(zDelta, &zOut[base], lenOut-base); |
| @@ -509,11 +510,11 @@ | |
| 509 | } |
| 510 | } |
| 511 | /* Output a final "insert" record to get all the text at the end of |
| 512 | ** the file that does not match anything in the source file. |
| 513 | */ |
| 514 | if( base<lenOut ){ |
| 515 | putInt(lenOut-base, &zDelta); |
| 516 | *(zDelta++) = ':'; |
| 517 | memcpy(zDelta, &zOut[base], lenOut-base); |
| 518 | zDelta += lenOut-base; |
| 519 | } |
| @@ -599,11 +600,11 @@ | |
| 599 | total += cnt; |
| 600 | if( total>limit ){ |
| 601 | /* ERROR: copy exceeds output file size */ |
| 602 | return -1; |
| 603 | } |
| 604 | if( ofst+cnt > lenSrc ){ |
| 605 | /* ERROR: copy extends past end of input */ |
| 606 | return -1; |
| 607 | } |
| 608 | memcpy(zOut, &zSrc[ofst], cnt); |
| 609 | zOut += cnt; |
| @@ -615,11 +616,11 @@ | |
| 615 | if( total>limit ){ |
| 616 | /* ERROR: insert command gives an output larger than predicted */ |
| 617 | return -1; |
| 618 | } |
| 619 | DEBUG1( printf("INSERT %d\n", cnt); ) |
| 620 | if( cnt>lenDelta ){ |
| 621 | /* ERROR: insert count exceeds size of delta */ |
| 622 | return -1; |
| 623 | } |
| 624 | memcpy(zOut, zDelta, cnt); |
| 625 | zOut += cnt; |
| @@ -688,11 +689,11 @@ | |
| 688 | break; |
| 689 | } |
| 690 | case ':': { |
| 691 | zDelta++; lenDelta--; |
| 692 | nInsert += cnt; |
| 693 | if( cnt>lenDelta ){ |
| 694 | /* ERROR: insert count exceeds size of delta */ |
| 695 | return -1; |
| 696 | } |
| 697 | zDelta += cnt; |
| 698 | lenDelta -= cnt; |
| 699 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -204,11 +204,12 @@ | |
| 204 | |
| 205 | /* |
| 206 | ** Return the number digits in the base-64 representation of a positive integer |
| 207 | */ |
| 208 | static int digit_count(int v){ |
| 209 | unsigned int i; |
| 210 | int x; |
| 211 | for(i=1, x=64; v>=x; i++, x <<= 6){} |
| 212 | return i; |
| 213 | } |
| 214 | |
| 215 | #ifdef __GNUC__ |
| @@ -379,21 +380,21 @@ | |
| 380 | */ |
| 381 | nHash = lenSrc/NHASH; |
| 382 | collide = fossil_malloc( nHash*2*sizeof(int) ); |
| 383 | memset(collide, -1, nHash*2*sizeof(int)); |
| 384 | landmark = &collide[nHash]; |
| 385 | for(i=0; i<(int)lenSrc-NHASH; i+=NHASH){ |
| 386 | int hv = hash_once(&zSrc[i]) % nHash; |
| 387 | collide[i/NHASH] = landmark[hv]; |
| 388 | landmark[hv] = i/NHASH; |
| 389 | } |
| 390 | |
| 391 | /* Begin scanning the target file and generating copy commands and |
| 392 | ** literal sections of the delta. |
| 393 | */ |
| 394 | base = 0; /* We have already generated everything before zOut[base] */ |
| 395 | while( base+NHASH<(int)lenOut ){ |
| 396 | int iSrc, iBlock; |
| 397 | unsigned int bestCnt, bestOfst=0, bestLitsz=0; |
| 398 | hash_init(&h, &zOut[base]); |
| 399 | i = 0; /* Trying to match a landmark against zOut[base+i] */ |
| 400 | bestCnt = 0; |
| @@ -449,11 +450,11 @@ | |
| 450 | DEBUG2( printf("MATCH %d bytes at %d: [%s] litsz=%d\n", |
| 451 | cnt, ofst, print16(&zSrc[ofst]), litsz); ) |
| 452 | /* sz will hold the number of bytes needed to encode the "insert" |
| 453 | ** command and the copy command, not counting the "insert" text */ |
| 454 | sz = digit_count(i-k)+digit_count(cnt)+digit_count(ofst)+3; |
| 455 | if( cnt>=sz && cnt>(int)bestCnt ){ |
| 456 | /* Remember this match only if it is the best so far and it |
| 457 | ** does not increase the file size */ |
| 458 | bestCnt = cnt; |
| 459 | bestOfst = iSrc-k; |
| 460 | bestLitsz = litsz; |
| @@ -481,20 +482,20 @@ | |
| 482 | putInt(bestCnt, &zDelta); |
| 483 | *(zDelta++) = '@'; |
| 484 | putInt(bestOfst, &zDelta); |
| 485 | DEBUG2( printf("copy %d bytes from %d\n", bestCnt, bestOfst); ) |
| 486 | *(zDelta++) = ','; |
| 487 | if( (int)(bestOfst + bestCnt -1) > lastRead ){ |
| 488 | lastRead = bestOfst + bestCnt - 1; |
| 489 | DEBUG2( printf("lastRead becomes %d\n", lastRead); ) |
| 490 | } |
| 491 | bestCnt = 0; |
| 492 | break; |
| 493 | } |
| 494 | |
| 495 | /* If we reach this point, it means no match is found so far */ |
| 496 | if( base+i+NHASH>=(int)lenOut ){ |
| 497 | /* We have reached the end of the file and have not found any |
| 498 | ** matches. Do an "insert" for everything that does not match */ |
| 499 | putInt(lenOut-base, &zDelta); |
| 500 | *(zDelta++) = ':'; |
| 501 | memcpy(zDelta, &zOut[base], lenOut-base); |
| @@ -509,11 +510,11 @@ | |
| 510 | } |
| 511 | } |
| 512 | /* Output a final "insert" record to get all the text at the end of |
| 513 | ** the file that does not match anything in the source file. |
| 514 | */ |
| 515 | if( base<(int)lenOut ){ |
| 516 | putInt(lenOut-base, &zDelta); |
| 517 | *(zDelta++) = ':'; |
| 518 | memcpy(zDelta, &zOut[base], lenOut-base); |
| 519 | zDelta += lenOut-base; |
| 520 | } |
| @@ -599,11 +600,11 @@ | |
| 600 | total += cnt; |
| 601 | if( total>limit ){ |
| 602 | /* ERROR: copy exceeds output file size */ |
| 603 | return -1; |
| 604 | } |
| 605 | if( (int)(ofst+cnt) > lenSrc ){ |
| 606 | /* ERROR: copy extends past end of input */ |
| 607 | return -1; |
| 608 | } |
| 609 | memcpy(zOut, &zSrc[ofst], cnt); |
| 610 | zOut += cnt; |
| @@ -615,11 +616,11 @@ | |
| 616 | if( total>limit ){ |
| 617 | /* ERROR: insert command gives an output larger than predicted */ |
| 618 | return -1; |
| 619 | } |
| 620 | DEBUG1( printf("INSERT %d\n", cnt); ) |
| 621 | if( (int)cnt>lenDelta ){ |
| 622 | /* ERROR: insert count exceeds size of delta */ |
| 623 | return -1; |
| 624 | } |
| 625 | memcpy(zOut, zDelta, cnt); |
| 626 | zOut += cnt; |
| @@ -688,11 +689,11 @@ | |
| 689 | break; |
| 690 | } |
| 691 | case ':': { |
| 692 | zDelta++; lenDelta--; |
| 693 | nInsert += cnt; |
| 694 | if( (int)cnt>lenDelta ){ |
| 695 | /* ERROR: insert count exceeds size of delta */ |
| 696 | return -1; |
| 697 | } |
| 698 | zDelta += cnt; |
| 699 | lenDelta -= cnt; |
| 700 |
+2
-2
| --- src/deltacmd.c | ||
| +++ src/deltacmd.c | ||
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | } |
| 61 | 61 | if( blob_read_from_file(&target, g.argv[3], ExtFILE)<0 ){ |
| 62 | 62 | fossil_fatal("cannot read %s", g.argv[3]); |
| 63 | 63 | } |
| 64 | 64 | blob_delta_create(&orig, &target, &delta); |
| 65 | - if( blob_write_to_file(&delta, g.argv[4])<blob_size(&delta) ){ | |
| 65 | + if( blob_write_to_file(&delta, g.argv[4])<(int)blob_size(&delta) ){ | |
| 66 | 66 | fossil_fatal("cannot write %s", g.argv[4]); |
| 67 | 67 | } |
| 68 | 68 | blob_reset(&orig); |
| 69 | 69 | blob_reset(&target); |
| 70 | 70 | blob_reset(&delta); |
| @@ -160,11 +160,11 @@ | ||
| 160 | 160 | if( blob_read_from_file(&delta, g.argv[3], ExtFILE)<0 ){ |
| 161 | 161 | fossil_fatal("cannot read %s", g.argv[3]); |
| 162 | 162 | } |
| 163 | 163 | blob_init(&target, 0, 0); |
| 164 | 164 | blob_delta_apply(&orig, &delta, &target); |
| 165 | - if( blob_write_to_file(&target, g.argv[4])<blob_size(&target) ){ | |
| 165 | + if( blob_write_to_file(&target, g.argv[4])<(int)blob_size(&target) ){ | |
| 166 | 166 | fossil_fatal("cannot write %s", g.argv[4]); |
| 167 | 167 | } |
| 168 | 168 | blob_reset(&orig); |
| 169 | 169 | blob_reset(&target); |
| 170 | 170 | blob_reset(&delta); |
| 171 | 171 |
| --- src/deltacmd.c | |
| +++ src/deltacmd.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | } |
| 61 | if( blob_read_from_file(&target, g.argv[3], ExtFILE)<0 ){ |
| 62 | fossil_fatal("cannot read %s", g.argv[3]); |
| 63 | } |
| 64 | blob_delta_create(&orig, &target, &delta); |
| 65 | if( blob_write_to_file(&delta, g.argv[4])<blob_size(&delta) ){ |
| 66 | fossil_fatal("cannot write %s", g.argv[4]); |
| 67 | } |
| 68 | blob_reset(&orig); |
| 69 | blob_reset(&target); |
| 70 | blob_reset(&delta); |
| @@ -160,11 +160,11 @@ | |
| 160 | if( blob_read_from_file(&delta, g.argv[3], ExtFILE)<0 ){ |
| 161 | fossil_fatal("cannot read %s", g.argv[3]); |
| 162 | } |
| 163 | blob_init(&target, 0, 0); |
| 164 | blob_delta_apply(&orig, &delta, &target); |
| 165 | if( blob_write_to_file(&target, g.argv[4])<blob_size(&target) ){ |
| 166 | fossil_fatal("cannot write %s", g.argv[4]); |
| 167 | } |
| 168 | blob_reset(&orig); |
| 169 | blob_reset(&target); |
| 170 | blob_reset(&delta); |
| 171 |
| --- src/deltacmd.c | |
| +++ src/deltacmd.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | } |
| 61 | if( blob_read_from_file(&target, g.argv[3], ExtFILE)<0 ){ |
| 62 | fossil_fatal("cannot read %s", g.argv[3]); |
| 63 | } |
| 64 | blob_delta_create(&orig, &target, &delta); |
| 65 | if( blob_write_to_file(&delta, g.argv[4])<(int)blob_size(&delta) ){ |
| 66 | fossil_fatal("cannot write %s", g.argv[4]); |
| 67 | } |
| 68 | blob_reset(&orig); |
| 69 | blob_reset(&target); |
| 70 | blob_reset(&delta); |
| @@ -160,11 +160,11 @@ | |
| 160 | if( blob_read_from_file(&delta, g.argv[3], ExtFILE)<0 ){ |
| 161 | fossil_fatal("cannot read %s", g.argv[3]); |
| 162 | } |
| 163 | blob_init(&target, 0, 0); |
| 164 | blob_delta_apply(&orig, &delta, &target); |
| 165 | if( blob_write_to_file(&target, g.argv[4])<(int)blob_size(&target) ){ |
| 166 | fossil_fatal("cannot write %s", g.argv[4]); |
| 167 | } |
| 168 | blob_reset(&orig); |
| 169 | blob_reset(&target); |
| 170 | blob_reset(&delta); |
| 171 |
+7
-7
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2221,11 +2221,11 @@ | ||
| 2221 | 2221 | mxr = p->nEdit; |
| 2222 | 2222 | while( mxr>2 && R[mxr-1]==0 && R[mxr-2]==0 ){ mxr -= 3; } |
| 2223 | 2223 | |
| 2224 | 2224 | for(r=0; r<mxr; r += 3*nr){ |
| 2225 | 2225 | /* Figure out how many triples to show in a single block */ |
| 2226 | - for(nr=1; R[r+nr*3]>0 && R[r+nr*3]<nContext*2; nr++){} | |
| 2226 | + for(nr=1; R[r+nr*3]>0 && R[r+nr*3]<(int)nContext*2; nr++){} | |
| 2227 | 2227 | |
| 2228 | 2228 | /* If there is a regex, skip this block (generate no diff output) |
| 2229 | 2229 | ** if the regex matches or does not match both insert and delete. |
| 2230 | 2230 | ** Only display the block if one side matches but the other side does |
| 2231 | 2231 | ** not. |
| @@ -2251,11 +2251,11 @@ | ||
| 2251 | 2251 | } |
| 2252 | 2252 | |
| 2253 | 2253 | /* Figure out how many lines of A and B are to be displayed |
| 2254 | 2254 | ** for this change block. |
| 2255 | 2255 | */ |
| 2256 | - if( R[r]>nContext ){ | |
| 2256 | + if( R[r]>(int)nContext ){ | |
| 2257 | 2257 | skip = R[r] - nContext; |
| 2258 | 2258 | }else{ |
| 2259 | 2259 | skip = 0; |
| 2260 | 2260 | } |
| 2261 | 2261 | /* Show the initial common area */ |
| @@ -2262,14 +2262,14 @@ | ||
| 2262 | 2262 | a += skip; |
| 2263 | 2263 | b += skip; |
| 2264 | 2264 | m = R[r] - skip; |
| 2265 | 2265 | if( r ) skip -= nContext; |
| 2266 | 2266 | if( skip>0 ){ |
| 2267 | - if( skip<nContext ){ | |
| 2267 | + if( skip<(int)nContext ){ | |
| 2268 | 2268 | /* If the amount to skip is less that the context band, then |
| 2269 | 2269 | ** go ahead and show the skip band as it is not worth eliding */ |
| 2270 | - for(j=0; j<skip; j++){ | |
| 2270 | + for(j=0; (int)j<skip; j++){ | |
| 2271 | 2271 | pBuilder->xCommon(pBuilder, &A[a+j-skip]); |
| 2272 | 2272 | } |
| 2273 | 2273 | }else{ |
| 2274 | 2274 | pBuilder->xSkip(pBuilder, skip, 0); |
| 2275 | 2275 | } |
| @@ -2299,11 +2299,11 @@ | ||
| 2299 | 2299 | |
| 2300 | 2300 | /* Try to find an alignment for the lines within this one block */ |
| 2301 | 2301 | alignment = diffBlockAlignment(&A[a], ma, &B[b], mb, pCfg, &nAlign); |
| 2302 | 2302 | |
| 2303 | 2303 | for(j=0; ma+mb>0; j++){ |
| 2304 | - assert( j<nAlign ); | |
| 2304 | + assert( (int)j<nAlign ); | |
| 2305 | 2305 | switch( alignment[j] ){ |
| 2306 | 2306 | case 1: { |
| 2307 | 2307 | /* Delete one line from the left */ |
| 2308 | 2308 | pBuilder->xDelete(pBuilder, &A[a]); |
| 2309 | 2309 | ma--; |
| @@ -2341,11 +2341,11 @@ | ||
| 2341 | 2341 | b++; |
| 2342 | 2342 | break; |
| 2343 | 2343 | } |
| 2344 | 2344 | } |
| 2345 | 2345 | } |
| 2346 | - assert( nAlign==j ); | |
| 2346 | + assert( nAlign==(int)j ); | |
| 2347 | 2347 | fossil_free(alignment); |
| 2348 | 2348 | if( i<nr-1 ){ |
| 2349 | 2349 | m = R[r+i*3+3]; |
| 2350 | 2350 | for(j=0; j<m; j++){ |
| 2351 | 2351 | pBuilder->xCommon(pBuilder, &A[a+j]); |
| @@ -2361,11 +2361,11 @@ | ||
| 2361 | 2361 | if( m>nContext ) m = nContext; |
| 2362 | 2362 | for(j=0; j<m && j<nContext; j++){ |
| 2363 | 2363 | pBuilder->xCommon(pBuilder, &A[a+j]); |
| 2364 | 2364 | } |
| 2365 | 2365 | } |
| 2366 | - if( R[r]>nContext ){ | |
| 2366 | + if( R[r]>(int)nContext ){ | |
| 2367 | 2367 | pBuilder->xSkip(pBuilder, R[r] - nContext, 1); |
| 2368 | 2368 | } |
| 2369 | 2369 | pBuilder->xEnd(pBuilder); |
| 2370 | 2370 | } |
| 2371 | 2371 | |
| 2372 | 2372 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2221,11 +2221,11 @@ | |
| 2221 | mxr = p->nEdit; |
| 2222 | while( mxr>2 && R[mxr-1]==0 && R[mxr-2]==0 ){ mxr -= 3; } |
| 2223 | |
| 2224 | for(r=0; r<mxr; r += 3*nr){ |
| 2225 | /* Figure out how many triples to show in a single block */ |
| 2226 | for(nr=1; R[r+nr*3]>0 && R[r+nr*3]<nContext*2; nr++){} |
| 2227 | |
| 2228 | /* If there is a regex, skip this block (generate no diff output) |
| 2229 | ** if the regex matches or does not match both insert and delete. |
| 2230 | ** Only display the block if one side matches but the other side does |
| 2231 | ** not. |
| @@ -2251,11 +2251,11 @@ | |
| 2251 | } |
| 2252 | |
| 2253 | /* Figure out how many lines of A and B are to be displayed |
| 2254 | ** for this change block. |
| 2255 | */ |
| 2256 | if( R[r]>nContext ){ |
| 2257 | skip = R[r] - nContext; |
| 2258 | }else{ |
| 2259 | skip = 0; |
| 2260 | } |
| 2261 | /* Show the initial common area */ |
| @@ -2262,14 +2262,14 @@ | |
| 2262 | a += skip; |
| 2263 | b += skip; |
| 2264 | m = R[r] - skip; |
| 2265 | if( r ) skip -= nContext; |
| 2266 | if( skip>0 ){ |
| 2267 | if( skip<nContext ){ |
| 2268 | /* If the amount to skip is less that the context band, then |
| 2269 | ** go ahead and show the skip band as it is not worth eliding */ |
| 2270 | for(j=0; j<skip; j++){ |
| 2271 | pBuilder->xCommon(pBuilder, &A[a+j-skip]); |
| 2272 | } |
| 2273 | }else{ |
| 2274 | pBuilder->xSkip(pBuilder, skip, 0); |
| 2275 | } |
| @@ -2299,11 +2299,11 @@ | |
| 2299 | |
| 2300 | /* Try to find an alignment for the lines within this one block */ |
| 2301 | alignment = diffBlockAlignment(&A[a], ma, &B[b], mb, pCfg, &nAlign); |
| 2302 | |
| 2303 | for(j=0; ma+mb>0; j++){ |
| 2304 | assert( j<nAlign ); |
| 2305 | switch( alignment[j] ){ |
| 2306 | case 1: { |
| 2307 | /* Delete one line from the left */ |
| 2308 | pBuilder->xDelete(pBuilder, &A[a]); |
| 2309 | ma--; |
| @@ -2341,11 +2341,11 @@ | |
| 2341 | b++; |
| 2342 | break; |
| 2343 | } |
| 2344 | } |
| 2345 | } |
| 2346 | assert( nAlign==j ); |
| 2347 | fossil_free(alignment); |
| 2348 | if( i<nr-1 ){ |
| 2349 | m = R[r+i*3+3]; |
| 2350 | for(j=0; j<m; j++){ |
| 2351 | pBuilder->xCommon(pBuilder, &A[a+j]); |
| @@ -2361,11 +2361,11 @@ | |
| 2361 | if( m>nContext ) m = nContext; |
| 2362 | for(j=0; j<m && j<nContext; j++){ |
| 2363 | pBuilder->xCommon(pBuilder, &A[a+j]); |
| 2364 | } |
| 2365 | } |
| 2366 | if( R[r]>nContext ){ |
| 2367 | pBuilder->xSkip(pBuilder, R[r] - nContext, 1); |
| 2368 | } |
| 2369 | pBuilder->xEnd(pBuilder); |
| 2370 | } |
| 2371 | |
| 2372 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2221,11 +2221,11 @@ | |
| 2221 | mxr = p->nEdit; |
| 2222 | while( mxr>2 && R[mxr-1]==0 && R[mxr-2]==0 ){ mxr -= 3; } |
| 2223 | |
| 2224 | for(r=0; r<mxr; r += 3*nr){ |
| 2225 | /* Figure out how many triples to show in a single block */ |
| 2226 | for(nr=1; R[r+nr*3]>0 && R[r+nr*3]<(int)nContext*2; nr++){} |
| 2227 | |
| 2228 | /* If there is a regex, skip this block (generate no diff output) |
| 2229 | ** if the regex matches or does not match both insert and delete. |
| 2230 | ** Only display the block if one side matches but the other side does |
| 2231 | ** not. |
| @@ -2251,11 +2251,11 @@ | |
| 2251 | } |
| 2252 | |
| 2253 | /* Figure out how many lines of A and B are to be displayed |
| 2254 | ** for this change block. |
| 2255 | */ |
| 2256 | if( R[r]>(int)nContext ){ |
| 2257 | skip = R[r] - nContext; |
| 2258 | }else{ |
| 2259 | skip = 0; |
| 2260 | } |
| 2261 | /* Show the initial common area */ |
| @@ -2262,14 +2262,14 @@ | |
| 2262 | a += skip; |
| 2263 | b += skip; |
| 2264 | m = R[r] - skip; |
| 2265 | if( r ) skip -= nContext; |
| 2266 | if( skip>0 ){ |
| 2267 | if( skip<(int)nContext ){ |
| 2268 | /* If the amount to skip is less that the context band, then |
| 2269 | ** go ahead and show the skip band as it is not worth eliding */ |
| 2270 | for(j=0; (int)j<skip; j++){ |
| 2271 | pBuilder->xCommon(pBuilder, &A[a+j-skip]); |
| 2272 | } |
| 2273 | }else{ |
| 2274 | pBuilder->xSkip(pBuilder, skip, 0); |
| 2275 | } |
| @@ -2299,11 +2299,11 @@ | |
| 2299 | |
| 2300 | /* Try to find an alignment for the lines within this one block */ |
| 2301 | alignment = diffBlockAlignment(&A[a], ma, &B[b], mb, pCfg, &nAlign); |
| 2302 | |
| 2303 | for(j=0; ma+mb>0; j++){ |
| 2304 | assert( (int)j<nAlign ); |
| 2305 | switch( alignment[j] ){ |
| 2306 | case 1: { |
| 2307 | /* Delete one line from the left */ |
| 2308 | pBuilder->xDelete(pBuilder, &A[a]); |
| 2309 | ma--; |
| @@ -2341,11 +2341,11 @@ | |
| 2341 | b++; |
| 2342 | break; |
| 2343 | } |
| 2344 | } |
| 2345 | } |
| 2346 | assert( nAlign==(int)j ); |
| 2347 | fossil_free(alignment); |
| 2348 | if( i<nr-1 ){ |
| 2349 | m = R[r+i*3+3]; |
| 2350 | for(j=0; j<m; j++){ |
| 2351 | pBuilder->xCommon(pBuilder, &A[a+j]); |
| @@ -2361,11 +2361,11 @@ | |
| 2361 | if( m>nContext ) m = nContext; |
| 2362 | for(j=0; j<m && j<nContext; j++){ |
| 2363 | pBuilder->xCommon(pBuilder, &A[a+j]); |
| 2364 | } |
| 2365 | } |
| 2366 | if( R[r]>(int)nContext ){ |
| 2367 | pBuilder->xSkip(pBuilder, R[r] - nContext, 1); |
| 2368 | } |
| 2369 | pBuilder->xEnd(pBuilder); |
| 2370 | } |
| 2371 | |
| 2372 |
+1
-1
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -459,11 +459,11 @@ | ||
| 459 | 459 | z = zName; |
| 460 | 460 | for(i=0; zName[i]; i++){ |
| 461 | 461 | if( zName[i]=='.' ) z = &zName[i+1]; |
| 462 | 462 | } |
| 463 | 463 | len = strlen(z); |
| 464 | - if( len<sizeof(zSuffix)-1 ){ | |
| 464 | + if( len<(int)sizeof(zSuffix)-1 ){ | |
| 465 | 465 | sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z); |
| 466 | 466 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 467 | 467 | z = mimetype_from_name_custom(zSuffix); |
| 468 | 468 | if(z!=0){ |
| 469 | 469 | return z; |
| 470 | 470 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -459,11 +459,11 @@ | |
| 459 | z = zName; |
| 460 | for(i=0; zName[i]; i++){ |
| 461 | if( zName[i]=='.' ) z = &zName[i+1]; |
| 462 | } |
| 463 | len = strlen(z); |
| 464 | if( len<sizeof(zSuffix)-1 ){ |
| 465 | sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z); |
| 466 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 467 | z = mimetype_from_name_custom(zSuffix); |
| 468 | if(z!=0){ |
| 469 | return z; |
| 470 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -459,11 +459,11 @@ | |
| 459 | z = zName; |
| 460 | for(i=0; zName[i]; i++){ |
| 461 | if( zName[i]=='.' ) z = &zName[i+1]; |
| 462 | } |
| 463 | len = strlen(z); |
| 464 | if( len<(int)sizeof(zSuffix)-1 ){ |
| 465 | sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z); |
| 466 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 467 | z = mimetype_from_name_custom(zSuffix); |
| 468 | if(z!=0){ |
| 469 | return z; |
| 470 |
+1
-1
| --- src/encode.c | ||
| +++ src/encode.c | ||
| @@ -708,11 +708,11 @@ | ||
| 708 | 708 | */ |
| 709 | 709 | int validate16(const char *zIn, int nIn){ |
| 710 | 710 | int i; |
| 711 | 711 | if( nIn<0 ) nIn = (int)strlen(zIn); |
| 712 | 712 | if( zIn[nIn]==0 ){ |
| 713 | - return strspn(zIn,"0123456789abcdefABCDEF")==nIn; | |
| 713 | + return (int)strspn(zIn,"0123456789abcdefABCDEF")==nIn; | |
| 714 | 714 | } |
| 715 | 715 | for(i=0; i<nIn; i++, zIn++){ |
| 716 | 716 | if( zDecode[zIn[0]&0xff]>63 ){ |
| 717 | 717 | return zIn[0]==0; |
| 718 | 718 | } |
| 719 | 719 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -708,11 +708,11 @@ | |
| 708 | */ |
| 709 | int validate16(const char *zIn, int nIn){ |
| 710 | int i; |
| 711 | if( nIn<0 ) nIn = (int)strlen(zIn); |
| 712 | if( zIn[nIn]==0 ){ |
| 713 | return strspn(zIn,"0123456789abcdefABCDEF")==nIn; |
| 714 | } |
| 715 | for(i=0; i<nIn; i++, zIn++){ |
| 716 | if( zDecode[zIn[0]&0xff]>63 ){ |
| 717 | return zIn[0]==0; |
| 718 | } |
| 719 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -708,11 +708,11 @@ | |
| 708 | */ |
| 709 | int validate16(const char *zIn, int nIn){ |
| 710 | int i; |
| 711 | if( nIn<0 ) nIn = (int)strlen(zIn); |
| 712 | if( zIn[nIn]==0 ){ |
| 713 | return (int)strspn(zIn,"0123456789abcdefABCDEF")==nIn; |
| 714 | } |
| 715 | for(i=0; i<nIn; i++, zIn++){ |
| 716 | if( zDecode[zIn[0]&0xff]>63 ){ |
| 717 | return zIn[0]==0; |
| 718 | } |
| 719 |
+3
-3
| --- src/extcgi.c | ||
| +++ src/extcgi.c | ||
| @@ -115,11 +115,11 @@ | ||
| 115 | 115 | "index.html", "index.wiki", "index.md" |
| 116 | 116 | }; |
| 117 | 117 | int i; |
| 118 | 118 | if( file_isdir(*pzPath, ExtFILE)!=1 ) return 0; |
| 119 | 119 | if( sqlite3_strglob("*/", *pzPath)!=0 ) return 0; |
| 120 | - for(i=0; i<sizeof(azIndexNames)/sizeof(azIndexNames[0]); i++){ | |
| 120 | + for(i=0; i<(int)(sizeof(azIndexNames)/sizeof(azIndexNames[0])); i++){ | |
| 121 | 121 | char *zNew = mprintf("%s%s", *pzPath, azIndexNames[i]); |
| 122 | 122 | if( file_isfile(zNew, ExtFILE) ){ |
| 123 | 123 | fossil_free(*pzPath); |
| 124 | 124 | *pzPath = zNew; |
| 125 | 125 | return 1; |
| @@ -272,15 +272,15 @@ | ||
| 272 | 272 | zSrvSw = mprintf("%z, %s", z, zSrvSw); |
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 | cgi_replace_parameter("SERVER_SOFTWARE", zSrvSw); |
| 276 | 276 | cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0"); |
| 277 | - for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){ | |
| 277 | + for(i=0; i<(int)(sizeof(azCgiEnv)/sizeof(azCgiEnv[0])); i++){ | |
| 278 | 278 | (void)P(azCgiEnv[i]); |
| 279 | 279 | } |
| 280 | 280 | fossil_clearenv(); |
| 281 | - for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){ | |
| 281 | + for(i=0; i<(int)(sizeof(azCgiEnv)/sizeof(azCgiEnv[0])); i++){ | |
| 282 | 282 | const char *zVal = P(azCgiEnv[i]); |
| 283 | 283 | if( zVal ) fossil_setenv(azCgiEnv[i], zVal); |
| 284 | 284 | } |
| 285 | 285 | fossil_setenv("HTTP_ACCEPT_ENCODING",""); |
| 286 | 286 | rc = popen2(zScript, &fdFromChild, &toChild, &pidChild, 1); |
| 287 | 287 |
| --- src/extcgi.c | |
| +++ src/extcgi.c | |
| @@ -115,11 +115,11 @@ | |
| 115 | "index.html", "index.wiki", "index.md" |
| 116 | }; |
| 117 | int i; |
| 118 | if( file_isdir(*pzPath, ExtFILE)!=1 ) return 0; |
| 119 | if( sqlite3_strglob("*/", *pzPath)!=0 ) return 0; |
| 120 | for(i=0; i<sizeof(azIndexNames)/sizeof(azIndexNames[0]); i++){ |
| 121 | char *zNew = mprintf("%s%s", *pzPath, azIndexNames[i]); |
| 122 | if( file_isfile(zNew, ExtFILE) ){ |
| 123 | fossil_free(*pzPath); |
| 124 | *pzPath = zNew; |
| 125 | return 1; |
| @@ -272,15 +272,15 @@ | |
| 272 | zSrvSw = mprintf("%z, %s", z, zSrvSw); |
| 273 | } |
| 274 | } |
| 275 | cgi_replace_parameter("SERVER_SOFTWARE", zSrvSw); |
| 276 | cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0"); |
| 277 | for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){ |
| 278 | (void)P(azCgiEnv[i]); |
| 279 | } |
| 280 | fossil_clearenv(); |
| 281 | for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){ |
| 282 | const char *zVal = P(azCgiEnv[i]); |
| 283 | if( zVal ) fossil_setenv(azCgiEnv[i], zVal); |
| 284 | } |
| 285 | fossil_setenv("HTTP_ACCEPT_ENCODING",""); |
| 286 | rc = popen2(zScript, &fdFromChild, &toChild, &pidChild, 1); |
| 287 |
| --- src/extcgi.c | |
| +++ src/extcgi.c | |
| @@ -115,11 +115,11 @@ | |
| 115 | "index.html", "index.wiki", "index.md" |
| 116 | }; |
| 117 | int i; |
| 118 | if( file_isdir(*pzPath, ExtFILE)!=1 ) return 0; |
| 119 | if( sqlite3_strglob("*/", *pzPath)!=0 ) return 0; |
| 120 | for(i=0; i<(int)(sizeof(azIndexNames)/sizeof(azIndexNames[0])); i++){ |
| 121 | char *zNew = mprintf("%s%s", *pzPath, azIndexNames[i]); |
| 122 | if( file_isfile(zNew, ExtFILE) ){ |
| 123 | fossil_free(*pzPath); |
| 124 | *pzPath = zNew; |
| 125 | return 1; |
| @@ -272,15 +272,15 @@ | |
| 272 | zSrvSw = mprintf("%z, %s", z, zSrvSw); |
| 273 | } |
| 274 | } |
| 275 | cgi_replace_parameter("SERVER_SOFTWARE", zSrvSw); |
| 276 | cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0"); |
| 277 | for(i=0; i<(int)(sizeof(azCgiEnv)/sizeof(azCgiEnv[0])); i++){ |
| 278 | (void)P(azCgiEnv[i]); |
| 279 | } |
| 280 | fossil_clearenv(); |
| 281 | for(i=0; i<(int)(sizeof(azCgiEnv)/sizeof(azCgiEnv[0])); i++){ |
| 282 | const char *zVal = P(azCgiEnv[i]); |
| 283 | if( zVal ) fossil_setenv(azCgiEnv[i], zVal); |
| 284 | } |
| 285 | fossil_setenv("HTTP_ACCEPT_ENCODING",""); |
| 286 | rc = popen2(zScript, &fdFromChild, &toChild, &pidChild, 1); |
| 287 |
+2
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -203,11 +203,11 @@ | ||
| 203 | 203 | ** Return the mode bits for a file. Return -1 if the file does not |
| 204 | 204 | ** exist. If zFilename is NULL return the size of the most recently |
| 205 | 205 | ** stat-ed file. |
| 206 | 206 | */ |
| 207 | 207 | int file_mode(const char *zFilename, int eFType){ |
| 208 | - return getStat(zFilename, eFType) ? -1 : fx.fileStat.st_mode; | |
| 208 | + return getStat(zFilename, eFType) ? -1 : (int)(fx.fileStat.st_mode); | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /* |
| 212 | 212 | ** Return TRUE if either of the following are true: |
| 213 | 213 | ** |
| @@ -242,11 +242,11 @@ | ||
| 242 | 242 | if( db_allow_symlinks() ){ |
| 243 | 243 | int i, nName; |
| 244 | 244 | char *zName, zBuf[1000]; |
| 245 | 245 | |
| 246 | 246 | nName = strlen(zLinkFile); |
| 247 | - if( nName>=sizeof(zBuf) ){ | |
| 247 | + if( nName>=(int)sizeof(zBuf) ){ | |
| 248 | 248 | zName = mprintf("%s", zLinkFile); |
| 249 | 249 | }else{ |
| 250 | 250 | zName = zBuf; |
| 251 | 251 | memcpy(zName, zLinkFile, nName+1); |
| 252 | 252 | } |
| 253 | 253 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -203,11 +203,11 @@ | |
| 203 | ** Return the mode bits for a file. Return -1 if the file does not |
| 204 | ** exist. If zFilename is NULL return the size of the most recently |
| 205 | ** stat-ed file. |
| 206 | */ |
| 207 | int file_mode(const char *zFilename, int eFType){ |
| 208 | return getStat(zFilename, eFType) ? -1 : fx.fileStat.st_mode; |
| 209 | } |
| 210 | |
| 211 | /* |
| 212 | ** Return TRUE if either of the following are true: |
| 213 | ** |
| @@ -242,11 +242,11 @@ | |
| 242 | if( db_allow_symlinks() ){ |
| 243 | int i, nName; |
| 244 | char *zName, zBuf[1000]; |
| 245 | |
| 246 | nName = strlen(zLinkFile); |
| 247 | if( nName>=sizeof(zBuf) ){ |
| 248 | zName = mprintf("%s", zLinkFile); |
| 249 | }else{ |
| 250 | zName = zBuf; |
| 251 | memcpy(zName, zLinkFile, nName+1); |
| 252 | } |
| 253 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -203,11 +203,11 @@ | |
| 203 | ** Return the mode bits for a file. Return -1 if the file does not |
| 204 | ** exist. If zFilename is NULL return the size of the most recently |
| 205 | ** stat-ed file. |
| 206 | */ |
| 207 | int file_mode(const char *zFilename, int eFType){ |
| 208 | return getStat(zFilename, eFType) ? -1 : (int)(fx.fileStat.st_mode); |
| 209 | } |
| 210 | |
| 211 | /* |
| 212 | ** Return TRUE if either of the following are true: |
| 213 | ** |
| @@ -242,11 +242,11 @@ | |
| 242 | if( db_allow_symlinks() ){ |
| 243 | int i, nName; |
| 244 | char *zName, zBuf[1000]; |
| 245 | |
| 246 | nName = strlen(zLinkFile); |
| 247 | if( nName>=(int)sizeof(zBuf) ){ |
| 248 | zName = mprintf("%s", zLinkFile); |
| 249 | }else{ |
| 250 | zName = zBuf; |
| 251 | memcpy(zName, zLinkFile, nName+1); |
| 252 | } |
| 253 |
+1
-1
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -617,11 +617,11 @@ | ||
| 617 | 617 | assert(CIMINI_CONVERT_EOL_WINDOWS & pCI->flags); |
| 618 | 618 | if(!(LOOK_CRLF & lookNew)){ |
| 619 | 619 | blob_add_cr(&pCI->fileContent); |
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | - if(blob_size(&pCI->fileContent)!=oldSize){ | |
| 622 | + if((int)blob_size(&pCI->fileContent)!=oldSize){ | |
| 623 | 623 | rehash = 1; |
| 624 | 624 | } |
| 625 | 625 | } |
| 626 | 626 | if(rehash!=0){ |
| 627 | 627 | hname_hash(&pCI->fileContent, 0, &pCI->fileHash); |
| 628 | 628 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -617,11 +617,11 @@ | |
| 617 | assert(CIMINI_CONVERT_EOL_WINDOWS & pCI->flags); |
| 618 | if(!(LOOK_CRLF & lookNew)){ |
| 619 | blob_add_cr(&pCI->fileContent); |
| 620 | } |
| 621 | } |
| 622 | if(blob_size(&pCI->fileContent)!=oldSize){ |
| 623 | rehash = 1; |
| 624 | } |
| 625 | } |
| 626 | if(rehash!=0){ |
| 627 | hname_hash(&pCI->fileContent, 0, &pCI->fileHash); |
| 628 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -617,11 +617,11 @@ | |
| 617 | assert(CIMINI_CONVERT_EOL_WINDOWS & pCI->flags); |
| 618 | if(!(LOOK_CRLF & lookNew)){ |
| 619 | blob_add_cr(&pCI->fileContent); |
| 620 | } |
| 621 | } |
| 622 | if((int)blob_size(&pCI->fileContent)!=oldSize){ |
| 623 | rehash = 1; |
| 624 | } |
| 625 | } |
| 626 | if(rehash!=0){ |
| 627 | hname_hash(&pCI->fileContent, 0, &pCI->fileHash); |
| 628 |
+1
-1
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -704,11 +704,11 @@ | ||
| 704 | 704 | zQuery[i++] = 'h'; |
| 705 | 705 | zQuery[i++] = 'i'; |
| 706 | 706 | zQuery[i++] = 's'; |
| 707 | 707 | zQuery[i++] = 't'; |
| 708 | 708 | } |
| 709 | - assert( i<sizeof(zQuery) ); | |
| 709 | + assert( i<(int)sizeof(zQuery) ); | |
| 710 | 710 | zQuery[i] = 0; |
| 711 | 711 | assert( zQuery[0]==0 || zQuery[0]=='?' ); |
| 712 | 712 | |
| 713 | 713 | /* Identify which post to display first. If history is shown, start with the |
| 714 | 714 | ** original, unedited post. Otherwise advance to the post's latest edit. */ |
| 715 | 715 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -704,11 +704,11 @@ | |
| 704 | zQuery[i++] = 'h'; |
| 705 | zQuery[i++] = 'i'; |
| 706 | zQuery[i++] = 's'; |
| 707 | zQuery[i++] = 't'; |
| 708 | } |
| 709 | assert( i<sizeof(zQuery) ); |
| 710 | zQuery[i] = 0; |
| 711 | assert( zQuery[0]==0 || zQuery[0]=='?' ); |
| 712 | |
| 713 | /* Identify which post to display first. If history is shown, start with the |
| 714 | ** original, unedited post. Otherwise advance to the post's latest edit. */ |
| 715 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -704,11 +704,11 @@ | |
| 704 | zQuery[i++] = 'h'; |
| 705 | zQuery[i++] = 'i'; |
| 706 | zQuery[i++] = 's'; |
| 707 | zQuery[i++] = 't'; |
| 708 | } |
| 709 | assert( i<(int)sizeof(zQuery) ); |
| 710 | zQuery[i] = 0; |
| 711 | assert( zQuery[0]==0 || zQuery[0]=='?' ); |
| 712 | |
| 713 | /* Identify which post to display first. If history is shown, start with the |
| 714 | ** original, unedited post. Otherwise advance to the post's latest edit. */ |
| 715 |
+1
-1
| --- src/http_ssl.c | ||
| +++ src/http_ssl.c | ||
| @@ -541,11 +541,11 @@ | ||
| 541 | 541 | x = X509_digest(cert, EVP_sha256(), md, &mdLength); |
| 542 | 542 | #else |
| 543 | 543 | x = X509_digest(cert, EVP_sha1(), md, &mdLength); |
| 544 | 544 | #endif |
| 545 | 545 | if( x ){ |
| 546 | - int j; | |
| 546 | + unsigned j; | |
| 547 | 547 | for(j=0; j<mdLength && j*2+1<sizeof(zHash); ++j){ |
| 548 | 548 | zHash[j*2] = "0123456789abcdef"[md[j]>>4]; |
| 549 | 549 | zHash[j*2+1] = "0123456789abcdef"[md[j]&0xf]; |
| 550 | 550 | } |
| 551 | 551 | zHash[j*2] = 0; |
| 552 | 552 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -541,11 +541,11 @@ | |
| 541 | x = X509_digest(cert, EVP_sha256(), md, &mdLength); |
| 542 | #else |
| 543 | x = X509_digest(cert, EVP_sha1(), md, &mdLength); |
| 544 | #endif |
| 545 | if( x ){ |
| 546 | int j; |
| 547 | for(j=0; j<mdLength && j*2+1<sizeof(zHash); ++j){ |
| 548 | zHash[j*2] = "0123456789abcdef"[md[j]>>4]; |
| 549 | zHash[j*2+1] = "0123456789abcdef"[md[j]&0xf]; |
| 550 | } |
| 551 | zHash[j*2] = 0; |
| 552 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -541,11 +541,11 @@ | |
| 541 | x = X509_digest(cert, EVP_sha256(), md, &mdLength); |
| 542 | #else |
| 543 | x = X509_digest(cert, EVP_sha1(), md, &mdLength); |
| 544 | #endif |
| 545 | if( x ){ |
| 546 | unsigned j; |
| 547 | for(j=0; j<mdLength && j*2+1<sizeof(zHash); ++j){ |
| 548 | zHash[j*2] = "0123456789abcdef"[md[j]>>4]; |
| 549 | zHash[j*2+1] = "0123456789abcdef"[md[j]&0xf]; |
| 550 | } |
| 551 | zHash[j*2] = 0; |
| 552 |
+1
-1
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -82,11 +82,11 @@ | ||
| 82 | 82 | ** like "/bin/rm". |
| 83 | 83 | */ |
| 84 | 84 | static int is_safe_fossil_command(const char *zFossil){ |
| 85 | 85 | static const char *const azSafe[] = { "*/fossil", "*/fossil.exe", "*/echo" }; |
| 86 | 86 | int i; |
| 87 | - for(i=0; i<sizeof(azSafe)/sizeof(azSafe[0]); i++){ | |
| 87 | + for(i=0; i<(int)(sizeof(azSafe)/sizeof(azSafe[0])); i++){ | |
| 88 | 88 | if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1; |
| 89 | 89 | if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1; |
| 90 | 90 | } |
| 91 | 91 | return 0; |
| 92 | 92 | } |
| 93 | 93 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -82,11 +82,11 @@ | |
| 82 | ** like "/bin/rm". |
| 83 | */ |
| 84 | static int is_safe_fossil_command(const char *zFossil){ |
| 85 | static const char *const azSafe[] = { "*/fossil", "*/fossil.exe", "*/echo" }; |
| 86 | int i; |
| 87 | for(i=0; i<sizeof(azSafe)/sizeof(azSafe[0]); i++){ |
| 88 | if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1; |
| 89 | if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1; |
| 90 | } |
| 91 | return 0; |
| 92 | } |
| 93 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -82,11 +82,11 @@ | |
| 82 | ** like "/bin/rm". |
| 83 | */ |
| 84 | static int is_safe_fossil_command(const char *zFossil){ |
| 85 | static const char *const azSafe[] = { "*/fossil", "*/fossil.exe", "*/echo" }; |
| 86 | int i; |
| 87 | for(i=0; i<(int)(sizeof(azSafe)/sizeof(azSafe[0])); i++){ |
| 88 | if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1; |
| 89 | if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1; |
| 90 | } |
| 91 | return 0; |
| 92 | } |
| 93 |
+5
-5
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -597,11 +597,11 @@ | ||
| 597 | 597 | ** last commit that holds that tag. |
| 598 | 598 | ** |
| 599 | 599 | ** None of the above is explained in the git-fast-export |
| 600 | 600 | ** documentation. We had to figure it out via trial and error. |
| 601 | 601 | */ |
| 602 | - for(i=5; i<strlen(zRefName) && zRefName[i]!='/'; i++){} | |
| 602 | + for(i=5; i<(int)strlen(zRefName) && zRefName[i]!='/'; i++){} | |
| 603 | 603 | gg.tagCommit = strncmp(&zRefName[5], "tags", 4)==0; /* pattern B */ |
| 604 | 604 | if( zRefName[i+1]!=0 ) zRefName += i+1; |
| 605 | 605 | if( fossil_strcmp(zRefName, "master")==0 ) zRefName = ggit.zMasterName; |
| 606 | 606 | gg.zBranch = fossil_strdup(zRefName); |
| 607 | 607 | gg.fromLoaded = 0; |
| @@ -767,11 +767,11 @@ | ||
| 767 | 767 | nFrom = strlen(zFrom); |
| 768 | 768 | while( (pFile = import_find_file(zFrom, &i, mx))!=0 ){ |
| 769 | 769 | if( pFile->isFrom==0 ) continue; |
| 770 | 770 | pNew = import_add_file(); |
| 771 | 771 | pFile = &gg.aFile[i-1]; |
| 772 | - if( strlen(pFile->zName)>nFrom ){ | |
| 772 | + if( (int)strlen(pFile->zName)>nFrom ){ | |
| 773 | 773 | pNew->zName = mprintf("%s%s", zTo, pFile->zName+nFrom); |
| 774 | 774 | }else{ |
| 775 | 775 | pNew->zName = fossil_strdup(zTo); |
| 776 | 776 | } |
| 777 | 777 | pNew->isExe = pFile->isExe; |
| @@ -790,11 +790,11 @@ | ||
| 790 | 790 | nFrom = strlen(zFrom); |
| 791 | 791 | while( (pFile = import_find_file(zFrom, &i, gg.nFile))!=0 ){ |
| 792 | 792 | if( pFile->isFrom==0 ) continue; |
| 793 | 793 | pNew = import_add_file(); |
| 794 | 794 | pFile = &gg.aFile[i-1]; |
| 795 | - if( strlen(pFile->zName)>nFrom ){ | |
| 795 | + if( (int)strlen(pFile->zName)>nFrom ){ | |
| 796 | 796 | pNew->zName = mprintf("%s%s", zTo, pFile->zName+nFrom); |
| 797 | 797 | }else{ |
| 798 | 798 | pNew->zName = fossil_strdup(zTo); |
| 799 | 799 | } |
| 800 | 800 | pNew->zPrior = pFile->zName; |
| @@ -1013,11 +1013,11 @@ | ||
| 1013 | 1013 | zLen = svn_find_header(*rec, "Text-content-length"); |
| 1014 | 1014 | if( zLen ){ |
| 1015 | 1015 | rec->contentFlag = 1; |
| 1016 | 1016 | nLen = atoi(zLen); |
| 1017 | 1017 | blob_read_from_channel(&rec->content, pIn, nLen); |
| 1018 | - if( blob_size(&rec->content)!=nLen ){ | |
| 1018 | + if( (int)blob_size(&rec->content)!=nLen ){ | |
| 1019 | 1019 | fossil_fatal("short read: got %d of %d bytes", |
| 1020 | 1020 | blob_size(&rec->content), nLen |
| 1021 | 1021 | ); |
| 1022 | 1022 | } |
| 1023 | 1023 | }else{ |
| @@ -1278,11 +1278,11 @@ | ||
| 1278 | 1278 | if( gsvn.azIgnTree ){ |
| 1279 | 1279 | const char **pzIgnTree; |
| 1280 | 1280 | unsigned nPath = strlen(zPath); |
| 1281 | 1281 | for( pzIgnTree = gsvn.azIgnTree; *pzIgnTree; ++pzIgnTree ){ |
| 1282 | 1282 | const char *zIgn = *pzIgnTree; |
| 1283 | - int nIgn = strlen(zIgn); | |
| 1283 | + unsigned nIgn = strlen(zIgn); | |
| 1284 | 1284 | if( strncmp(zPath, zIgn, nIgn) == 0 |
| 1285 | 1285 | && ( nPath == nIgn || (nPath > nIgn && zPath[nIgn] == '/')) ){ |
| 1286 | 1286 | return 0; |
| 1287 | 1287 | } |
| 1288 | 1288 | } |
| 1289 | 1289 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -597,11 +597,11 @@ | |
| 597 | ** last commit that holds that tag. |
| 598 | ** |
| 599 | ** None of the above is explained in the git-fast-export |
| 600 | ** documentation. We had to figure it out via trial and error. |
| 601 | */ |
| 602 | for(i=5; i<strlen(zRefName) && zRefName[i]!='/'; i++){} |
| 603 | gg.tagCommit = strncmp(&zRefName[5], "tags", 4)==0; /* pattern B */ |
| 604 | if( zRefName[i+1]!=0 ) zRefName += i+1; |
| 605 | if( fossil_strcmp(zRefName, "master")==0 ) zRefName = ggit.zMasterName; |
| 606 | gg.zBranch = fossil_strdup(zRefName); |
| 607 | gg.fromLoaded = 0; |
| @@ -767,11 +767,11 @@ | |
| 767 | nFrom = strlen(zFrom); |
| 768 | while( (pFile = import_find_file(zFrom, &i, mx))!=0 ){ |
| 769 | if( pFile->isFrom==0 ) continue; |
| 770 | pNew = import_add_file(); |
| 771 | pFile = &gg.aFile[i-1]; |
| 772 | if( strlen(pFile->zName)>nFrom ){ |
| 773 | pNew->zName = mprintf("%s%s", zTo, pFile->zName+nFrom); |
| 774 | }else{ |
| 775 | pNew->zName = fossil_strdup(zTo); |
| 776 | } |
| 777 | pNew->isExe = pFile->isExe; |
| @@ -790,11 +790,11 @@ | |
| 790 | nFrom = strlen(zFrom); |
| 791 | while( (pFile = import_find_file(zFrom, &i, gg.nFile))!=0 ){ |
| 792 | if( pFile->isFrom==0 ) continue; |
| 793 | pNew = import_add_file(); |
| 794 | pFile = &gg.aFile[i-1]; |
| 795 | if( strlen(pFile->zName)>nFrom ){ |
| 796 | pNew->zName = mprintf("%s%s", zTo, pFile->zName+nFrom); |
| 797 | }else{ |
| 798 | pNew->zName = fossil_strdup(zTo); |
| 799 | } |
| 800 | pNew->zPrior = pFile->zName; |
| @@ -1013,11 +1013,11 @@ | |
| 1013 | zLen = svn_find_header(*rec, "Text-content-length"); |
| 1014 | if( zLen ){ |
| 1015 | rec->contentFlag = 1; |
| 1016 | nLen = atoi(zLen); |
| 1017 | blob_read_from_channel(&rec->content, pIn, nLen); |
| 1018 | if( blob_size(&rec->content)!=nLen ){ |
| 1019 | fossil_fatal("short read: got %d of %d bytes", |
| 1020 | blob_size(&rec->content), nLen |
| 1021 | ); |
| 1022 | } |
| 1023 | }else{ |
| @@ -1278,11 +1278,11 @@ | |
| 1278 | if( gsvn.azIgnTree ){ |
| 1279 | const char **pzIgnTree; |
| 1280 | unsigned nPath = strlen(zPath); |
| 1281 | for( pzIgnTree = gsvn.azIgnTree; *pzIgnTree; ++pzIgnTree ){ |
| 1282 | const char *zIgn = *pzIgnTree; |
| 1283 | int nIgn = strlen(zIgn); |
| 1284 | if( strncmp(zPath, zIgn, nIgn) == 0 |
| 1285 | && ( nPath == nIgn || (nPath > nIgn && zPath[nIgn] == '/')) ){ |
| 1286 | return 0; |
| 1287 | } |
| 1288 | } |
| 1289 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -597,11 +597,11 @@ | |
| 597 | ** last commit that holds that tag. |
| 598 | ** |
| 599 | ** None of the above is explained in the git-fast-export |
| 600 | ** documentation. We had to figure it out via trial and error. |
| 601 | */ |
| 602 | for(i=5; i<(int)strlen(zRefName) && zRefName[i]!='/'; i++){} |
| 603 | gg.tagCommit = strncmp(&zRefName[5], "tags", 4)==0; /* pattern B */ |
| 604 | if( zRefName[i+1]!=0 ) zRefName += i+1; |
| 605 | if( fossil_strcmp(zRefName, "master")==0 ) zRefName = ggit.zMasterName; |
| 606 | gg.zBranch = fossil_strdup(zRefName); |
| 607 | gg.fromLoaded = 0; |
| @@ -767,11 +767,11 @@ | |
| 767 | nFrom = strlen(zFrom); |
| 768 | while( (pFile = import_find_file(zFrom, &i, mx))!=0 ){ |
| 769 | if( pFile->isFrom==0 ) continue; |
| 770 | pNew = import_add_file(); |
| 771 | pFile = &gg.aFile[i-1]; |
| 772 | if( (int)strlen(pFile->zName)>nFrom ){ |
| 773 | pNew->zName = mprintf("%s%s", zTo, pFile->zName+nFrom); |
| 774 | }else{ |
| 775 | pNew->zName = fossil_strdup(zTo); |
| 776 | } |
| 777 | pNew->isExe = pFile->isExe; |
| @@ -790,11 +790,11 @@ | |
| 790 | nFrom = strlen(zFrom); |
| 791 | while( (pFile = import_find_file(zFrom, &i, gg.nFile))!=0 ){ |
| 792 | if( pFile->isFrom==0 ) continue; |
| 793 | pNew = import_add_file(); |
| 794 | pFile = &gg.aFile[i-1]; |
| 795 | if( (int)strlen(pFile->zName)>nFrom ){ |
| 796 | pNew->zName = mprintf("%s%s", zTo, pFile->zName+nFrom); |
| 797 | }else{ |
| 798 | pNew->zName = fossil_strdup(zTo); |
| 799 | } |
| 800 | pNew->zPrior = pFile->zName; |
| @@ -1013,11 +1013,11 @@ | |
| 1013 | zLen = svn_find_header(*rec, "Text-content-length"); |
| 1014 | if( zLen ){ |
| 1015 | rec->contentFlag = 1; |
| 1016 | nLen = atoi(zLen); |
| 1017 | blob_read_from_channel(&rec->content, pIn, nLen); |
| 1018 | if( (int)blob_size(&rec->content)!=nLen ){ |
| 1019 | fossil_fatal("short read: got %d of %d bytes", |
| 1020 | blob_size(&rec->content), nLen |
| 1021 | ); |
| 1022 | } |
| 1023 | }else{ |
| @@ -1278,11 +1278,11 @@ | |
| 1278 | if( gsvn.azIgnTree ){ |
| 1279 | const char **pzIgnTree; |
| 1280 | unsigned nPath = strlen(zPath); |
| 1281 | for( pzIgnTree = gsvn.azIgnTree; *pzIgnTree; ++pzIgnTree ){ |
| 1282 | const char *zIgn = *pzIgnTree; |
| 1283 | unsigned nIgn = strlen(zIgn); |
| 1284 | if( strncmp(zPath, zIgn, nIgn) == 0 |
| 1285 | && ( nPath == nIgn || (nPath > nIgn && zPath[nIgn] == '/')) ){ |
| 1286 | return 0; |
| 1287 | } |
| 1288 | } |
| 1289 |
+1
-1
| --- src/lookslike.c | ||
| +++ src/lookslike.c | ||
| @@ -343,11 +343,11 @@ | ||
| 343 | 343 | const char *z = blob_buffer(pContent); |
| 344 | 344 | int bomSize = 0; |
| 345 | 345 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 346 | 346 | |
| 347 | 347 | if( pnByte ) *pnByte = bomSize; |
| 348 | - if( blob_size(pContent)<bomSize ) return 0; | |
| 348 | + if( (int)blob_size(pContent)<bomSize ) return 0; | |
| 349 | 349 | return memcmp(z, bom, bomSize)==0; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /* |
| 353 | 353 | ** This function returns non-zero if the blob starts with a UTF-16 |
| 354 | 354 |
| --- src/lookslike.c | |
| +++ src/lookslike.c | |
| @@ -343,11 +343,11 @@ | |
| 343 | const char *z = blob_buffer(pContent); |
| 344 | int bomSize = 0; |
| 345 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 346 | |
| 347 | if( pnByte ) *pnByte = bomSize; |
| 348 | if( blob_size(pContent)<bomSize ) return 0; |
| 349 | return memcmp(z, bom, bomSize)==0; |
| 350 | } |
| 351 | |
| 352 | /* |
| 353 | ** This function returns non-zero if the blob starts with a UTF-16 |
| 354 |
| --- src/lookslike.c | |
| +++ src/lookslike.c | |
| @@ -343,11 +343,11 @@ | |
| 343 | const char *z = blob_buffer(pContent); |
| 344 | int bomSize = 0; |
| 345 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 346 | |
| 347 | if( pnByte ) *pnByte = bomSize; |
| 348 | if( (int)blob_size(pContent)<bomSize ) return 0; |
| 349 | return memcmp(z, bom, bomSize)==0; |
| 350 | } |
| 351 | |
| 352 | /* |
| 353 | ** This function returns non-zero if the blob starts with a UTF-16 |
| 354 |
+6
-6
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -427,16 +427,16 @@ | ||
| 427 | 427 | |
| 428 | 428 | g.argc = argc; |
| 429 | 429 | g.argv = argv; |
| 430 | 430 | sqlite3_initialize(); |
| 431 | 431 | #if defined(_WIN32) && defined(BROKEN_MINGW_CMDLINE) |
| 432 | - for(i=0; i<g.argc; i++) g.argv[i] = fossil_mbcs_to_utf8(g.argv[i]); | |
| 432 | + for(i=0; (int)i<g.argc; i++) g.argv[i] = fossil_mbcs_to_utf8(g.argv[i]); | |
| 433 | 433 | #else |
| 434 | - for(i=0; i<g.argc; i++) g.argv[i] = fossil_path_to_utf8(g.argv[i]); | |
| 434 | + for(i=0; (int)i<g.argc; i++) g.argv[i] = fossil_path_to_utf8(g.argv[i]); | |
| 435 | 435 | #endif |
| 436 | 436 | g.nameOfExe = file_fullexename(g.argv[0]); |
| 437 | - for(i=1; i<g.argc-1; i++){ | |
| 437 | + for(i=1; (int)i<g.argc-1; i++){ | |
| 438 | 438 | z = g.argv[i]; |
| 439 | 439 | if( z[0]!='-' ) continue; |
| 440 | 440 | z++; |
| 441 | 441 | if( z[0]=='-' ) z++; |
| 442 | 442 | /* Maintenance reminder: we do not stop at a "--" flag here, |
| @@ -444,11 +444,11 @@ | ||
| 444 | 444 | ** introduces some weird corner cases, as covered in forum thread |
| 445 | 445 | ** 4382bbc66757c39f. e.g. (fossil -U -- --args ...) is handled |
| 446 | 446 | ** differently when we stop at "--" here. */ |
| 447 | 447 | if( fossil_strcmp(z, "args")==0 ) break; |
| 448 | 448 | } |
| 449 | - if( i>=g.argc-1 ) return; | |
| 449 | + if( (int)i>=g.argc-1 ) return; | |
| 450 | 450 | |
| 451 | 451 | zFileName = g.argv[i+1]; |
| 452 | 452 | if( strcmp(zFileName,"-")==0 ){ |
| 453 | 453 | inFile = stdin; |
| 454 | 454 | }else if( !file_isfile(zFileName, ExtFILE) ){ |
| @@ -506,11 +506,11 @@ | ||
| 506 | 506 | if( z[k] ) newArgv[j++] = &z[k]; |
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | } |
| 510 | 510 | i += 2; |
| 511 | - while( i<g.argc ) newArgv[j++] = g.argv[i++]; | |
| 511 | + while( (int)i<g.argc ) newArgv[j++] = g.argv[i++]; | |
| 512 | 512 | newArgv[j] = 0; |
| 513 | 513 | g.argc = j; |
| 514 | 514 | g.argv = newArgv; |
| 515 | 515 | } |
| 516 | 516 | |
| @@ -1761,11 +1761,11 @@ | ||
| 1761 | 1761 | if( c=='_' ) continue; |
| 1762 | 1762 | if( c=='-' && zRepo[j-1]!='/' ) continue; |
| 1763 | 1763 | if( c=='.' && fossil_isalnum(zRepo[j-1]) && fossil_isalnum(zRepo[j+1])){ |
| 1764 | 1764 | continue; |
| 1765 | 1765 | } |
| 1766 | - if( c=='.' && g.fAllowACME && j==nBase+1 | |
| 1766 | + if( c=='.' && g.fAllowACME && j==(int)nBase+1 | |
| 1767 | 1767 | && strncmp(&zRepo[j-1],"/.well-known/",12)==0 |
| 1768 | 1768 | ){ |
| 1769 | 1769 | /* We allow .well-known as the top-level directory for ACME */ |
| 1770 | 1770 | continue; |
| 1771 | 1771 | } |
| 1772 | 1772 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -427,16 +427,16 @@ | |
| 427 | |
| 428 | g.argc = argc; |
| 429 | g.argv = argv; |
| 430 | sqlite3_initialize(); |
| 431 | #if defined(_WIN32) && defined(BROKEN_MINGW_CMDLINE) |
| 432 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_mbcs_to_utf8(g.argv[i]); |
| 433 | #else |
| 434 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_path_to_utf8(g.argv[i]); |
| 435 | #endif |
| 436 | g.nameOfExe = file_fullexename(g.argv[0]); |
| 437 | for(i=1; i<g.argc-1; i++){ |
| 438 | z = g.argv[i]; |
| 439 | if( z[0]!='-' ) continue; |
| 440 | z++; |
| 441 | if( z[0]=='-' ) z++; |
| 442 | /* Maintenance reminder: we do not stop at a "--" flag here, |
| @@ -444,11 +444,11 @@ | |
| 444 | ** introduces some weird corner cases, as covered in forum thread |
| 445 | ** 4382bbc66757c39f. e.g. (fossil -U -- --args ...) is handled |
| 446 | ** differently when we stop at "--" here. */ |
| 447 | if( fossil_strcmp(z, "args")==0 ) break; |
| 448 | } |
| 449 | if( i>=g.argc-1 ) return; |
| 450 | |
| 451 | zFileName = g.argv[i+1]; |
| 452 | if( strcmp(zFileName,"-")==0 ){ |
| 453 | inFile = stdin; |
| 454 | }else if( !file_isfile(zFileName, ExtFILE) ){ |
| @@ -506,11 +506,11 @@ | |
| 506 | if( z[k] ) newArgv[j++] = &z[k]; |
| 507 | } |
| 508 | } |
| 509 | } |
| 510 | i += 2; |
| 511 | while( i<g.argc ) newArgv[j++] = g.argv[i++]; |
| 512 | newArgv[j] = 0; |
| 513 | g.argc = j; |
| 514 | g.argv = newArgv; |
| 515 | } |
| 516 | |
| @@ -1761,11 +1761,11 @@ | |
| 1761 | if( c=='_' ) continue; |
| 1762 | if( c=='-' && zRepo[j-1]!='/' ) continue; |
| 1763 | if( c=='.' && fossil_isalnum(zRepo[j-1]) && fossil_isalnum(zRepo[j+1])){ |
| 1764 | continue; |
| 1765 | } |
| 1766 | if( c=='.' && g.fAllowACME && j==nBase+1 |
| 1767 | && strncmp(&zRepo[j-1],"/.well-known/",12)==0 |
| 1768 | ){ |
| 1769 | /* We allow .well-known as the top-level directory for ACME */ |
| 1770 | continue; |
| 1771 | } |
| 1772 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -427,16 +427,16 @@ | |
| 427 | |
| 428 | g.argc = argc; |
| 429 | g.argv = argv; |
| 430 | sqlite3_initialize(); |
| 431 | #if defined(_WIN32) && defined(BROKEN_MINGW_CMDLINE) |
| 432 | for(i=0; (int)i<g.argc; i++) g.argv[i] = fossil_mbcs_to_utf8(g.argv[i]); |
| 433 | #else |
| 434 | for(i=0; (int)i<g.argc; i++) g.argv[i] = fossil_path_to_utf8(g.argv[i]); |
| 435 | #endif |
| 436 | g.nameOfExe = file_fullexename(g.argv[0]); |
| 437 | for(i=1; (int)i<g.argc-1; i++){ |
| 438 | z = g.argv[i]; |
| 439 | if( z[0]!='-' ) continue; |
| 440 | z++; |
| 441 | if( z[0]=='-' ) z++; |
| 442 | /* Maintenance reminder: we do not stop at a "--" flag here, |
| @@ -444,11 +444,11 @@ | |
| 444 | ** introduces some weird corner cases, as covered in forum thread |
| 445 | ** 4382bbc66757c39f. e.g. (fossil -U -- --args ...) is handled |
| 446 | ** differently when we stop at "--" here. */ |
| 447 | if( fossil_strcmp(z, "args")==0 ) break; |
| 448 | } |
| 449 | if( (int)i>=g.argc-1 ) return; |
| 450 | |
| 451 | zFileName = g.argv[i+1]; |
| 452 | if( strcmp(zFileName,"-")==0 ){ |
| 453 | inFile = stdin; |
| 454 | }else if( !file_isfile(zFileName, ExtFILE) ){ |
| @@ -506,11 +506,11 @@ | |
| 506 | if( z[k] ) newArgv[j++] = &z[k]; |
| 507 | } |
| 508 | } |
| 509 | } |
| 510 | i += 2; |
| 511 | while( (int)i<g.argc ) newArgv[j++] = g.argv[i++]; |
| 512 | newArgv[j] = 0; |
| 513 | g.argc = j; |
| 514 | g.argv = newArgv; |
| 515 | } |
| 516 | |
| @@ -1761,11 +1761,11 @@ | |
| 1761 | if( c=='_' ) continue; |
| 1762 | if( c=='-' && zRepo[j-1]!='/' ) continue; |
| 1763 | if( c=='.' && fossil_isalnum(zRepo[j-1]) && fossil_isalnum(zRepo[j+1])){ |
| 1764 | continue; |
| 1765 | } |
| 1766 | if( c=='.' && g.fAllowACME && j==(int)nBase+1 |
| 1767 | && strncmp(&zRepo[j-1],"/.well-known/",12)==0 |
| 1768 | ){ |
| 1769 | /* We allow .well-known as the top-level directory for ACME */ |
| 1770 | continue; |
| 1771 | } |
| 1772 |
+19
-17
| --- src/markdown.c | ||
| +++ src/markdown.c | ||
| @@ -396,11 +396,11 @@ | ||
| 396 | 396 | /* release the given working buffer back to the cache */ |
| 397 | 397 | static void release_work_buffer(struct render *rndr, struct Blob *buf){ |
| 398 | 398 | if( !buf ) return; |
| 399 | 399 | rndr->iDepth--; |
| 400 | 400 | blob_reset(buf); |
| 401 | - if( rndr->nBlobCache < sizeof(rndr->aBlobCache)/sizeof(rndr->aBlobCache[0]) ){ | |
| 401 | + if( rndr->nBlobCache < (int)(sizeof(rndr->aBlobCache)/sizeof(rndr->aBlobCache[0])) ){ | |
| 402 | 402 | rndr->aBlobCache[rndr->nBlobCache++] = buf; |
| 403 | 403 | }else{ |
| 404 | 404 | fossil_free(buf); |
| 405 | 405 | } |
| 406 | 406 | } |
| @@ -1570,13 +1570,13 @@ | ||
| 1570 | 1570 | ** block. */ |
| 1571 | 1571 | static size_t prefix_fencedcode(char *data, size_t size){ |
| 1572 | 1572 | char c = data[0]; |
| 1573 | 1573 | int nb; |
| 1574 | 1574 | if( c!='`' && c!='~' ) return 0; |
| 1575 | - for(nb=1; nb<size-3 && data[nb]==c; nb++){} | |
| 1575 | + for(nb=1; nb<(int)size-3 && data[nb]==c; nb++){} | |
| 1576 | 1576 | if( nb<3 ) return 0; |
| 1577 | - if( nb>=size-nb ) return 0; | |
| 1577 | + if( nb>=(int)size-nb ) return 0; | |
| 1578 | 1578 | return nb; |
| 1579 | 1579 | } |
| 1580 | 1580 | |
| 1581 | 1581 | /* prefix_oli -- returns ordered list item prefix */ |
| 1582 | 1582 | static size_t prefix_oli(char *data, size_t size){ |
| @@ -1687,11 +1687,11 @@ | ||
| 1687 | 1687 | char *work_data = data; |
| 1688 | 1688 | size_t work_size = 0; |
| 1689 | 1689 | |
| 1690 | 1690 | while( i<size ){ |
| 1691 | 1691 | char *zEnd = memchr(data+i, '\n', size-i-1); |
| 1692 | - end = zEnd==0 ? size : (int)(zEnd - (data-1)); | |
| 1692 | + end = zEnd==0 ? size : (size_t)(zEnd - (data-1)); | |
| 1693 | 1693 | /* The above is the same as: |
| 1694 | 1694 | ** for(end=i+1; end<size && data[end-1]!='\n'; end++); |
| 1695 | 1695 | ** "end" is left with a value such that data[end] is one byte |
| 1696 | 1696 | ** past the first '\n' or one byte past the end of the string */ |
| 1697 | 1697 | if( is_empty(data+i, size-i) |
| @@ -1760,11 +1760,11 @@ | ||
| 1760 | 1760 | struct Blob *work = new_work_buffer(rndr); |
| 1761 | 1761 | |
| 1762 | 1762 | beg = 0; |
| 1763 | 1763 | while( beg<size ){ |
| 1764 | 1764 | char *zEnd = memchr(data+beg, '\n', size-beg-1); |
| 1765 | - end = zEnd==0 ? size : (int)(zEnd - (data-1)); | |
| 1765 | + end = zEnd==0 ? size : (size_t)(zEnd - (data-1)); | |
| 1766 | 1766 | /* The above is the same as: |
| 1767 | 1767 | ** for(end=beg+1; end<size && data[end-1]!='\n'; end++); |
| 1768 | 1768 | ** "end" is left with a value such that data[end] is one byte |
| 1769 | 1769 | ** past the first \n or past then end of the string. */ |
| 1770 | 1770 | pre = prefix_code(data+beg, end-beg); |
| @@ -1970,13 +1970,13 @@ | ||
| 1970 | 1970 | int level = 0; |
| 1971 | 1971 | size_t i, end, skip, span_beg, span_size; |
| 1972 | 1972 | |
| 1973 | 1973 | if( !size || data[0]!='#' ) return 0; |
| 1974 | 1974 | |
| 1975 | - while( level<size && level<6 && data[level]=='#' ){ level++; } | |
| 1975 | + while( level<(int)size && level<6 && data[level]=='#' ){ level++; } | |
| 1976 | 1976 | for(i=level; i<size && (data[i]==' ' || data[i]=='\t'); i++); |
| 1977 | - if ( i == level ) return parse_paragraph(ob, rndr, data, size); | |
| 1977 | + if ( (int)i == level ) return parse_paragraph(ob, rndr, data, size); | |
| 1978 | 1978 | span_beg = i; |
| 1979 | 1979 | |
| 1980 | 1980 | for(end=i; end<size && data[end]!='\n'; end++); |
| 1981 | 1981 | skip = end; |
| 1982 | 1982 | if( end<=i ) return parse_paragraph(ob, rndr, data, size); |
| @@ -2005,11 +2005,11 @@ | ||
| 2005 | 2005 | size_t i, w; |
| 2006 | 2006 | |
| 2007 | 2007 | /* assuming data[0]=='<' && data[1]=='/' already tested */ |
| 2008 | 2008 | |
| 2009 | 2009 | /* checking tag is a match */ |
| 2010 | - if( (tag->size+3)>size | |
| 2010 | + if( (tag->size+3)>(int)size | |
| 2011 | 2011 | || fossil_strnicmp(data+2, tag->text, tag->size) |
| 2012 | 2012 | || data[tag->size+2]!='>' |
| 2013 | 2013 | ){ |
| 2014 | 2014 | return 0; |
| 2015 | 2015 | } |
| @@ -2635,11 +2635,12 @@ | ||
| 2635 | 2635 | const struct Blob *ib, /* input blob in markdown */ |
| 2636 | 2636 | const struct mkd_renderer *rndrer /* renderer descriptor (callbacks) */ |
| 2637 | 2637 | ){ |
| 2638 | 2638 | struct link_ref *lr; |
| 2639 | 2639 | struct footnote *fn; |
| 2640 | - size_t i, beg, end = 0; | |
| 2640 | + int i; | |
| 2641 | + size_t beg, end = 0; | |
| 2641 | 2642 | struct render rndr; |
| 2642 | 2643 | size_t size; |
| 2643 | 2644 | Blob text = BLOB_INITIALIZER; /* input after the first pass */ |
| 2644 | 2645 | Blob * const allNotes = &rndr.notes.all; |
| 2645 | 2646 | |
| @@ -2719,11 +2720,12 @@ | ||
| 2719 | 2720 | qsort(fn, rndr.notes.nLbled, sizeof(struct footnote), cmp_footnote_id); |
| 2720 | 2721 | |
| 2721 | 2722 | /* concatenate footnotes with equal labels */ |
| 2722 | 2723 | for(i=0; i<rndr.notes.nLbled ;){ |
| 2723 | 2724 | struct footnote *x = fn + i; |
| 2724 | - size_t j = i+1, k = blob_size(&x->text) + 64 + blob_size(&x->upc); | |
| 2725 | + int j = i+1; | |
| 2726 | + size_t k = blob_size(&x->text) + 64 + blob_size(&x->upc); | |
| 2725 | 2727 | while(j<rndr.notes.nLbled && !blob_compare(&x->id, &fn[j].id)){ |
| 2726 | 2728 | k += blob_size(&fn[j].text) + 10 + blob_size(&fn[j].upc); |
| 2727 | 2729 | j++; |
| 2728 | 2730 | nDups++; |
| 2729 | 2731 | } |
| @@ -2730,11 +2732,11 @@ | ||
| 2730 | 2732 | if( i+1<j ){ |
| 2731 | 2733 | Blob list = empty_blob; |
| 2732 | 2734 | blob_reserve(&list, k); |
| 2733 | 2735 | /* must match _joined_footnote_indicator in html_footnote_item() */ |
| 2734 | 2736 | blob_append_literal(&list, "<ul class='fn-joined'>\n"); |
| 2735 | - for(k=i; k<j; k++){ | |
| 2737 | + for(k=i; (int)k<j; k++){ | |
| 2736 | 2738 | struct footnote *y = fn + k; |
| 2737 | 2739 | blob_append_literal(&list, "<li>"); |
| 2738 | 2740 | if( blob_size(&y->upc) ){ |
| 2739 | 2741 | blob_appendb(&list, &y->upc); |
| 2740 | 2742 | blob_reset(&y->upc); |
| @@ -2742,11 +2744,11 @@ | ||
| 2742 | 2744 | blob_appendb(&list, &y->text); |
| 2743 | 2745 | blob_append_literal(&list, "</li>\n"); |
| 2744 | 2746 | |
| 2745 | 2747 | /* free memory buffer */ |
| 2746 | 2748 | blob_reset(&y->text); |
| 2747 | - if( k!=i ) blob_reset(&y->id); | |
| 2749 | + if( (int)k!=i ) blob_reset(&y->id); | |
| 2748 | 2750 | } |
| 2749 | 2751 | blob_append_literal(&list, "</ul>\n"); |
| 2750 | 2752 | x->text = list; |
| 2751 | 2753 | g.ftntsIssues[2]++; |
| 2752 | 2754 | } |
| @@ -2762,11 +2764,11 @@ | ||
| 2762 | 2764 | } |
| 2763 | 2765 | } |
| 2764 | 2766 | blob_reset( allNotes ); |
| 2765 | 2767 | rndr.notes.all = filtered; |
| 2766 | 2768 | rndr.notes.nLbled = n; |
| 2767 | - assert( COUNT_FOOTNOTES(allNotes) == rndr.notes.nLbled ); | |
| 2769 | + assert( (int)(COUNT_FOOTNOTES(allNotes)) == rndr.notes.nLbled ); | |
| 2768 | 2770 | } |
| 2769 | 2771 | } |
| 2770 | 2772 | fn = CAST_AS_FOOTNOTES( allNotes ); |
| 2771 | 2773 | for(i=0; i<rndr.notes.nLbled; i++){ |
| 2772 | 2774 | fn[i].index = i; |
| @@ -2830,11 +2832,11 @@ | ||
| 2830 | 2832 | ** If it doesn't then a compiler has done something very weird. |
| 2831 | 2833 | */ |
| 2832 | 2834 | assert( &(rndr.notes.misref.id) == &(rndr.notes.misref.text) - 1 ); |
| 2833 | 2835 | assert( &(rndr.notes.misref.upc) == &(rndr.notes.misref.text) + 1 ); |
| 2834 | 2836 | |
| 2835 | - for(i=0; i<COUNT_FOOTNOTES(notes); i++){ | |
| 2837 | + for(i=0; i<(int)(COUNT_FOOTNOTES(notes)); i++){ | |
| 2836 | 2838 | const struct footnote* x = CAST_AS_FOOTNOTES(notes) + i; |
| 2837 | 2839 | const int xUsed = x->bRndred ? x->nUsed : 0; |
| 2838 | 2840 | if( !x->iMark ) break; |
| 2839 | 2841 | assert( x->nUsed ); |
| 2840 | 2842 | rndr.make.footnote_item(all_items, &x->text, x->iMark, |
| @@ -2845,11 +2847,11 @@ | ||
| 2845 | 2847 | if( rndr.notes.misref.nUsed ){ |
| 2846 | 2848 | rndr.make.footnote_item(all_items, 0, -1, |
| 2847 | 2849 | rndr.notes.misref.nUsed, rndr.make.opaque); |
| 2848 | 2850 | g.ftntsIssues[0] += rndr.notes.misref.nUsed; |
| 2849 | 2851 | } |
| 2850 | - while( ++j < COUNT_FOOTNOTES(notes) ){ | |
| 2852 | + while( ++j < (int)(COUNT_FOOTNOTES(notes)) ){ | |
| 2851 | 2853 | const struct footnote* x = CAST_AS_FOOTNOTES(notes) + j; |
| 2852 | 2854 | assert( !x->iMark ); |
| 2853 | 2855 | assert( !x->nUsed ); |
| 2854 | 2856 | assert( !x->bRndred ); |
| 2855 | 2857 | rndr.make.footnote_item(all_items,&x->text,0,0,rndr.make.opaque); |
| @@ -2865,23 +2867,23 @@ | ||
| 2865 | 2867 | /* clean-up */ |
| 2866 | 2868 | assert( rndr.iDepth==0 ); |
| 2867 | 2869 | blob_reset(&text); |
| 2868 | 2870 | lr = (struct link_ref *)blob_buffer(&rndr.refs); |
| 2869 | 2871 | end = blob_size(&rndr.refs)/sizeof(struct link_ref); |
| 2870 | - for(i=0; i<end; i++){ | |
| 2872 | + for(i=0; i<(int)end; i++){ | |
| 2871 | 2873 | blob_reset(&lr[i].id); |
| 2872 | 2874 | blob_reset(&lr[i].link); |
| 2873 | 2875 | blob_reset(&lr[i].title); |
| 2874 | 2876 | } |
| 2875 | 2877 | blob_reset(&rndr.refs); |
| 2876 | 2878 | fn = CAST_AS_FOOTNOTES( allNotes ); |
| 2877 | 2879 | end = COUNT_FOOTNOTES( allNotes ); |
| 2878 | - for(i=0; i<end; i++){ | |
| 2880 | + for(i=0; i<(int)end; i++){ | |
| 2879 | 2881 | if(blob_size(&fn[i].id)) blob_reset(&fn[i].id); |
| 2880 | 2882 | if(blob_size(&fn[i].upc)) blob_reset(&fn[i].upc); |
| 2881 | 2883 | blob_reset(&fn[i].text); |
| 2882 | 2884 | } |
| 2883 | 2885 | blob_reset(&rndr.notes.all); |
| 2884 | 2886 | for(i=0; i<rndr.nBlobCache; i++){ |
| 2885 | 2887 | fossil_free(rndr.aBlobCache[i]); |
| 2886 | 2888 | } |
| 2887 | 2889 | } |
| 2888 | 2890 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -396,11 +396,11 @@ | |
| 396 | /* release the given working buffer back to the cache */ |
| 397 | static void release_work_buffer(struct render *rndr, struct Blob *buf){ |
| 398 | if( !buf ) return; |
| 399 | rndr->iDepth--; |
| 400 | blob_reset(buf); |
| 401 | if( rndr->nBlobCache < sizeof(rndr->aBlobCache)/sizeof(rndr->aBlobCache[0]) ){ |
| 402 | rndr->aBlobCache[rndr->nBlobCache++] = buf; |
| 403 | }else{ |
| 404 | fossil_free(buf); |
| 405 | } |
| 406 | } |
| @@ -1570,13 +1570,13 @@ | |
| 1570 | ** block. */ |
| 1571 | static size_t prefix_fencedcode(char *data, size_t size){ |
| 1572 | char c = data[0]; |
| 1573 | int nb; |
| 1574 | if( c!='`' && c!='~' ) return 0; |
| 1575 | for(nb=1; nb<size-3 && data[nb]==c; nb++){} |
| 1576 | if( nb<3 ) return 0; |
| 1577 | if( nb>=size-nb ) return 0; |
| 1578 | return nb; |
| 1579 | } |
| 1580 | |
| 1581 | /* prefix_oli -- returns ordered list item prefix */ |
| 1582 | static size_t prefix_oli(char *data, size_t size){ |
| @@ -1687,11 +1687,11 @@ | |
| 1687 | char *work_data = data; |
| 1688 | size_t work_size = 0; |
| 1689 | |
| 1690 | while( i<size ){ |
| 1691 | char *zEnd = memchr(data+i, '\n', size-i-1); |
| 1692 | end = zEnd==0 ? size : (int)(zEnd - (data-1)); |
| 1693 | /* The above is the same as: |
| 1694 | ** for(end=i+1; end<size && data[end-1]!='\n'; end++); |
| 1695 | ** "end" is left with a value such that data[end] is one byte |
| 1696 | ** past the first '\n' or one byte past the end of the string */ |
| 1697 | if( is_empty(data+i, size-i) |
| @@ -1760,11 +1760,11 @@ | |
| 1760 | struct Blob *work = new_work_buffer(rndr); |
| 1761 | |
| 1762 | beg = 0; |
| 1763 | while( beg<size ){ |
| 1764 | char *zEnd = memchr(data+beg, '\n', size-beg-1); |
| 1765 | end = zEnd==0 ? size : (int)(zEnd - (data-1)); |
| 1766 | /* The above is the same as: |
| 1767 | ** for(end=beg+1; end<size && data[end-1]!='\n'; end++); |
| 1768 | ** "end" is left with a value such that data[end] is one byte |
| 1769 | ** past the first \n or past then end of the string. */ |
| 1770 | pre = prefix_code(data+beg, end-beg); |
| @@ -1970,13 +1970,13 @@ | |
| 1970 | int level = 0; |
| 1971 | size_t i, end, skip, span_beg, span_size; |
| 1972 | |
| 1973 | if( !size || data[0]!='#' ) return 0; |
| 1974 | |
| 1975 | while( level<size && level<6 && data[level]=='#' ){ level++; } |
| 1976 | for(i=level; i<size && (data[i]==' ' || data[i]=='\t'); i++); |
| 1977 | if ( i == level ) return parse_paragraph(ob, rndr, data, size); |
| 1978 | span_beg = i; |
| 1979 | |
| 1980 | for(end=i; end<size && data[end]!='\n'; end++); |
| 1981 | skip = end; |
| 1982 | if( end<=i ) return parse_paragraph(ob, rndr, data, size); |
| @@ -2005,11 +2005,11 @@ | |
| 2005 | size_t i, w; |
| 2006 | |
| 2007 | /* assuming data[0]=='<' && data[1]=='/' already tested */ |
| 2008 | |
| 2009 | /* checking tag is a match */ |
| 2010 | if( (tag->size+3)>size |
| 2011 | || fossil_strnicmp(data+2, tag->text, tag->size) |
| 2012 | || data[tag->size+2]!='>' |
| 2013 | ){ |
| 2014 | return 0; |
| 2015 | } |
| @@ -2635,11 +2635,12 @@ | |
| 2635 | const struct Blob *ib, /* input blob in markdown */ |
| 2636 | const struct mkd_renderer *rndrer /* renderer descriptor (callbacks) */ |
| 2637 | ){ |
| 2638 | struct link_ref *lr; |
| 2639 | struct footnote *fn; |
| 2640 | size_t i, beg, end = 0; |
| 2641 | struct render rndr; |
| 2642 | size_t size; |
| 2643 | Blob text = BLOB_INITIALIZER; /* input after the first pass */ |
| 2644 | Blob * const allNotes = &rndr.notes.all; |
| 2645 | |
| @@ -2719,11 +2720,12 @@ | |
| 2719 | qsort(fn, rndr.notes.nLbled, sizeof(struct footnote), cmp_footnote_id); |
| 2720 | |
| 2721 | /* concatenate footnotes with equal labels */ |
| 2722 | for(i=0; i<rndr.notes.nLbled ;){ |
| 2723 | struct footnote *x = fn + i; |
| 2724 | size_t j = i+1, k = blob_size(&x->text) + 64 + blob_size(&x->upc); |
| 2725 | while(j<rndr.notes.nLbled && !blob_compare(&x->id, &fn[j].id)){ |
| 2726 | k += blob_size(&fn[j].text) + 10 + blob_size(&fn[j].upc); |
| 2727 | j++; |
| 2728 | nDups++; |
| 2729 | } |
| @@ -2730,11 +2732,11 @@ | |
| 2730 | if( i+1<j ){ |
| 2731 | Blob list = empty_blob; |
| 2732 | blob_reserve(&list, k); |
| 2733 | /* must match _joined_footnote_indicator in html_footnote_item() */ |
| 2734 | blob_append_literal(&list, "<ul class='fn-joined'>\n"); |
| 2735 | for(k=i; k<j; k++){ |
| 2736 | struct footnote *y = fn + k; |
| 2737 | blob_append_literal(&list, "<li>"); |
| 2738 | if( blob_size(&y->upc) ){ |
| 2739 | blob_appendb(&list, &y->upc); |
| 2740 | blob_reset(&y->upc); |
| @@ -2742,11 +2744,11 @@ | |
| 2742 | blob_appendb(&list, &y->text); |
| 2743 | blob_append_literal(&list, "</li>\n"); |
| 2744 | |
| 2745 | /* free memory buffer */ |
| 2746 | blob_reset(&y->text); |
| 2747 | if( k!=i ) blob_reset(&y->id); |
| 2748 | } |
| 2749 | blob_append_literal(&list, "</ul>\n"); |
| 2750 | x->text = list; |
| 2751 | g.ftntsIssues[2]++; |
| 2752 | } |
| @@ -2762,11 +2764,11 @@ | |
| 2762 | } |
| 2763 | } |
| 2764 | blob_reset( allNotes ); |
| 2765 | rndr.notes.all = filtered; |
| 2766 | rndr.notes.nLbled = n; |
| 2767 | assert( COUNT_FOOTNOTES(allNotes) == rndr.notes.nLbled ); |
| 2768 | } |
| 2769 | } |
| 2770 | fn = CAST_AS_FOOTNOTES( allNotes ); |
| 2771 | for(i=0; i<rndr.notes.nLbled; i++){ |
| 2772 | fn[i].index = i; |
| @@ -2830,11 +2832,11 @@ | |
| 2830 | ** If it doesn't then a compiler has done something very weird. |
| 2831 | */ |
| 2832 | assert( &(rndr.notes.misref.id) == &(rndr.notes.misref.text) - 1 ); |
| 2833 | assert( &(rndr.notes.misref.upc) == &(rndr.notes.misref.text) + 1 ); |
| 2834 | |
| 2835 | for(i=0; i<COUNT_FOOTNOTES(notes); i++){ |
| 2836 | const struct footnote* x = CAST_AS_FOOTNOTES(notes) + i; |
| 2837 | const int xUsed = x->bRndred ? x->nUsed : 0; |
| 2838 | if( !x->iMark ) break; |
| 2839 | assert( x->nUsed ); |
| 2840 | rndr.make.footnote_item(all_items, &x->text, x->iMark, |
| @@ -2845,11 +2847,11 @@ | |
| 2845 | if( rndr.notes.misref.nUsed ){ |
| 2846 | rndr.make.footnote_item(all_items, 0, -1, |
| 2847 | rndr.notes.misref.nUsed, rndr.make.opaque); |
| 2848 | g.ftntsIssues[0] += rndr.notes.misref.nUsed; |
| 2849 | } |
| 2850 | while( ++j < COUNT_FOOTNOTES(notes) ){ |
| 2851 | const struct footnote* x = CAST_AS_FOOTNOTES(notes) + j; |
| 2852 | assert( !x->iMark ); |
| 2853 | assert( !x->nUsed ); |
| 2854 | assert( !x->bRndred ); |
| 2855 | rndr.make.footnote_item(all_items,&x->text,0,0,rndr.make.opaque); |
| @@ -2865,23 +2867,23 @@ | |
| 2865 | /* clean-up */ |
| 2866 | assert( rndr.iDepth==0 ); |
| 2867 | blob_reset(&text); |
| 2868 | lr = (struct link_ref *)blob_buffer(&rndr.refs); |
| 2869 | end = blob_size(&rndr.refs)/sizeof(struct link_ref); |
| 2870 | for(i=0; i<end; i++){ |
| 2871 | blob_reset(&lr[i].id); |
| 2872 | blob_reset(&lr[i].link); |
| 2873 | blob_reset(&lr[i].title); |
| 2874 | } |
| 2875 | blob_reset(&rndr.refs); |
| 2876 | fn = CAST_AS_FOOTNOTES( allNotes ); |
| 2877 | end = COUNT_FOOTNOTES( allNotes ); |
| 2878 | for(i=0; i<end; i++){ |
| 2879 | if(blob_size(&fn[i].id)) blob_reset(&fn[i].id); |
| 2880 | if(blob_size(&fn[i].upc)) blob_reset(&fn[i].upc); |
| 2881 | blob_reset(&fn[i].text); |
| 2882 | } |
| 2883 | blob_reset(&rndr.notes.all); |
| 2884 | for(i=0; i<rndr.nBlobCache; i++){ |
| 2885 | fossil_free(rndr.aBlobCache[i]); |
| 2886 | } |
| 2887 | } |
| 2888 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -396,11 +396,11 @@ | |
| 396 | /* release the given working buffer back to the cache */ |
| 397 | static void release_work_buffer(struct render *rndr, struct Blob *buf){ |
| 398 | if( !buf ) return; |
| 399 | rndr->iDepth--; |
| 400 | blob_reset(buf); |
| 401 | if( rndr->nBlobCache < (int)(sizeof(rndr->aBlobCache)/sizeof(rndr->aBlobCache[0])) ){ |
| 402 | rndr->aBlobCache[rndr->nBlobCache++] = buf; |
| 403 | }else{ |
| 404 | fossil_free(buf); |
| 405 | } |
| 406 | } |
| @@ -1570,13 +1570,13 @@ | |
| 1570 | ** block. */ |
| 1571 | static size_t prefix_fencedcode(char *data, size_t size){ |
| 1572 | char c = data[0]; |
| 1573 | int nb; |
| 1574 | if( c!='`' && c!='~' ) return 0; |
| 1575 | for(nb=1; nb<(int)size-3 && data[nb]==c; nb++){} |
| 1576 | if( nb<3 ) return 0; |
| 1577 | if( nb>=(int)size-nb ) return 0; |
| 1578 | return nb; |
| 1579 | } |
| 1580 | |
| 1581 | /* prefix_oli -- returns ordered list item prefix */ |
| 1582 | static size_t prefix_oli(char *data, size_t size){ |
| @@ -1687,11 +1687,11 @@ | |
| 1687 | char *work_data = data; |
| 1688 | size_t work_size = 0; |
| 1689 | |
| 1690 | while( i<size ){ |
| 1691 | char *zEnd = memchr(data+i, '\n', size-i-1); |
| 1692 | end = zEnd==0 ? size : (size_t)(zEnd - (data-1)); |
| 1693 | /* The above is the same as: |
| 1694 | ** for(end=i+1; end<size && data[end-1]!='\n'; end++); |
| 1695 | ** "end" is left with a value such that data[end] is one byte |
| 1696 | ** past the first '\n' or one byte past the end of the string */ |
| 1697 | if( is_empty(data+i, size-i) |
| @@ -1760,11 +1760,11 @@ | |
| 1760 | struct Blob *work = new_work_buffer(rndr); |
| 1761 | |
| 1762 | beg = 0; |
| 1763 | while( beg<size ){ |
| 1764 | char *zEnd = memchr(data+beg, '\n', size-beg-1); |
| 1765 | end = zEnd==0 ? size : (size_t)(zEnd - (data-1)); |
| 1766 | /* The above is the same as: |
| 1767 | ** for(end=beg+1; end<size && data[end-1]!='\n'; end++); |
| 1768 | ** "end" is left with a value such that data[end] is one byte |
| 1769 | ** past the first \n or past then end of the string. */ |
| 1770 | pre = prefix_code(data+beg, end-beg); |
| @@ -1970,13 +1970,13 @@ | |
| 1970 | int level = 0; |
| 1971 | size_t i, end, skip, span_beg, span_size; |
| 1972 | |
| 1973 | if( !size || data[0]!='#' ) return 0; |
| 1974 | |
| 1975 | while( level<(int)size && level<6 && data[level]=='#' ){ level++; } |
| 1976 | for(i=level; i<size && (data[i]==' ' || data[i]=='\t'); i++); |
| 1977 | if ( (int)i == level ) return parse_paragraph(ob, rndr, data, size); |
| 1978 | span_beg = i; |
| 1979 | |
| 1980 | for(end=i; end<size && data[end]!='\n'; end++); |
| 1981 | skip = end; |
| 1982 | if( end<=i ) return parse_paragraph(ob, rndr, data, size); |
| @@ -2005,11 +2005,11 @@ | |
| 2005 | size_t i, w; |
| 2006 | |
| 2007 | /* assuming data[0]=='<' && data[1]=='/' already tested */ |
| 2008 | |
| 2009 | /* checking tag is a match */ |
| 2010 | if( (tag->size+3)>(int)size |
| 2011 | || fossil_strnicmp(data+2, tag->text, tag->size) |
| 2012 | || data[tag->size+2]!='>' |
| 2013 | ){ |
| 2014 | return 0; |
| 2015 | } |
| @@ -2635,11 +2635,12 @@ | |
| 2635 | const struct Blob *ib, /* input blob in markdown */ |
| 2636 | const struct mkd_renderer *rndrer /* renderer descriptor (callbacks) */ |
| 2637 | ){ |
| 2638 | struct link_ref *lr; |
| 2639 | struct footnote *fn; |
| 2640 | int i; |
| 2641 | size_t beg, end = 0; |
| 2642 | struct render rndr; |
| 2643 | size_t size; |
| 2644 | Blob text = BLOB_INITIALIZER; /* input after the first pass */ |
| 2645 | Blob * const allNotes = &rndr.notes.all; |
| 2646 | |
| @@ -2719,11 +2720,12 @@ | |
| 2720 | qsort(fn, rndr.notes.nLbled, sizeof(struct footnote), cmp_footnote_id); |
| 2721 | |
| 2722 | /* concatenate footnotes with equal labels */ |
| 2723 | for(i=0; i<rndr.notes.nLbled ;){ |
| 2724 | struct footnote *x = fn + i; |
| 2725 | int j = i+1; |
| 2726 | size_t k = blob_size(&x->text) + 64 + blob_size(&x->upc); |
| 2727 | while(j<rndr.notes.nLbled && !blob_compare(&x->id, &fn[j].id)){ |
| 2728 | k += blob_size(&fn[j].text) + 10 + blob_size(&fn[j].upc); |
| 2729 | j++; |
| 2730 | nDups++; |
| 2731 | } |
| @@ -2730,11 +2732,11 @@ | |
| 2732 | if( i+1<j ){ |
| 2733 | Blob list = empty_blob; |
| 2734 | blob_reserve(&list, k); |
| 2735 | /* must match _joined_footnote_indicator in html_footnote_item() */ |
| 2736 | blob_append_literal(&list, "<ul class='fn-joined'>\n"); |
| 2737 | for(k=i; (int)k<j; k++){ |
| 2738 | struct footnote *y = fn + k; |
| 2739 | blob_append_literal(&list, "<li>"); |
| 2740 | if( blob_size(&y->upc) ){ |
| 2741 | blob_appendb(&list, &y->upc); |
| 2742 | blob_reset(&y->upc); |
| @@ -2742,11 +2744,11 @@ | |
| 2744 | blob_appendb(&list, &y->text); |
| 2745 | blob_append_literal(&list, "</li>\n"); |
| 2746 | |
| 2747 | /* free memory buffer */ |
| 2748 | blob_reset(&y->text); |
| 2749 | if( (int)k!=i ) blob_reset(&y->id); |
| 2750 | } |
| 2751 | blob_append_literal(&list, "</ul>\n"); |
| 2752 | x->text = list; |
| 2753 | g.ftntsIssues[2]++; |
| 2754 | } |
| @@ -2762,11 +2764,11 @@ | |
| 2764 | } |
| 2765 | } |
| 2766 | blob_reset( allNotes ); |
| 2767 | rndr.notes.all = filtered; |
| 2768 | rndr.notes.nLbled = n; |
| 2769 | assert( (int)(COUNT_FOOTNOTES(allNotes)) == rndr.notes.nLbled ); |
| 2770 | } |
| 2771 | } |
| 2772 | fn = CAST_AS_FOOTNOTES( allNotes ); |
| 2773 | for(i=0; i<rndr.notes.nLbled; i++){ |
| 2774 | fn[i].index = i; |
| @@ -2830,11 +2832,11 @@ | |
| 2832 | ** If it doesn't then a compiler has done something very weird. |
| 2833 | */ |
| 2834 | assert( &(rndr.notes.misref.id) == &(rndr.notes.misref.text) - 1 ); |
| 2835 | assert( &(rndr.notes.misref.upc) == &(rndr.notes.misref.text) + 1 ); |
| 2836 | |
| 2837 | for(i=0; i<(int)(COUNT_FOOTNOTES(notes)); i++){ |
| 2838 | const struct footnote* x = CAST_AS_FOOTNOTES(notes) + i; |
| 2839 | const int xUsed = x->bRndred ? x->nUsed : 0; |
| 2840 | if( !x->iMark ) break; |
| 2841 | assert( x->nUsed ); |
| 2842 | rndr.make.footnote_item(all_items, &x->text, x->iMark, |
| @@ -2845,11 +2847,11 @@ | |
| 2847 | if( rndr.notes.misref.nUsed ){ |
| 2848 | rndr.make.footnote_item(all_items, 0, -1, |
| 2849 | rndr.notes.misref.nUsed, rndr.make.opaque); |
| 2850 | g.ftntsIssues[0] += rndr.notes.misref.nUsed; |
| 2851 | } |
| 2852 | while( ++j < (int)(COUNT_FOOTNOTES(notes)) ){ |
| 2853 | const struct footnote* x = CAST_AS_FOOTNOTES(notes) + j; |
| 2854 | assert( !x->iMark ); |
| 2855 | assert( !x->nUsed ); |
| 2856 | assert( !x->bRndred ); |
| 2857 | rndr.make.footnote_item(all_items,&x->text,0,0,rndr.make.opaque); |
| @@ -2865,23 +2867,23 @@ | |
| 2867 | /* clean-up */ |
| 2868 | assert( rndr.iDepth==0 ); |
| 2869 | blob_reset(&text); |
| 2870 | lr = (struct link_ref *)blob_buffer(&rndr.refs); |
| 2871 | end = blob_size(&rndr.refs)/sizeof(struct link_ref); |
| 2872 | for(i=0; i<(int)end; i++){ |
| 2873 | blob_reset(&lr[i].id); |
| 2874 | blob_reset(&lr[i].link); |
| 2875 | blob_reset(&lr[i].title); |
| 2876 | } |
| 2877 | blob_reset(&rndr.refs); |
| 2878 | fn = CAST_AS_FOOTNOTES( allNotes ); |
| 2879 | end = COUNT_FOOTNOTES( allNotes ); |
| 2880 | for(i=0; i<(int)end; i++){ |
| 2881 | if(blob_size(&fn[i].id)) blob_reset(&fn[i].id); |
| 2882 | if(blob_size(&fn[i].upc)) blob_reset(&fn[i].upc); |
| 2883 | blob_reset(&fn[i].text); |
| 2884 | } |
| 2885 | blob_reset(&rndr.notes.all); |
| 2886 | for(i=0; i<rndr.nBlobCache; i++){ |
| 2887 | fossil_free(rndr.aBlobCache[i]); |
| 2888 | } |
| 2889 | } |
| 2890 |
+1
-1
| --- src/merge3.c | ||
| +++ src/merge3.c | ||
| @@ -456,11 +456,11 @@ | ||
| 456 | 456 | } |
| 457 | 457 | if( blob_read_from_file(&v2, g.argv[4], ExtFILE)<0 ){ |
| 458 | 458 | fossil_fatal("cannot read %s", g.argv[4]); |
| 459 | 459 | } |
| 460 | 460 | nConflict = blob_merge(&pivot, &v1, &v2, &merged); |
| 461 | - if( blob_write_to_file(&merged, g.argv[5])<blob_size(&merged) ){ | |
| 461 | + if( blob_write_to_file(&merged, g.argv[5])<(int)blob_size(&merged) ){ | |
| 462 | 462 | fossil_fatal("cannot write %s", g.argv[4]); |
| 463 | 463 | } |
| 464 | 464 | blob_reset(&pivot); |
| 465 | 465 | blob_reset(&v1); |
| 466 | 466 | blob_reset(&v2); |
| 467 | 467 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -456,11 +456,11 @@ | |
| 456 | } |
| 457 | if( blob_read_from_file(&v2, g.argv[4], ExtFILE)<0 ){ |
| 458 | fossil_fatal("cannot read %s", g.argv[4]); |
| 459 | } |
| 460 | nConflict = blob_merge(&pivot, &v1, &v2, &merged); |
| 461 | if( blob_write_to_file(&merged, g.argv[5])<blob_size(&merged) ){ |
| 462 | fossil_fatal("cannot write %s", g.argv[4]); |
| 463 | } |
| 464 | blob_reset(&pivot); |
| 465 | blob_reset(&v1); |
| 466 | blob_reset(&v2); |
| 467 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -456,11 +456,11 @@ | |
| 456 | } |
| 457 | if( blob_read_from_file(&v2, g.argv[4], ExtFILE)<0 ){ |
| 458 | fossil_fatal("cannot read %s", g.argv[4]); |
| 459 | } |
| 460 | nConflict = blob_merge(&pivot, &v1, &v2, &merged); |
| 461 | if( blob_write_to_file(&merged, g.argv[5])<(int)blob_size(&merged) ){ |
| 462 | fossil_fatal("cannot write %s", g.argv[4]); |
| 463 | } |
| 464 | blob_reset(&pivot); |
| 465 | blob_reset(&v1); |
| 466 | blob_reset(&v2); |
| 467 |
+2
-2
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -864,11 +864,11 @@ | ||
| 864 | 864 | if( !flag_leftjustify ){ |
| 865 | 865 | register int nspace; |
| 866 | 866 | nspace = width-length; |
| 867 | 867 | if( nspace>0 ){ |
| 868 | 868 | count += nspace; |
| 869 | - while( nspace>=etSPACESIZE ){ | |
| 869 | + while( nspace>=(int)etSPACESIZE ){ | |
| 870 | 870 | blob_append(pBlob,spaces,etSPACESIZE); |
| 871 | 871 | nspace -= etSPACESIZE; |
| 872 | 872 | } |
| 873 | 873 | if( nspace>0 ) blob_append(pBlob,spaces,nspace); |
| 874 | 874 | } |
| @@ -880,11 +880,11 @@ | ||
| 880 | 880 | if( flag_leftjustify ){ |
| 881 | 881 | register int nspace; |
| 882 | 882 | nspace = width-length; |
| 883 | 883 | if( nspace>0 ){ |
| 884 | 884 | count += nspace; |
| 885 | - while( nspace>=etSPACESIZE ){ | |
| 885 | + while( nspace>=(int)etSPACESIZE ){ | |
| 886 | 886 | blob_append(pBlob,spaces,etSPACESIZE); |
| 887 | 887 | nspace -= etSPACESIZE; |
| 888 | 888 | } |
| 889 | 889 | if( nspace>0 ) blob_append(pBlob,spaces,nspace); |
| 890 | 890 | } |
| 891 | 891 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -864,11 +864,11 @@ | |
| 864 | if( !flag_leftjustify ){ |
| 865 | register int nspace; |
| 866 | nspace = width-length; |
| 867 | if( nspace>0 ){ |
| 868 | count += nspace; |
| 869 | while( nspace>=etSPACESIZE ){ |
| 870 | blob_append(pBlob,spaces,etSPACESIZE); |
| 871 | nspace -= etSPACESIZE; |
| 872 | } |
| 873 | if( nspace>0 ) blob_append(pBlob,spaces,nspace); |
| 874 | } |
| @@ -880,11 +880,11 @@ | |
| 880 | if( flag_leftjustify ){ |
| 881 | register int nspace; |
| 882 | nspace = width-length; |
| 883 | if( nspace>0 ){ |
| 884 | count += nspace; |
| 885 | while( nspace>=etSPACESIZE ){ |
| 886 | blob_append(pBlob,spaces,etSPACESIZE); |
| 887 | nspace -= etSPACESIZE; |
| 888 | } |
| 889 | if( nspace>0 ) blob_append(pBlob,spaces,nspace); |
| 890 | } |
| 891 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -864,11 +864,11 @@ | |
| 864 | if( !flag_leftjustify ){ |
| 865 | register int nspace; |
| 866 | nspace = width-length; |
| 867 | if( nspace>0 ){ |
| 868 | count += nspace; |
| 869 | while( nspace>=(int)etSPACESIZE ){ |
| 870 | blob_append(pBlob,spaces,etSPACESIZE); |
| 871 | nspace -= etSPACESIZE; |
| 872 | } |
| 873 | if( nspace>0 ) blob_append(pBlob,spaces,nspace); |
| 874 | } |
| @@ -880,11 +880,11 @@ | |
| 880 | if( flag_leftjustify ){ |
| 881 | register int nspace; |
| 882 | nspace = width-length; |
| 883 | if( nspace>0 ){ |
| 884 | count += nspace; |
| 885 | while( nspace>=(int)etSPACESIZE ){ |
| 886 | blob_append(pBlob,spaces,etSPACESIZE); |
| 887 | nspace -= etSPACESIZE; |
| 888 | } |
| 889 | if( nspace>0 ) blob_append(pBlob,spaces,nspace); |
| 890 | } |
| 891 |
+1
-1
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -256,11 +256,11 @@ | ||
| 256 | 256 | int nChild, i, cid; |
| 257 | 257 | |
| 258 | 258 | while( rid>0 ){ |
| 259 | 259 | |
| 260 | 260 | /* Fix up the "blob.size" field if needed. */ |
| 261 | - if( size!=blob_size(pBase) ){ | |
| 261 | + if( size!=(int)blob_size(pBase) ){ | |
| 262 | 262 | db_multi_exec( |
| 263 | 263 | "UPDATE blob SET size=%d WHERE rid=%d", blob_size(pBase), rid |
| 264 | 264 | ); |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -256,11 +256,11 @@ | |
| 256 | int nChild, i, cid; |
| 257 | |
| 258 | while( rid>0 ){ |
| 259 | |
| 260 | /* Fix up the "blob.size" field if needed. */ |
| 261 | if( size!=blob_size(pBase) ){ |
| 262 | db_multi_exec( |
| 263 | "UPDATE blob SET size=%d WHERE rid=%d", blob_size(pBase), rid |
| 264 | ); |
| 265 | } |
| 266 | |
| 267 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -256,11 +256,11 @@ | |
| 256 | int nChild, i, cid; |
| 257 | |
| 258 | while( rid>0 ){ |
| 259 | |
| 260 | /* Fix up the "blob.size" field if needed. */ |
| 261 | if( size!=(int)blob_size(pBase) ){ |
| 262 | db_multi_exec( |
| 263 | "UPDATE blob SET size=%d WHERE rid=%d", blob_size(pBase), rid |
| 264 | ); |
| 265 | } |
| 266 | |
| 267 |
+1
-1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -246,11 +246,11 @@ | ||
| 246 | 246 | blen++; |
| 247 | 247 | } |
| 248 | 248 | /* build the string */ |
| 249 | 249 | blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue); |
| 250 | 250 | /* this _must_ be right */ |
| 251 | - if(blob_size(&tball.pax) != blen){ | |
| 251 | + if((int)blob_size(&tball.pax) != blen){ | |
| 252 | 252 | fossil_panic("internal error: PAX tar header has bad length"); |
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | |
| 257 | 257 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -246,11 +246,11 @@ | |
| 246 | blen++; |
| 247 | } |
| 248 | /* build the string */ |
| 249 | blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue); |
| 250 | /* this _must_ be right */ |
| 251 | if(blob_size(&tball.pax) != blen){ |
| 252 | fossil_panic("internal error: PAX tar header has bad length"); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | |
| 257 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -246,11 +246,11 @@ | |
| 246 | blen++; |
| 247 | } |
| 248 | /* build the string */ |
| 249 | blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue); |
| 250 | /* this _must_ be right */ |
| 251 | if((int)blob_size(&tball.pax) != blen){ |
| 252 | fossil_panic("internal error: PAX tar header has bad length"); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | |
| 257 |
M
src/th.c
+1
-1
| --- src/th.c | ||
| +++ src/th.c | ||
| @@ -853,11 +853,11 @@ | ||
| 853 | 853 | thBufferAddChar(interp, &strbuf, 0); |
| 854 | 854 | thBufferWrite(interp, &lenbuf, &nWord, sizeof(int)); |
| 855 | 855 | nCount++; |
| 856 | 856 | } |
| 857 | 857 | } |
| 858 | - assert((lenbuf.nBuf/sizeof(int))==nCount); | |
| 858 | + assert((int)(lenbuf.nBuf/sizeof(int))==nCount); | |
| 859 | 859 | |
| 860 | 860 | assert((pazElem && panElem) || (!pazElem && !panElem)); |
| 861 | 861 | if( pazElem && rc==TH_OK ){ |
| 862 | 862 | int i; |
| 863 | 863 | char *zElem; |
| 864 | 864 |
| --- src/th.c | |
| +++ src/th.c | |
| @@ -853,11 +853,11 @@ | |
| 853 | thBufferAddChar(interp, &strbuf, 0); |
| 854 | thBufferWrite(interp, &lenbuf, &nWord, sizeof(int)); |
| 855 | nCount++; |
| 856 | } |
| 857 | } |
| 858 | assert((lenbuf.nBuf/sizeof(int))==nCount); |
| 859 | |
| 860 | assert((pazElem && panElem) || (!pazElem && !panElem)); |
| 861 | if( pazElem && rc==TH_OK ){ |
| 862 | int i; |
| 863 | char *zElem; |
| 864 |
| --- src/th.c | |
| +++ src/th.c | |
| @@ -853,11 +853,11 @@ | |
| 853 | thBufferAddChar(interp, &strbuf, 0); |
| 854 | thBufferWrite(interp, &lenbuf, &nWord, sizeof(int)); |
| 855 | nCount++; |
| 856 | } |
| 857 | } |
| 858 | assert((int)(lenbuf.nBuf/sizeof(int))==nCount); |
| 859 | |
| 860 | assert((pazElem && panElem) || (!pazElem && !panElem)); |
| 861 | if( pazElem && rc==TH_OK ){ |
| 862 | int i; |
| 863 | char *zElem; |
| 864 |
+1
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -1849,11 +1849,11 @@ | ||
| 1849 | 1849 | if( argc==2 ){ |
| 1850 | 1850 | if( Th_ToInt(interp, argv[1], argl[1], &n) ){ |
| 1851 | 1851 | return TH_ERROR; |
| 1852 | 1852 | } |
| 1853 | 1853 | if( n<1 ) n = 1; |
| 1854 | - if( n>sizeof(aRand) ) n = sizeof(aRand); | |
| 1854 | + if( n>(int)sizeof(aRand) ) n = sizeof(aRand); | |
| 1855 | 1855 | }else{ |
| 1856 | 1856 | n = 10; |
| 1857 | 1857 | } |
| 1858 | 1858 | sqlite3_randomness(n, aRand); |
| 1859 | 1859 | encode16(aRand, zOut, n); |
| 1860 | 1860 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1849,11 +1849,11 @@ | |
| 1849 | if( argc==2 ){ |
| 1850 | if( Th_ToInt(interp, argv[1], argl[1], &n) ){ |
| 1851 | return TH_ERROR; |
| 1852 | } |
| 1853 | if( n<1 ) n = 1; |
| 1854 | if( n>sizeof(aRand) ) n = sizeof(aRand); |
| 1855 | }else{ |
| 1856 | n = 10; |
| 1857 | } |
| 1858 | sqlite3_randomness(n, aRand); |
| 1859 | encode16(aRand, zOut, n); |
| 1860 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1849,11 +1849,11 @@ | |
| 1849 | if( argc==2 ){ |
| 1850 | if( Th_ToInt(interp, argv[1], argl[1], &n) ){ |
| 1851 | return TH_ERROR; |
| 1852 | } |
| 1853 | if( n<1 ) n = 1; |
| 1854 | if( n>(int)sizeof(aRand) ) n = sizeof(aRand); |
| 1855 | }else{ |
| 1856 | n = 10; |
| 1857 | } |
| 1858 | sqlite3_randomness(n, aRand); |
| 1859 | encode16(aRand, zOut, n); |
| 1860 |
+2
-2
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -547,11 +547,11 @@ | ||
| 547 | 547 | if( z[jj]=='\n' ) break; |
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 | z[ii] = 0; |
| 551 | 551 | cgi_printf("%W",z); |
| 552 | - }else if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ | |
| 552 | + }else if( mxWikiLen>0 && (int)blob_size(&comment)>mxWikiLen ){ | |
| 553 | 553 | Blob truncated; |
| 554 | 554 | blob_zero(&truncated); |
| 555 | 555 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 556 | 556 | blob_append(&truncated, "...", 3); |
| 557 | 557 | @ %W(blob_str(&truncated)) |
| @@ -3432,11 +3432,11 @@ | ||
| 3432 | 3432 | zStartOfProject = db_text(0, |
| 3433 | 3433 | "SELECT datetime(min(mtime),toLocal(),'startofday') FROM event;" |
| 3434 | 3434 | ); |
| 3435 | 3435 | timeline_temp_table(); |
| 3436 | 3436 | db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/"); |
| 3437 | - for(i=0; i<sizeof(aYearsAgo)/sizeof(aYearsAgo[0]); i++){ | |
| 3437 | + for(i=0; i<(int)(sizeof(aYearsAgo)/sizeof(aYearsAgo[0])); i++){ | |
| 3438 | 3438 | int iAgo = aYearsAgo[i]; |
| 3439 | 3439 | char *zThis = db_text(0, "SELECT date(%Q,'-%d years')", zToday, iAgo); |
| 3440 | 3440 | Blob sql; |
| 3441 | 3441 | char *zId; |
| 3442 | 3442 | if( strcmp(zThis, zStartOfProject)<0 ) break; |
| 3443 | 3443 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -547,11 +547,11 @@ | |
| 547 | if( z[jj]=='\n' ) break; |
| 548 | } |
| 549 | } |
| 550 | z[ii] = 0; |
| 551 | cgi_printf("%W",z); |
| 552 | }else if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ |
| 553 | Blob truncated; |
| 554 | blob_zero(&truncated); |
| 555 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 556 | blob_append(&truncated, "...", 3); |
| 557 | @ %W(blob_str(&truncated)) |
| @@ -3432,11 +3432,11 @@ | |
| 3432 | zStartOfProject = db_text(0, |
| 3433 | "SELECT datetime(min(mtime),toLocal(),'startofday') FROM event;" |
| 3434 | ); |
| 3435 | timeline_temp_table(); |
| 3436 | db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/"); |
| 3437 | for(i=0; i<sizeof(aYearsAgo)/sizeof(aYearsAgo[0]); i++){ |
| 3438 | int iAgo = aYearsAgo[i]; |
| 3439 | char *zThis = db_text(0, "SELECT date(%Q,'-%d years')", zToday, iAgo); |
| 3440 | Blob sql; |
| 3441 | char *zId; |
| 3442 | if( strcmp(zThis, zStartOfProject)<0 ) break; |
| 3443 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -547,11 +547,11 @@ | |
| 547 | if( z[jj]=='\n' ) break; |
| 548 | } |
| 549 | } |
| 550 | z[ii] = 0; |
| 551 | cgi_printf("%W",z); |
| 552 | }else if( mxWikiLen>0 && (int)blob_size(&comment)>mxWikiLen ){ |
| 553 | Blob truncated; |
| 554 | blob_zero(&truncated); |
| 555 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 556 | blob_append(&truncated, "...", 3); |
| 557 | @ %W(blob_str(&truncated)) |
| @@ -3432,11 +3432,11 @@ | |
| 3432 | zStartOfProject = db_text(0, |
| 3433 | "SELECT datetime(min(mtime),toLocal(),'startofday') FROM event;" |
| 3434 | ); |
| 3435 | timeline_temp_table(); |
| 3436 | db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/"); |
| 3437 | for(i=0; i<(int)(sizeof(aYearsAgo)/sizeof(aYearsAgo[0])); i++){ |
| 3438 | int iAgo = aYearsAgo[i]; |
| 3439 | char *zThis = db_text(0, "SELECT date(%Q,'-%d years')", zToday, iAgo); |
| 3440 | Blob sql; |
| 3441 | char *zId; |
| 3442 | if( strcmp(zThis, zStartOfProject)<0 ) break; |
| 3443 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -926,11 +926,11 @@ | ||
| 926 | 926 | zValue = Th_Fetch(aField[i].zName, &nValue); |
| 927 | 927 | if( zValue ){ |
| 928 | 928 | while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; } |
| 929 | 929 | if( ((aField[i].mUsed & USEDBY_TICKETCHNG)!=0 && nValue>0) |
| 930 | 930 | || memcmp(zValue, aField[i].zValue, nValue)!=0 |
| 931 | - || strlen(aField[i].zValue)!=nValue | |
| 931 | + ||(int)strlen(aField[i].zValue)!=nValue | |
| 932 | 932 | ){ |
| 933 | 933 | if( memcmp(aField[i].zName, "private_", 8)==0 ){ |
| 934 | 934 | zValue = db_conceal(zValue, nValue); |
| 935 | 935 | blob_appendf(&tktchng, "J %s %s\n", aField[i].zName, zValue); |
| 936 | 936 | aUsed[i] = JCARD_PRIVATE; |
| 937 | 937 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -926,11 +926,11 @@ | |
| 926 | zValue = Th_Fetch(aField[i].zName, &nValue); |
| 927 | if( zValue ){ |
| 928 | while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; } |
| 929 | if( ((aField[i].mUsed & USEDBY_TICKETCHNG)!=0 && nValue>0) |
| 930 | || memcmp(zValue, aField[i].zValue, nValue)!=0 |
| 931 | || strlen(aField[i].zValue)!=nValue |
| 932 | ){ |
| 933 | if( memcmp(aField[i].zName, "private_", 8)==0 ){ |
| 934 | zValue = db_conceal(zValue, nValue); |
| 935 | blob_appendf(&tktchng, "J %s %s\n", aField[i].zName, zValue); |
| 936 | aUsed[i] = JCARD_PRIVATE; |
| 937 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -926,11 +926,11 @@ | |
| 926 | zValue = Th_Fetch(aField[i].zName, &nValue); |
| 927 | if( zValue ){ |
| 928 | while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; } |
| 929 | if( ((aField[i].mUsed & USEDBY_TICKETCHNG)!=0 && nValue>0) |
| 930 | || memcmp(zValue, aField[i].zValue, nValue)!=0 |
| 931 | ||(int)strlen(aField[i].zValue)!=nValue |
| 932 | ){ |
| 933 | if( memcmp(aField[i].zName, "private_", 8)==0 ){ |
| 934 | zValue = db_conceal(zValue, nValue); |
| 935 | blob_appendf(&tktchng, "J %s %s\n", aField[i].zName, zValue); |
| 936 | aUsed[i] = JCARD_PRIVATE; |
| 937 |
+1
-1
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -157,11 +157,11 @@ | ||
| 157 | 157 | int nB = 0; |
| 158 | 158 | int i; |
| 159 | 159 | memcpy(zOrig, "abcdefghijklmnopqrstuvwyz", nA+1); |
| 160 | 160 | memcpy(zA, zOrig, nA+1); |
| 161 | 161 | assert( nA==(int)strlen((char*)zA) ); |
| 162 | - for(i=0; i<sizeof(aSubst); i++) aSubst[i] = i; | |
| 162 | + for(i=0; i<(int)sizeof(aSubst); i++) aSubst[i] = i; | |
| 163 | 163 | printFive(zA); |
| 164 | 164 | while( nA>0 ){ |
| 165 | 165 | int x = randint(nA); |
| 166 | 166 | zB[nB++] = zA[x]; |
| 167 | 167 | zA[x] = zA[--nA]; |
| 168 | 168 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -157,11 +157,11 @@ | |
| 157 | int nB = 0; |
| 158 | int i; |
| 159 | memcpy(zOrig, "abcdefghijklmnopqrstuvwyz", nA+1); |
| 160 | memcpy(zA, zOrig, nA+1); |
| 161 | assert( nA==(int)strlen((char*)zA) ); |
| 162 | for(i=0; i<sizeof(aSubst); i++) aSubst[i] = i; |
| 163 | printFive(zA); |
| 164 | while( nA>0 ){ |
| 165 | int x = randint(nA); |
| 166 | zB[nB++] = zA[x]; |
| 167 | zA[x] = zA[--nA]; |
| 168 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -157,11 +157,11 @@ | |
| 157 | int nB = 0; |
| 158 | int i; |
| 159 | memcpy(zOrig, "abcdefghijklmnopqrstuvwyz", nA+1); |
| 160 | memcpy(zA, zOrig, nA+1); |
| 161 | assert( nA==(int)strlen((char*)zA) ); |
| 162 | for(i=0; i<(int)sizeof(aSubst); i++) aSubst[i] = i; |
| 163 | printFive(zA); |
| 164 | while( nA>0 ){ |
| 165 | int x = randint(nA); |
| 166 | zB[nB++] = zA[x]; |
| 167 | zA[x] = zA[--nA]; |
| 168 |
+2
-2
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -680,18 +680,18 @@ | ||
| 680 | 680 | }else{ |
| 681 | 681 | zDir = fossil_getenv("LOCALAPPDATA"); |
| 682 | 682 | if( zDir==0 ) zDir = "."; |
| 683 | 683 | } |
| 684 | 684 | #else |
| 685 | - for(i=0; i<sizeof(azTmp)/sizeof(azTmp[0]); i++){ | |
| 685 | + for(i=0; i<(int)(sizeof(azTmp)/sizeof(azTmp[0])); i++){ | |
| 686 | 686 | struct stat buf; |
| 687 | 687 | zDir = azTmp[i]; |
| 688 | 688 | if( stat(zDir,&buf)==0 && S_ISDIR(buf.st_mode) && access(zDir,03)==0 ){ |
| 689 | 689 | break; |
| 690 | 690 | } |
| 691 | 691 | } |
| 692 | - if( i>=sizeof(azTmp)/sizeof(azTmp[0]) ) zDir = "."; | |
| 692 | + if( i>=(int)(sizeof(azTmp)/sizeof(azTmp[0])) ) zDir = "."; | |
| 693 | 693 | cDirSep = '/'; |
| 694 | 694 | #endif |
| 695 | 695 | nDir = strlen(zDir); |
| 696 | 696 | zSep[1] = 0; |
| 697 | 697 | zSep[0] = (nDir && zDir[nDir-1]==cDirSep) ? 0 : cDirSep; |
| 698 | 698 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -680,18 +680,18 @@ | |
| 680 | }else{ |
| 681 | zDir = fossil_getenv("LOCALAPPDATA"); |
| 682 | if( zDir==0 ) zDir = "."; |
| 683 | } |
| 684 | #else |
| 685 | for(i=0; i<sizeof(azTmp)/sizeof(azTmp[0]); i++){ |
| 686 | struct stat buf; |
| 687 | zDir = azTmp[i]; |
| 688 | if( stat(zDir,&buf)==0 && S_ISDIR(buf.st_mode) && access(zDir,03)==0 ){ |
| 689 | break; |
| 690 | } |
| 691 | } |
| 692 | if( i>=sizeof(azTmp)/sizeof(azTmp[0]) ) zDir = "."; |
| 693 | cDirSep = '/'; |
| 694 | #endif |
| 695 | nDir = strlen(zDir); |
| 696 | zSep[1] = 0; |
| 697 | zSep[0] = (nDir && zDir[nDir-1]==cDirSep) ? 0 : cDirSep; |
| 698 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -680,18 +680,18 @@ | |
| 680 | }else{ |
| 681 | zDir = fossil_getenv("LOCALAPPDATA"); |
| 682 | if( zDir==0 ) zDir = "."; |
| 683 | } |
| 684 | #else |
| 685 | for(i=0; i<(int)(sizeof(azTmp)/sizeof(azTmp[0])); i++){ |
| 686 | struct stat buf; |
| 687 | zDir = azTmp[i]; |
| 688 | if( stat(zDir,&buf)==0 && S_ISDIR(buf.st_mode) && access(zDir,03)==0 ){ |
| 689 | break; |
| 690 | } |
| 691 | } |
| 692 | if( i>=(int)(sizeof(azTmp)/sizeof(azTmp[0])) ) zDir = "."; |
| 693 | cDirSep = '/'; |
| 694 | #endif |
| 695 | nDir = strlen(zDir); |
| 696 | zSep[1] = 0; |
| 697 | zSep[0] = (nDir && zDir[nDir-1]==cDirSep) ? 0 : cDirSep; |
| 698 |
+4
-4
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -790,11 +790,11 @@ | ||
| 790 | 790 | p->endTag = 0; |
| 791 | 791 | i = 1; |
| 792 | 792 | } |
| 793 | 793 | j = 0; |
| 794 | 794 | while( fossil_isalnum(z[i]) ){ |
| 795 | - if( j<sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); | |
| 795 | + if( j<(int)sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); | |
| 796 | 796 | i++; |
| 797 | 797 | } |
| 798 | 798 | zTag[j] = 0; |
| 799 | 799 | p->iCode = findTag(zTag); |
| 800 | 800 | p->iType = aMarkup[p->iCode].iType; |
| @@ -813,11 +813,11 @@ | ||
| 813 | 813 | while( fossil_isspace(z[i]) ){ i++; } |
| 814 | 814 | while( c!='>' && p->nAttr<8 && fossil_isalpha(z[i]) ){ |
| 815 | 815 | int attrOk; /* True to preserve attribute. False to ignore it */ |
| 816 | 816 | j = 0; |
| 817 | 817 | while( fossil_isalnum(z[i]) ){ |
| 818 | - if( j<sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); | |
| 818 | + if( j<(int)sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); | |
| 819 | 819 | i++; |
| 820 | 820 | } |
| 821 | 821 | zTag[j] = 0; |
| 822 | 822 | p->aAttr[p->nAttr].iACode = iACode = findAttr(zTag); |
| 823 | 823 | attrOk = iACode!=0 && (seen & aAttribute[iACode].iMask)==0; |
| @@ -1105,11 +1105,11 @@ | ||
| 1105 | 1105 | db_static_prepare(&q, |
| 1106 | 1106 | "SELECT 1 FROM blob WHERE uuid>=:u AND uuid<:u2" |
| 1107 | 1107 | ); |
| 1108 | 1108 | db_bind_text(&q, ":u", zUuid); |
| 1109 | 1109 | n = (int)strlen(zUuid); |
| 1110 | - if( n>=sizeof(zU2) ) n = sizeof(zU2)-1; | |
| 1110 | + if( n>=(int)sizeof(zU2) ) n = sizeof(zU2)-1; | |
| 1111 | 1111 | memcpy(zU2, zUuid, n); |
| 1112 | 1112 | zU2[n-1]++; |
| 1113 | 1113 | zU2[n] = 0; |
| 1114 | 1114 | db_bind_text(&q, ":u2", zU2); |
| 1115 | 1115 | rc = db_step(&q); |
| @@ -1358,11 +1358,11 @@ | ||
| 1358 | 1358 | }else{ |
| 1359 | 1359 | blob_appendf(pOut, "<span class=\"brokenlink\">[%h]", zTarget); |
| 1360 | 1360 | zTerm = "</span>"; |
| 1361 | 1361 | } |
| 1362 | 1362 | if( zExtra ) fossil_free(zExtra); |
| 1363 | - assert( strlen(zTerm)<nClose ); | |
| 1363 | + assert( (int)strlen(zTerm)<nClose ); | |
| 1364 | 1364 | sqlite3_snprintf(nClose, zClose, "%s", zTerm); |
| 1365 | 1365 | } |
| 1366 | 1366 | |
| 1367 | 1367 | /* |
| 1368 | 1368 | ** Check to see if the given parsed markup is the correct |
| 1369 | 1369 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -790,11 +790,11 @@ | |
| 790 | p->endTag = 0; |
| 791 | i = 1; |
| 792 | } |
| 793 | j = 0; |
| 794 | while( fossil_isalnum(z[i]) ){ |
| 795 | if( j<sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); |
| 796 | i++; |
| 797 | } |
| 798 | zTag[j] = 0; |
| 799 | p->iCode = findTag(zTag); |
| 800 | p->iType = aMarkup[p->iCode].iType; |
| @@ -813,11 +813,11 @@ | |
| 813 | while( fossil_isspace(z[i]) ){ i++; } |
| 814 | while( c!='>' && p->nAttr<8 && fossil_isalpha(z[i]) ){ |
| 815 | int attrOk; /* True to preserve attribute. False to ignore it */ |
| 816 | j = 0; |
| 817 | while( fossil_isalnum(z[i]) ){ |
| 818 | if( j<sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); |
| 819 | i++; |
| 820 | } |
| 821 | zTag[j] = 0; |
| 822 | p->aAttr[p->nAttr].iACode = iACode = findAttr(zTag); |
| 823 | attrOk = iACode!=0 && (seen & aAttribute[iACode].iMask)==0; |
| @@ -1105,11 +1105,11 @@ | |
| 1105 | db_static_prepare(&q, |
| 1106 | "SELECT 1 FROM blob WHERE uuid>=:u AND uuid<:u2" |
| 1107 | ); |
| 1108 | db_bind_text(&q, ":u", zUuid); |
| 1109 | n = (int)strlen(zUuid); |
| 1110 | if( n>=sizeof(zU2) ) n = sizeof(zU2)-1; |
| 1111 | memcpy(zU2, zUuid, n); |
| 1112 | zU2[n-1]++; |
| 1113 | zU2[n] = 0; |
| 1114 | db_bind_text(&q, ":u2", zU2); |
| 1115 | rc = db_step(&q); |
| @@ -1358,11 +1358,11 @@ | |
| 1358 | }else{ |
| 1359 | blob_appendf(pOut, "<span class=\"brokenlink\">[%h]", zTarget); |
| 1360 | zTerm = "</span>"; |
| 1361 | } |
| 1362 | if( zExtra ) fossil_free(zExtra); |
| 1363 | assert( strlen(zTerm)<nClose ); |
| 1364 | sqlite3_snprintf(nClose, zClose, "%s", zTerm); |
| 1365 | } |
| 1366 | |
| 1367 | /* |
| 1368 | ** Check to see if the given parsed markup is the correct |
| 1369 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -790,11 +790,11 @@ | |
| 790 | p->endTag = 0; |
| 791 | i = 1; |
| 792 | } |
| 793 | j = 0; |
| 794 | while( fossil_isalnum(z[i]) ){ |
| 795 | if( j<(int)sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); |
| 796 | i++; |
| 797 | } |
| 798 | zTag[j] = 0; |
| 799 | p->iCode = findTag(zTag); |
| 800 | p->iType = aMarkup[p->iCode].iType; |
| @@ -813,11 +813,11 @@ | |
| 813 | while( fossil_isspace(z[i]) ){ i++; } |
| 814 | while( c!='>' && p->nAttr<8 && fossil_isalpha(z[i]) ){ |
| 815 | int attrOk; /* True to preserve attribute. False to ignore it */ |
| 816 | j = 0; |
| 817 | while( fossil_isalnum(z[i]) ){ |
| 818 | if( j<(int)sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); |
| 819 | i++; |
| 820 | } |
| 821 | zTag[j] = 0; |
| 822 | p->aAttr[p->nAttr].iACode = iACode = findAttr(zTag); |
| 823 | attrOk = iACode!=0 && (seen & aAttribute[iACode].iMask)==0; |
| @@ -1105,11 +1105,11 @@ | |
| 1105 | db_static_prepare(&q, |
| 1106 | "SELECT 1 FROM blob WHERE uuid>=:u AND uuid<:u2" |
| 1107 | ); |
| 1108 | db_bind_text(&q, ":u", zUuid); |
| 1109 | n = (int)strlen(zUuid); |
| 1110 | if( n>=(int)sizeof(zU2) ) n = sizeof(zU2)-1; |
| 1111 | memcpy(zU2, zUuid, n); |
| 1112 | zU2[n-1]++; |
| 1113 | zU2[n] = 0; |
| 1114 | db_bind_text(&q, ":u2", zU2); |
| 1115 | rc = db_step(&q); |
| @@ -1358,11 +1358,11 @@ | |
| 1358 | }else{ |
| 1359 | blob_appendf(pOut, "<span class=\"brokenlink\">[%h]", zTarget); |
| 1360 | zTerm = "</span>"; |
| 1361 | } |
| 1362 | if( zExtra ) fossil_free(zExtra); |
| 1363 | assert( (int)strlen(zTerm)<nClose ); |
| 1364 | sqlite3_snprintf(nClose, zClose, "%s", zTerm); |
| 1365 | } |
| 1366 | |
| 1367 | /* |
| 1368 | ** Check to see if the given parsed markup is the correct |
| 1369 |
+7
-7
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -450,11 +450,11 @@ | ||
| 450 | 450 | && content_get(srcId, &src) |
| 451 | 451 | ){ |
| 452 | 452 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", srcId); |
| 453 | 453 | blob_delta_create(&src, pContent, &delta); |
| 454 | 454 | size = blob_size(&delta); |
| 455 | - if( size>=blob_size(pContent)-50 ){ | |
| 455 | + if( size>=(int)blob_size(pContent)-50 ){ | |
| 456 | 456 | size = 0; |
| 457 | 457 | }else if( uuid_is_shunned(zUuid) ){ |
| 458 | 458 | size = 0; |
| 459 | 459 | }else{ |
| 460 | 460 | if( isPrivate ) blob_append(pXfer->pOut, "private\n", -1); |
| @@ -577,11 +577,11 @@ | ||
| 577 | 577 | if( uuid_is_shunned(blob_str(pUuid)) ){ |
| 578 | 578 | blob_reset(&uuid); |
| 579 | 579 | return; |
| 580 | 580 | } |
| 581 | 581 | if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) || |
| 582 | - pXfer->mxSend<=blob_size(pXfer->pOut) ){ | |
| 582 | + pXfer->mxSend<=(int)blob_size(pXfer->pOut) ){ | |
| 583 | 583 | const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; |
| 584 | 584 | blob_appendf(pXfer->pOut, zFormat /*works-like:"%b"*/, pUuid); |
| 585 | 585 | pXfer->nIGotSent++; |
| 586 | 586 | blob_reset(&uuid); |
| 587 | 587 | return; |
| @@ -701,11 +701,11 @@ | ||
| 701 | 701 | const char *zName, /* Name of unversioned file to be sent */ |
| 702 | 702 | int noContent /* True to omit the content */ |
| 703 | 703 | ){ |
| 704 | 704 | Stmt q1; |
| 705 | 705 | |
| 706 | - if( blob_size(pXfer->pOut)>=pXfer->mxSend ) noContent = 1; | |
| 706 | + if( (int)blob_size(pXfer->pOut)>=pXfer->mxSend ) noContent = 1; | |
| 707 | 707 | if( noContent ){ |
| 708 | 708 | db_prepare(&q1, |
| 709 | 709 | "SELECT mtime, hash, encoding, sz FROM unversioned WHERE name=%Q", |
| 710 | 710 | zName |
| 711 | 711 | ); |
| @@ -722,11 +722,11 @@ | ||
| 722 | 722 | if( pXfer->remoteVersion<20000 && db_column_bytes(&q1,1)>HNAME_LEN_SHA1 ){ |
| 723 | 723 | xfer_cannot_send_sha3_error(pXfer); |
| 724 | 724 | db_reset(&q1); |
| 725 | 725 | return; |
| 726 | 726 | } |
| 727 | - if( blob_size(pXfer->pOut)>=pXfer->mxSend ){ | |
| 727 | + if( (int)blob_size(pXfer->pOut)>=pXfer->mxSend ){ | |
| 728 | 728 | /* If we have already reached the send size limit, send a (short) |
| 729 | 729 | ** uvigot card rather than a uvfile card. This only happens on the |
| 730 | 730 | ** server side. The uvigot card will provoke the client to resend |
| 731 | 731 | ** another uvgimme on the next cycle. */ |
| 732 | 732 | blob_appendf(pXfer->pOut, "uvigot %s %lld %s %d\n", |
| @@ -1029,11 +1029,11 @@ | ||
| 1029 | 1029 | ); |
| 1030 | 1030 | } |
| 1031 | 1031 | while( db_step(&q)==SQLITE_ROW ){ |
| 1032 | 1032 | blob_appendf(pXfer->pOut, "igot %s\n", db_column_text(&q, 0)); |
| 1033 | 1033 | cnt++; |
| 1034 | - if( pXfer->resync && pXfer->mxSend<blob_size(pXfer->pOut) ){ | |
| 1034 | + if( pXfer->resync && pXfer->mxSend<(int)blob_size(pXfer->pOut) ){ | |
| 1035 | 1035 | pXfer->resync = db_column_int(&q, 1)-1; |
| 1036 | 1036 | } |
| 1037 | 1037 | } |
| 1038 | 1038 | db_finalize(&q); |
| 1039 | 1039 | if( cnt==0 ) pXfer->resync = 0; |
| @@ -1457,11 +1457,11 @@ | ||
| 1457 | 1457 | if( iVers>=3 ){ |
| 1458 | 1458 | cgi_set_content_type("application/x-fossil-uncompressed"); |
| 1459 | 1459 | } |
| 1460 | 1460 | blob_is_int(&xfer.aToken[2], &seqno); |
| 1461 | 1461 | max = db_int(0, "SELECT max(rid) FROM blob"); |
| 1462 | - while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max){ | |
| 1462 | + while( xfer.mxSend>(int)blob_size(xfer.pOut) && seqno<=max){ | |
| 1463 | 1463 | if( time(NULL) >= xfer.maxTime ) break; |
| 1464 | 1464 | if( iVers>=3 ){ |
| 1465 | 1465 | send_compressed_file(&xfer, seqno); |
| 1466 | 1466 | }else{ |
| 1467 | 1467 | send_file(&xfer, seqno, 0, 1); |
| @@ -2228,11 +2228,11 @@ | ||
| 2228 | 2228 | nArtifactSent++; |
| 2229 | 2229 | db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName); |
| 2230 | 2230 | if( syncFlags & SYNC_VERBOSE ){ |
| 2231 | 2231 | fossil_print("\rUnversioned-file sent: %s\n", zName); |
| 2232 | 2232 | } |
| 2233 | - if( blob_size(xfer.pOut)>xfer.mxSend ) break; | |
| 2233 | + if( (int)blob_size(xfer.pOut)>xfer.mxSend ) break; | |
| 2234 | 2234 | } |
| 2235 | 2235 | db_finalize(&uvq); |
| 2236 | 2236 | if( rc==SQLITE_DONE ) uvDoPush = 0; |
| 2237 | 2237 | } |
| 2238 | 2238 | } |
| 2239 | 2239 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -450,11 +450,11 @@ | |
| 450 | && content_get(srcId, &src) |
| 451 | ){ |
| 452 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", srcId); |
| 453 | blob_delta_create(&src, pContent, &delta); |
| 454 | size = blob_size(&delta); |
| 455 | if( size>=blob_size(pContent)-50 ){ |
| 456 | size = 0; |
| 457 | }else if( uuid_is_shunned(zUuid) ){ |
| 458 | size = 0; |
| 459 | }else{ |
| 460 | if( isPrivate ) blob_append(pXfer->pOut, "private\n", -1); |
| @@ -577,11 +577,11 @@ | |
| 577 | if( uuid_is_shunned(blob_str(pUuid)) ){ |
| 578 | blob_reset(&uuid); |
| 579 | return; |
| 580 | } |
| 581 | if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) || |
| 582 | pXfer->mxSend<=blob_size(pXfer->pOut) ){ |
| 583 | const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; |
| 584 | blob_appendf(pXfer->pOut, zFormat /*works-like:"%b"*/, pUuid); |
| 585 | pXfer->nIGotSent++; |
| 586 | blob_reset(&uuid); |
| 587 | return; |
| @@ -701,11 +701,11 @@ | |
| 701 | const char *zName, /* Name of unversioned file to be sent */ |
| 702 | int noContent /* True to omit the content */ |
| 703 | ){ |
| 704 | Stmt q1; |
| 705 | |
| 706 | if( blob_size(pXfer->pOut)>=pXfer->mxSend ) noContent = 1; |
| 707 | if( noContent ){ |
| 708 | db_prepare(&q1, |
| 709 | "SELECT mtime, hash, encoding, sz FROM unversioned WHERE name=%Q", |
| 710 | zName |
| 711 | ); |
| @@ -722,11 +722,11 @@ | |
| 722 | if( pXfer->remoteVersion<20000 && db_column_bytes(&q1,1)>HNAME_LEN_SHA1 ){ |
| 723 | xfer_cannot_send_sha3_error(pXfer); |
| 724 | db_reset(&q1); |
| 725 | return; |
| 726 | } |
| 727 | if( blob_size(pXfer->pOut)>=pXfer->mxSend ){ |
| 728 | /* If we have already reached the send size limit, send a (short) |
| 729 | ** uvigot card rather than a uvfile card. This only happens on the |
| 730 | ** server side. The uvigot card will provoke the client to resend |
| 731 | ** another uvgimme on the next cycle. */ |
| 732 | blob_appendf(pXfer->pOut, "uvigot %s %lld %s %d\n", |
| @@ -1029,11 +1029,11 @@ | |
| 1029 | ); |
| 1030 | } |
| 1031 | while( db_step(&q)==SQLITE_ROW ){ |
| 1032 | blob_appendf(pXfer->pOut, "igot %s\n", db_column_text(&q, 0)); |
| 1033 | cnt++; |
| 1034 | if( pXfer->resync && pXfer->mxSend<blob_size(pXfer->pOut) ){ |
| 1035 | pXfer->resync = db_column_int(&q, 1)-1; |
| 1036 | } |
| 1037 | } |
| 1038 | db_finalize(&q); |
| 1039 | if( cnt==0 ) pXfer->resync = 0; |
| @@ -1457,11 +1457,11 @@ | |
| 1457 | if( iVers>=3 ){ |
| 1458 | cgi_set_content_type("application/x-fossil-uncompressed"); |
| 1459 | } |
| 1460 | blob_is_int(&xfer.aToken[2], &seqno); |
| 1461 | max = db_int(0, "SELECT max(rid) FROM blob"); |
| 1462 | while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max){ |
| 1463 | if( time(NULL) >= xfer.maxTime ) break; |
| 1464 | if( iVers>=3 ){ |
| 1465 | send_compressed_file(&xfer, seqno); |
| 1466 | }else{ |
| 1467 | send_file(&xfer, seqno, 0, 1); |
| @@ -2228,11 +2228,11 @@ | |
| 2228 | nArtifactSent++; |
| 2229 | db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName); |
| 2230 | if( syncFlags & SYNC_VERBOSE ){ |
| 2231 | fossil_print("\rUnversioned-file sent: %s\n", zName); |
| 2232 | } |
| 2233 | if( blob_size(xfer.pOut)>xfer.mxSend ) break; |
| 2234 | } |
| 2235 | db_finalize(&uvq); |
| 2236 | if( rc==SQLITE_DONE ) uvDoPush = 0; |
| 2237 | } |
| 2238 | } |
| 2239 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -450,11 +450,11 @@ | |
| 450 | && content_get(srcId, &src) |
| 451 | ){ |
| 452 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", srcId); |
| 453 | blob_delta_create(&src, pContent, &delta); |
| 454 | size = blob_size(&delta); |
| 455 | if( size>=(int)blob_size(pContent)-50 ){ |
| 456 | size = 0; |
| 457 | }else if( uuid_is_shunned(zUuid) ){ |
| 458 | size = 0; |
| 459 | }else{ |
| 460 | if( isPrivate ) blob_append(pXfer->pOut, "private\n", -1); |
| @@ -577,11 +577,11 @@ | |
| 577 | if( uuid_is_shunned(blob_str(pUuid)) ){ |
| 578 | blob_reset(&uuid); |
| 579 | return; |
| 580 | } |
| 581 | if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) || |
| 582 | pXfer->mxSend<=(int)blob_size(pXfer->pOut) ){ |
| 583 | const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; |
| 584 | blob_appendf(pXfer->pOut, zFormat /*works-like:"%b"*/, pUuid); |
| 585 | pXfer->nIGotSent++; |
| 586 | blob_reset(&uuid); |
| 587 | return; |
| @@ -701,11 +701,11 @@ | |
| 701 | const char *zName, /* Name of unversioned file to be sent */ |
| 702 | int noContent /* True to omit the content */ |
| 703 | ){ |
| 704 | Stmt q1; |
| 705 | |
| 706 | if( (int)blob_size(pXfer->pOut)>=pXfer->mxSend ) noContent = 1; |
| 707 | if( noContent ){ |
| 708 | db_prepare(&q1, |
| 709 | "SELECT mtime, hash, encoding, sz FROM unversioned WHERE name=%Q", |
| 710 | zName |
| 711 | ); |
| @@ -722,11 +722,11 @@ | |
| 722 | if( pXfer->remoteVersion<20000 && db_column_bytes(&q1,1)>HNAME_LEN_SHA1 ){ |
| 723 | xfer_cannot_send_sha3_error(pXfer); |
| 724 | db_reset(&q1); |
| 725 | return; |
| 726 | } |
| 727 | if( (int)blob_size(pXfer->pOut)>=pXfer->mxSend ){ |
| 728 | /* If we have already reached the send size limit, send a (short) |
| 729 | ** uvigot card rather than a uvfile card. This only happens on the |
| 730 | ** server side. The uvigot card will provoke the client to resend |
| 731 | ** another uvgimme on the next cycle. */ |
| 732 | blob_appendf(pXfer->pOut, "uvigot %s %lld %s %d\n", |
| @@ -1029,11 +1029,11 @@ | |
| 1029 | ); |
| 1030 | } |
| 1031 | while( db_step(&q)==SQLITE_ROW ){ |
| 1032 | blob_appendf(pXfer->pOut, "igot %s\n", db_column_text(&q, 0)); |
| 1033 | cnt++; |
| 1034 | if( pXfer->resync && pXfer->mxSend<(int)blob_size(pXfer->pOut) ){ |
| 1035 | pXfer->resync = db_column_int(&q, 1)-1; |
| 1036 | } |
| 1037 | } |
| 1038 | db_finalize(&q); |
| 1039 | if( cnt==0 ) pXfer->resync = 0; |
| @@ -1457,11 +1457,11 @@ | |
| 1457 | if( iVers>=3 ){ |
| 1458 | cgi_set_content_type("application/x-fossil-uncompressed"); |
| 1459 | } |
| 1460 | blob_is_int(&xfer.aToken[2], &seqno); |
| 1461 | max = db_int(0, "SELECT max(rid) FROM blob"); |
| 1462 | while( xfer.mxSend>(int)blob_size(xfer.pOut) && seqno<=max){ |
| 1463 | if( time(NULL) >= xfer.maxTime ) break; |
| 1464 | if( iVers>=3 ){ |
| 1465 | send_compressed_file(&xfer, seqno); |
| 1466 | }else{ |
| 1467 | send_file(&xfer, seqno, 0, 1); |
| @@ -2228,11 +2228,11 @@ | |
| 2228 | nArtifactSent++; |
| 2229 | db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName); |
| 2230 | if( syncFlags & SYNC_VERBOSE ){ |
| 2231 | fossil_print("\rUnversioned-file sent: %s\n", zName); |
| 2232 | } |
| 2233 | if( (int)blob_size(xfer.pOut)>xfer.mxSend ) break; |
| 2234 | } |
| 2235 | db_finalize(&uvq); |
| 2236 | if( rc==SQLITE_DONE ) uvDoPush = 0; |
| 2237 | } |
| 2238 | } |
| 2239 |
+3
-3
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -66,11 +66,11 @@ | ||
| 66 | 66 | |
| 67 | 67 | /* |
| 68 | 68 | ** Ensure that blob pBlob is at least nMin bytes in size. |
| 69 | 69 | */ |
| 70 | 70 | static void zip_blob_minsize(Blob *pBlob, int nMin){ |
| 71 | - if( blob_size(pBlob)<nMin ){ | |
| 71 | + if( (int)blob_size(pBlob)<nMin ){ | |
| 72 | 72 | blob_resize(pBlob, nMin); |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /************************************************************************* |
| @@ -441,19 +441,19 @@ | ||
| 441 | 441 | sqlite3_bind_int(p->pInsert, 4, -1); |
| 442 | 442 | sqlite3_bind_text(p->pInsert, 5, |
| 443 | 443 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 444 | 444 | ); |
| 445 | 445 | }else{ |
| 446 | - int nIn = blob_size(pFile); | |
| 446 | + unsigned int nIn = blob_size(pFile); | |
| 447 | 447 | unsigned long int nOut = nIn; |
| 448 | 448 | sqlite3_bind_int(p->pInsert, 2, mPerm==PERM_EXE ? 0100755 : 0100644); |
| 449 | 449 | sqlite3_bind_int(p->pInsert, 4, nIn); |
| 450 | 450 | zip_blob_minsize(&p->tmp, nIn); |
| 451 | 451 | compress( (unsigned char*) |
| 452 | 452 | blob_buffer(&p->tmp), &nOut, (unsigned char*)blob_buffer(pFile), nIn |
| 453 | 453 | ); |
| 454 | - if( nOut>=nIn ){ | |
| 454 | + if( nOut>=(unsigned long)nIn ){ | |
| 455 | 455 | sqlite3_bind_blob(p->pInsert, 5, |
| 456 | 456 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 457 | 457 | ); |
| 458 | 458 | }else{ |
| 459 | 459 | sqlite3_bind_blob(p->pInsert, 5, |
| 460 | 460 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -66,11 +66,11 @@ | |
| 66 | |
| 67 | /* |
| 68 | ** Ensure that blob pBlob is at least nMin bytes in size. |
| 69 | */ |
| 70 | static void zip_blob_minsize(Blob *pBlob, int nMin){ |
| 71 | if( blob_size(pBlob)<nMin ){ |
| 72 | blob_resize(pBlob, nMin); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | /************************************************************************* |
| @@ -441,19 +441,19 @@ | |
| 441 | sqlite3_bind_int(p->pInsert, 4, -1); |
| 442 | sqlite3_bind_text(p->pInsert, 5, |
| 443 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 444 | ); |
| 445 | }else{ |
| 446 | int nIn = blob_size(pFile); |
| 447 | unsigned long int nOut = nIn; |
| 448 | sqlite3_bind_int(p->pInsert, 2, mPerm==PERM_EXE ? 0100755 : 0100644); |
| 449 | sqlite3_bind_int(p->pInsert, 4, nIn); |
| 450 | zip_blob_minsize(&p->tmp, nIn); |
| 451 | compress( (unsigned char*) |
| 452 | blob_buffer(&p->tmp), &nOut, (unsigned char*)blob_buffer(pFile), nIn |
| 453 | ); |
| 454 | if( nOut>=nIn ){ |
| 455 | sqlite3_bind_blob(p->pInsert, 5, |
| 456 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 457 | ); |
| 458 | }else{ |
| 459 | sqlite3_bind_blob(p->pInsert, 5, |
| 460 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -66,11 +66,11 @@ | |
| 66 | |
| 67 | /* |
| 68 | ** Ensure that blob pBlob is at least nMin bytes in size. |
| 69 | */ |
| 70 | static void zip_blob_minsize(Blob *pBlob, int nMin){ |
| 71 | if( (int)blob_size(pBlob)<nMin ){ |
| 72 | blob_resize(pBlob, nMin); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | /************************************************************************* |
| @@ -441,19 +441,19 @@ | |
| 441 | sqlite3_bind_int(p->pInsert, 4, -1); |
| 442 | sqlite3_bind_text(p->pInsert, 5, |
| 443 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 444 | ); |
| 445 | }else{ |
| 446 | unsigned int nIn = blob_size(pFile); |
| 447 | unsigned long int nOut = nIn; |
| 448 | sqlite3_bind_int(p->pInsert, 2, mPerm==PERM_EXE ? 0100755 : 0100644); |
| 449 | sqlite3_bind_int(p->pInsert, 4, nIn); |
| 450 | zip_blob_minsize(&p->tmp, nIn); |
| 451 | compress( (unsigned char*) |
| 452 | blob_buffer(&p->tmp), &nOut, (unsigned char*)blob_buffer(pFile), nIn |
| 453 | ); |
| 454 | if( nOut>=(unsigned long)nIn ){ |
| 455 | sqlite3_bind_blob(p->pInsert, 5, |
| 456 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 457 | ); |
| 458 | }else{ |
| 459 | sqlite3_bind_blob(p->pInsert, 5, |
| 460 |