Fossil SCM

Fix a multitude of harmless compiler warnings.

drh 2023-02-17 14:57 trunk merge
Commit 53db40e6fcd69e5b82af628a90b2ed46140dbc8999f1a86a2e3bcf35bf89a8ab
--- extsrc/cson_amalgamation.c
+++ extsrc/cson_amalgamation.c
@@ -5389,11 +5389,11 @@
53895389
cson_string * colName = NULL;
53905390
int i = 0;
53915391
int rc = 0;
53925392
cson_value * currentValue = NULL;
53935393
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)) ) {
53955395
return NULL;
53965396
}
53975397
rootV = cson_value_new_object();
53985398
if(!rootV) return NULL;
53995399
root = cson_value_get_object(rootV);
54005400
--- 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
--- src/backoffice.c
+++ src/backoffice.c
@@ -541,11 +541,11 @@
541541
backofficeTrace("/***** Backoffice Interrupt %d *****/\n", GETPID());
542542
db_end_transaction(0);
543543
break;
544544
}
545545
}else{
546
- if( lastWarning+warningDelay < tmNow ){
546
+ if( (sqlite3_uint64)(lastWarning+warningDelay) < tmNow ){
547547
fossil_warning(
548548
"backoffice process %lld still running after %d seconds",
549549
x.idCurrent, (int)(BKOFCE_LEASE_TIME + tmNow - x.tmCurrent));
550550
lastWarning = tmNow;
551551
warningDelay *= 2;
552552
--- 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 @@
101101
int e = old.a[i];
102102
if( e>0 ){
103103
unsigned h = bag_hash(e)%newSize;
104104
while( p->a[h] ){
105105
h++;
106
- if( h==newSize ) h = 0;
106
+ if( (int)h==newSize ) h = 0;
107107
}
108108
p->a[h] = e;
109109
nLive++;
110110
}else if( e<0 ){
111111
nDel++;
@@ -131,11 +131,11 @@
131131
bag_resize(p, n + 20 );
132132
}
133133
h = bag_hash(e)%p->sz;
134134
while( p->a[h]>0 && p->a[h]!=e ){
135135
h++;
136
- if( h>=p->sz ) h = 0;
136
+ if( (int)h>=p->sz ) h = 0;
137137
}
138138
if( p->a[h]<=0 ){
139139
if( p->a[h]==0 ) p->used++;
140140
p->a[h] = e;
141141
p->cnt++;
@@ -154,11 +154,11 @@
154154
return 0;
155155
}
156156
h = bag_hash(e)%p->sz;
157157
while( p->a[h] && p->a[h]!=e ){
158158
h++;
159
- if( h>=p->sz ) h = 0;
159
+ if( (int)h>=p->sz ) h = 0;
160160
}
161161
return p->a[h]==e;
162162
}
163163
164164
/*
@@ -170,11 +170,11 @@
170170
assert( e>0 );
171171
if( p->sz==0 ) return;
172172
h = bag_hash(e)%p->sz;
173173
while( p->a[h] && p->a[h]!=e ){
174174
h++;
175
- if( h>=p->sz ) h = 0;
175
+ if( (int)h>=p->sz ) h = 0;
176176
}
177177
if( p->a[h] ){
178178
int nx = h+1;
179179
if( nx>=p->sz ) nx = 0;
180180
if( p->a[nx]==0 ){
@@ -217,21 +217,21 @@
217217
assert( p->sz>0 );
218218
assert( e>0 );
219219
h = bag_hash(e)%p->sz;
220220
while( p->a[h] && p->a[h]!=e ){
221221
h++;
222
- if( h>=p->sz ) h = 0;
222
+ if( (int)h>=p->sz ) h = 0;
223223
}
224224
assert( p->a[h] );
225225
h++;
226
- while( h<p->sz && p->a[h]<=0 ){
226
+ while( (int)h<p->sz && p->a[h]<=0 ){
227227
h++;
228228
}
229
- return h<p->sz ? p->a[h] : 0;
229
+ return (int)h<p->sz ? p->a[h] : 0;
230230
}
231231
232232
/*
233233
** Return the number of elements in the bag.
234234
*/
235235
int bag_count(Bag *p){
236236
return p->cnt;
237237
}
238238
--- 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 @@
678678
679679
/*
680680
** Truncate a blob back to zero length
681681
*/
682682
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;
684684
}
685685
686686
/*
687687
** Seek the cursor in a blob to the indicated offset.
688688
*/
@@ -1163,11 +1163,11 @@
11631163
return 0;
11641164
}
11651165
blob_is_init(pBlob);
11661166
nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out);
11671167
fclose(out);
1168
- if( nWrote!=blob_size(pBlob) ){
1168
+ if( nWrote!=(int)blob_size(pBlob) ){
11691169
fossil_fatal_recursive("short write: %d of %d bytes to %s", nWrote,
11701170
blob_size(pBlob), zFilename);
11711171
}
11721172
}
11731173
return nWrote;
@@ -1361,11 +1361,11 @@
13611361
int i, n;
13621362
for(i=n=0; i<j; i++){
13631363
if( z[i]=='\n' ) n++;
13641364
}
13651365
j += n;
1366
- if( j>=p->nAlloc ){
1366
+ if( j>=(int)(p->nAlloc) ){
13671367
blob_resize(p, j);
13681368
z = p->aData;
13691369
}
13701370
p->nUsed = j;
13711371
z[j] = 0;
@@ -1416,11 +1416,11 @@
14161416
}
14171417
n++;
14181418
}
14191419
}
14201420
j += n;
1421
- if( j>=p->nAlloc ){
1421
+ if( j>=(int)(p->nAlloc) ){
14221422
blob_resize(p, j);
14231423
z = (unsigned char *)p->aData;
14241424
}
14251425
p->nUsed = j;
14261426
z[j] = 0;
14271427
--- 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 @@
894894
relinkTree(&sTree, p);
895895
}
896896
for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
897897
const char *zLastClass = p->pSibling==0 ? " last" : "";
898898
if( p->pChild ){
899
- const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : "";
899
+ const char *zSubdirClass = (int)(p->nFullName)==nD-1 ? " subdir" : "";
900900
@ <li class="dir%s(zSubdirClass)%s(zLastClass)"><div class="filetreeline">
901901
@ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a>
902902
if( p->mtime>0.0 ){
903903
char *zAge = human_readable_age(rNow - p->mtime);
904904
@ <div class="filetreeage">%s(zAge)</div>
905905
}
906906
@ </div>
907
- if( startExpanded || p->nFullName<=nD ){
907
+ if( startExpanded || (int)(p->nFullName)<=nD ){
908908
@ <ul id="dir%d(nDir)">
909909
}else{
910910
@ <ul id="dir%d(nDir)" class="collapsed">
911911
}
912912
nDir++;
913913
--- 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
--- src/capabilities.c
+++ src/capabilities.c
@@ -323,11 +323,11 @@
323323
if( done ) return;
324324
db_prepare(&q, "SELECT fullcap(cap) FROM user");
325325
while( db_step(&q)==SQLITE_ROW ){
326326
const char *zCap = db_column_text(&q, 0);
327327
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++){
329329
if( strchr(zCap, aCap[i].cCap) ) aCap[i].nUser++;
330330
}
331331
}
332332
db_finalize(&q);
333333
done = 1;
@@ -341,11 +341,11 @@
341341
void capabilities_table(unsigned mClass){
342342
int i;
343343
if( g.perm.Admin ) capabilities_count();
344344
@ <table>
345345
@ <tbody>
346
- for(i=0; i<sizeof(aCap)/sizeof(aCap[0]); i++){
346
+ for(i=0; i<(int)(sizeof(aCap)/sizeof(aCap[0])); i++){
347347
int n;
348348
if( (aCap[i].eClass & mClass)==0 ) continue;
349349
@ <tr><th valign="top">%c(aCap[i].cCap)</th>
350350
@ <td>%h(aCap[i].zAbbrev)</td><td>%h(aCap[i].zOneLiner)</td>\
351351
n = aCap[i].nUser;
352352
--- 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 @@
24002400
while( iPort<=mxPort ){
24012401
memset(&inaddr, 0, sizeof(inaddr));
24022402
inaddr.sin_family = AF_INET;
24032403
if( zIpAddr ){
24042404
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 ){
24062406
fossil_fatal("not a valid IP address: %s", zIpAddr);
24072407
}
24082408
}else if( flags & HTTP_SERVER_LOCALHOST ){
24092409
inaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
24102410
}else{
24112411
--- 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 @@
213213
if( lineChars<=0 ) return;
214214
#if 0
215215
assert( indent<sizeof(zBuf)-5 ); /* See following comments to explain */
216216
assert( origIndent<sizeof(zBuf)-5 ); /* these limits. */
217217
#endif
218
- if( indent>sizeof(zBuf)-6 ){
218
+ if( indent>(int)sizeof(zBuf)-6 ){
219219
/* Limit initial indent to fit output buffer. */
220220
indent = sizeof(zBuf)-6;
221221
}
222222
comment_calc_indent(zLine, indent, trimCrLf, trimSpace, &index);
223223
if( indent>0 ){
224224
for(i=0; i<indent; i++){
225225
zBuf[iBuf++] = ' ';
226226
}
227227
}
228
- if( origIndent>sizeof(zBuf)-6 ){
228
+ if( origIndent>(int)sizeof(zBuf)-6 ){
229229
/* Limit line indent to fit output buffer. */
230230
origIndent = sizeof(zBuf)-6;
231231
}
232232
maxChars = lineChars;
233233
for(;;){
@@ -234,11 +234,11 @@
234234
int useChars = 1;
235235
char c = zLine[index];
236236
/* Flush the output buffer if there's no space left for at least one more
237237
** (potentially 4-byte) UTF-8 sequence, one level of indentation spaces,
238238
** a new line, and a terminating NULL. */
239
- if( iBuf>sizeof(zBuf)-origIndent-6 ){
239
+ if( iBuf>(int)sizeof(zBuf)-origIndent-6 ){
240240
zBuf[iBuf]=0;
241241
iBuf=0;
242242
fossil_print("%s", zBuf);
243243
}
244244
if( c==0 ){
@@ -348,11 +348,11 @@
348348
if( zText==0 ) zText = "(NULL)";
349349
if( maxChars<=0 ){
350350
maxChars = strlen(zText);
351351
}
352352
/* 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) ){
354354
zBuf = fossil_malloc(maxChars*4+1);
355355
}else{
356356
zBuf = zBuffer;
357357
}
358358
for(;;){
359359
--- 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 @@
10291029
if( size<0 ){
10301030
fossil_print("skip phantom %d %s\n", rid, zUuid);
10311031
continue; /* Ignore phantoms */
10321032
}
10331033
content_get(rid, &content);
1034
- if( blob_size(&content)!=size ){
1034
+ if( (int)blob_size(&content)!=size ){
10351035
fossil_print("size mismatch on artifact %d: wanted %d but got %d\n",
10361036
rid, size, blob_size(&content));
10371037
nErr++;
10381038
}
10391039
if( !hname_verify_hash(&content, zUuid, nUuid) ){
@@ -1048,11 +1048,11 @@
10481048
char zFirstLine[400];
10491049
blob_zero(&err);
10501050
10511051
z = blob_buffer(&content);
10521052
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++){}
10541054
memcpy(zFirstLine, z, i);
10551055
zFirstLine[i] = 0;
10561056
p = manifest_parse(&content, 0, &err);
10571057
if( p==0 ){
10581058
fossil_print("manifest_parse failed for %s:\n%s\n",
10591059
--- 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
+1 -1
--- src/db.c
+++ src/db.c
@@ -4746,11 +4746,11 @@
47464746
if( globalFlag && fossil_strcmp(pSetting->name, "manifest")==0 ){
47474747
fossil_fatal("cannot set 'manifest' globally");
47484748
}
47494749
if( unsetFlag || g.argc==4 ){
47504750
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 &&
47524752
fossil_strncmp(pSetting[1].name, zName, n)==0 ){
47534753
Blob x;
47544754
int i;
47554755
blob_init(&x,0,0);
47564756
for(i=0; pSetting[i].name; i++){
47574757
--- 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 @@
204204
205205
/*
206206
** Return the number digits in the base-64 representation of a positive integer
207207
*/
208208
static int digit_count(int v){
209
- unsigned int i, x;
209
+ unsigned int i;
210
+ int x;
210211
for(i=1, x=64; v>=x; i++, x <<= 6){}
211212
return i;
212213
}
213214
214215
#ifdef __GNUC__
@@ -379,21 +380,21 @@
379380
*/
380381
nHash = lenSrc/NHASH;
381382
collide = fossil_malloc( nHash*2*sizeof(int) );
382383
memset(collide, -1, nHash*2*sizeof(int));
383384
landmark = &collide[nHash];
384
- for(i=0; i<lenSrc-NHASH; i+=NHASH){
385
+ for(i=0; i<(int)lenSrc-NHASH; i+=NHASH){
385386
int hv = hash_once(&zSrc[i]) % nHash;
386387
collide[i/NHASH] = landmark[hv];
387388
landmark[hv] = i/NHASH;
388389
}
389390
390391
/* Begin scanning the target file and generating copy commands and
391392
** literal sections of the delta.
392393
*/
393394
base = 0; /* We have already generated everything before zOut[base] */
394
- while( base+NHASH<lenOut ){
395
+ while( base+NHASH<(int)lenOut ){
395396
int iSrc, iBlock;
396397
unsigned int bestCnt, bestOfst=0, bestLitsz=0;
397398
hash_init(&h, &zOut[base]);
398399
i = 0; /* Trying to match a landmark against zOut[base+i] */
399400
bestCnt = 0;
@@ -449,11 +450,11 @@
449450
DEBUG2( printf("MATCH %d bytes at %d: [%s] litsz=%d\n",
450451
cnt, ofst, print16(&zSrc[ofst]), litsz); )
451452
/* sz will hold the number of bytes needed to encode the "insert"
452453
** command and the copy command, not counting the "insert" text */
453454
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 ){
455456
/* Remember this match only if it is the best so far and it
456457
** does not increase the file size */
457458
bestCnt = cnt;
458459
bestOfst = iSrc-k;
459460
bestLitsz = litsz;
@@ -481,20 +482,20 @@
481482
putInt(bestCnt, &zDelta);
482483
*(zDelta++) = '@';
483484
putInt(bestOfst, &zDelta);
484485
DEBUG2( printf("copy %d bytes from %d\n", bestCnt, bestOfst); )
485486
*(zDelta++) = ',';
486
- if( bestOfst + bestCnt -1 > lastRead ){
487
+ if( (int)(bestOfst + bestCnt -1) > lastRead ){
487488
lastRead = bestOfst + bestCnt - 1;
488489
DEBUG2( printf("lastRead becomes %d\n", lastRead); )
489490
}
490491
bestCnt = 0;
491492
break;
492493
}
493494
494495
/* 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 ){
496497
/* We have reached the end of the file and have not found any
497498
** matches. Do an "insert" for everything that does not match */
498499
putInt(lenOut-base, &zDelta);
499500
*(zDelta++) = ':';
500501
memcpy(zDelta, &zOut[base], lenOut-base);
@@ -509,11 +510,11 @@
509510
}
510511
}
511512
/* Output a final "insert" record to get all the text at the end of
512513
** the file that does not match anything in the source file.
513514
*/
514
- if( base<lenOut ){
515
+ if( base<(int)lenOut ){
515516
putInt(lenOut-base, &zDelta);
516517
*(zDelta++) = ':';
517518
memcpy(zDelta, &zOut[base], lenOut-base);
518519
zDelta += lenOut-base;
519520
}
@@ -599,11 +600,11 @@
599600
total += cnt;
600601
if( total>limit ){
601602
/* ERROR: copy exceeds output file size */
602603
return -1;
603604
}
604
- if( ofst+cnt > lenSrc ){
605
+ if( (int)(ofst+cnt) > lenSrc ){
605606
/* ERROR: copy extends past end of input */
606607
return -1;
607608
}
608609
memcpy(zOut, &zSrc[ofst], cnt);
609610
zOut += cnt;
@@ -615,11 +616,11 @@
615616
if( total>limit ){
616617
/* ERROR: insert command gives an output larger than predicted */
617618
return -1;
618619
}
619620
DEBUG1( printf("INSERT %d\n", cnt); )
620
- if( cnt>lenDelta ){
621
+ if( (int)cnt>lenDelta ){
621622
/* ERROR: insert count exceeds size of delta */
622623
return -1;
623624
}
624625
memcpy(zOut, zDelta, cnt);
625626
zOut += cnt;
@@ -688,11 +689,11 @@
688689
break;
689690
}
690691
case ':': {
691692
zDelta++; lenDelta--;
692693
nInsert += cnt;
693
- if( cnt>lenDelta ){
694
+ if( (int)cnt>lenDelta ){
694695
/* ERROR: insert count exceeds size of delta */
695696
return -1;
696697
}
697698
zDelta += cnt;
698699
lenDelta -= cnt;
699700
--- 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 @@
6060
}
6161
if( blob_read_from_file(&target, g.argv[3], ExtFILE)<0 ){
6262
fossil_fatal("cannot read %s", g.argv[3]);
6363
}
6464
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) ){
6666
fossil_fatal("cannot write %s", g.argv[4]);
6767
}
6868
blob_reset(&orig);
6969
blob_reset(&target);
7070
blob_reset(&delta);
@@ -160,11 +160,11 @@
160160
if( blob_read_from_file(&delta, g.argv[3], ExtFILE)<0 ){
161161
fossil_fatal("cannot read %s", g.argv[3]);
162162
}
163163
blob_init(&target, 0, 0);
164164
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) ){
166166
fossil_fatal("cannot write %s", g.argv[4]);
167167
}
168168
blob_reset(&orig);
169169
blob_reset(&target);
170170
blob_reset(&delta);
171171
--- 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 @@
22212221
mxr = p->nEdit;
22222222
while( mxr>2 && R[mxr-1]==0 && R[mxr-2]==0 ){ mxr -= 3; }
22232223
22242224
for(r=0; r<mxr; r += 3*nr){
22252225
/* 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++){}
22272227
22282228
/* If there is a regex, skip this block (generate no diff output)
22292229
** if the regex matches or does not match both insert and delete.
22302230
** Only display the block if one side matches but the other side does
22312231
** not.
@@ -2251,11 +2251,11 @@
22512251
}
22522252
22532253
/* Figure out how many lines of A and B are to be displayed
22542254
** for this change block.
22552255
*/
2256
- if( R[r]>nContext ){
2256
+ if( R[r]>(int)nContext ){
22572257
skip = R[r] - nContext;
22582258
}else{
22592259
skip = 0;
22602260
}
22612261
/* Show the initial common area */
@@ -2262,14 +2262,14 @@
22622262
a += skip;
22632263
b += skip;
22642264
m = R[r] - skip;
22652265
if( r ) skip -= nContext;
22662266
if( skip>0 ){
2267
- if( skip<nContext ){
2267
+ if( skip<(int)nContext ){
22682268
/* If the amount to skip is less that the context band, then
22692269
** 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++){
22712271
pBuilder->xCommon(pBuilder, &A[a+j-skip]);
22722272
}
22732273
}else{
22742274
pBuilder->xSkip(pBuilder, skip, 0);
22752275
}
@@ -2299,11 +2299,11 @@
22992299
23002300
/* Try to find an alignment for the lines within this one block */
23012301
alignment = diffBlockAlignment(&A[a], ma, &B[b], mb, pCfg, &nAlign);
23022302
23032303
for(j=0; ma+mb>0; j++){
2304
- assert( j<nAlign );
2304
+ assert( (int)j<nAlign );
23052305
switch( alignment[j] ){
23062306
case 1: {
23072307
/* Delete one line from the left */
23082308
pBuilder->xDelete(pBuilder, &A[a]);
23092309
ma--;
@@ -2341,11 +2341,11 @@
23412341
b++;
23422342
break;
23432343
}
23442344
}
23452345
}
2346
- assert( nAlign==j );
2346
+ assert( nAlign==(int)j );
23472347
fossil_free(alignment);
23482348
if( i<nr-1 ){
23492349
m = R[r+i*3+3];
23502350
for(j=0; j<m; j++){
23512351
pBuilder->xCommon(pBuilder, &A[a+j]);
@@ -2361,11 +2361,11 @@
23612361
if( m>nContext ) m = nContext;
23622362
for(j=0; j<m && j<nContext; j++){
23632363
pBuilder->xCommon(pBuilder, &A[a+j]);
23642364
}
23652365
}
2366
- if( R[r]>nContext ){
2366
+ if( R[r]>(int)nContext ){
23672367
pBuilder->xSkip(pBuilder, R[r] - nContext, 1);
23682368
}
23692369
pBuilder->xEnd(pBuilder);
23702370
}
23712371
23722372
--- 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 @@
459459
z = zName;
460460
for(i=0; zName[i]; i++){
461461
if( zName[i]=='.' ) z = &zName[i+1];
462462
}
463463
len = strlen(z);
464
- if( len<sizeof(zSuffix)-1 ){
464
+ if( len<(int)sizeof(zSuffix)-1 ){
465465
sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z);
466466
for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]);
467467
z = mimetype_from_name_custom(zSuffix);
468468
if(z!=0){
469469
return z;
470470
--- 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 @@
708708
*/
709709
int validate16(const char *zIn, int nIn){
710710
int i;
711711
if( nIn<0 ) nIn = (int)strlen(zIn);
712712
if( zIn[nIn]==0 ){
713
- return strspn(zIn,"0123456789abcdefABCDEF")==nIn;
713
+ return (int)strspn(zIn,"0123456789abcdefABCDEF")==nIn;
714714
}
715715
for(i=0; i<nIn; i++, zIn++){
716716
if( zDecode[zIn[0]&0xff]>63 ){
717717
return zIn[0]==0;
718718
}
719719
--- 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 @@
115115
"index.html", "index.wiki", "index.md"
116116
};
117117
int i;
118118
if( file_isdir(*pzPath, ExtFILE)!=1 ) return 0;
119119
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++){
121121
char *zNew = mprintf("%s%s", *pzPath, azIndexNames[i]);
122122
if( file_isfile(zNew, ExtFILE) ){
123123
fossil_free(*pzPath);
124124
*pzPath = zNew;
125125
return 1;
@@ -272,15 +272,15 @@
272272
zSrvSw = mprintf("%z, %s", z, zSrvSw);
273273
}
274274
}
275275
cgi_replace_parameter("SERVER_SOFTWARE", zSrvSw);
276276
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++){
278278
(void)P(azCgiEnv[i]);
279279
}
280280
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++){
282282
const char *zVal = P(azCgiEnv[i]);
283283
if( zVal ) fossil_setenv(azCgiEnv[i], zVal);
284284
}
285285
fossil_setenv("HTTP_ACCEPT_ENCODING","");
286286
rc = popen2(zScript, &fdFromChild, &toChild, &pidChild, 1);
287287
--- 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 @@
203203
** Return the mode bits for a file. Return -1 if the file does not
204204
** exist. If zFilename is NULL return the size of the most recently
205205
** stat-ed file.
206206
*/
207207
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);
209209
}
210210
211211
/*
212212
** Return TRUE if either of the following are true:
213213
**
@@ -242,11 +242,11 @@
242242
if( db_allow_symlinks() ){
243243
int i, nName;
244244
char *zName, zBuf[1000];
245245
246246
nName = strlen(zLinkFile);
247
- if( nName>=sizeof(zBuf) ){
247
+ if( nName>=(int)sizeof(zBuf) ){
248248
zName = mprintf("%s", zLinkFile);
249249
}else{
250250
zName = zBuf;
251251
memcpy(zName, zLinkFile, nName+1);
252252
}
253253
--- 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 @@
617617
assert(CIMINI_CONVERT_EOL_WINDOWS & pCI->flags);
618618
if(!(LOOK_CRLF & lookNew)){
619619
blob_add_cr(&pCI->fileContent);
620620
}
621621
}
622
- if(blob_size(&pCI->fileContent)!=oldSize){
622
+ if((int)blob_size(&pCI->fileContent)!=oldSize){
623623
rehash = 1;
624624
}
625625
}
626626
if(rehash!=0){
627627
hname_hash(&pCI->fileContent, 0, &pCI->fileHash);
628628
--- 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 @@
704704
zQuery[i++] = 'h';
705705
zQuery[i++] = 'i';
706706
zQuery[i++] = 's';
707707
zQuery[i++] = 't';
708708
}
709
- assert( i<sizeof(zQuery) );
709
+ assert( i<(int)sizeof(zQuery) );
710710
zQuery[i] = 0;
711711
assert( zQuery[0]==0 || zQuery[0]=='?' );
712712
713713
/* Identify which post to display first. If history is shown, start with the
714714
** original, unedited post. Otherwise advance to the post's latest edit. */
715715
--- 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 @@
541541
x = X509_digest(cert, EVP_sha256(), md, &mdLength);
542542
#else
543543
x = X509_digest(cert, EVP_sha1(), md, &mdLength);
544544
#endif
545545
if( x ){
546
- int j;
546
+ unsigned j;
547547
for(j=0; j<mdLength && j*2+1<sizeof(zHash); ++j){
548548
zHash[j*2] = "0123456789abcdef"[md[j]>>4];
549549
zHash[j*2+1] = "0123456789abcdef"[md[j]&0xf];
550550
}
551551
zHash[j*2] = 0;
552552
--- 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
--- src/http_transport.c
+++ src/http_transport.c
@@ -82,11 +82,11 @@
8282
** like "/bin/rm".
8383
*/
8484
static int is_safe_fossil_command(const char *zFossil){
8585
static const char *const azSafe[] = { "*/fossil", "*/fossil.exe", "*/echo" };
8686
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++){
8888
if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1;
8989
if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1;
9090
}
9191
return 0;
9292
}
9393
--- 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 @@
597597
** last commit that holds that tag.
598598
**
599599
** None of the above is explained in the git-fast-export
600600
** documentation. We had to figure it out via trial and error.
601601
*/
602
- for(i=5; i<strlen(zRefName) && zRefName[i]!='/'; i++){}
602
+ for(i=5; i<(int)strlen(zRefName) && zRefName[i]!='/'; i++){}
603603
gg.tagCommit = strncmp(&zRefName[5], "tags", 4)==0; /* pattern B */
604604
if( zRefName[i+1]!=0 ) zRefName += i+1;
605605
if( fossil_strcmp(zRefName, "master")==0 ) zRefName = ggit.zMasterName;
606606
gg.zBranch = fossil_strdup(zRefName);
607607
gg.fromLoaded = 0;
@@ -767,11 +767,11 @@
767767
nFrom = strlen(zFrom);
768768
while( (pFile = import_find_file(zFrom, &i, mx))!=0 ){
769769
if( pFile->isFrom==0 ) continue;
770770
pNew = import_add_file();
771771
pFile = &gg.aFile[i-1];
772
- if( strlen(pFile->zName)>nFrom ){
772
+ if( (int)strlen(pFile->zName)>nFrom ){
773773
pNew->zName = mprintf("%s%s", zTo, pFile->zName+nFrom);
774774
}else{
775775
pNew->zName = fossil_strdup(zTo);
776776
}
777777
pNew->isExe = pFile->isExe;
@@ -790,11 +790,11 @@
790790
nFrom = strlen(zFrom);
791791
while( (pFile = import_find_file(zFrom, &i, gg.nFile))!=0 ){
792792
if( pFile->isFrom==0 ) continue;
793793
pNew = import_add_file();
794794
pFile = &gg.aFile[i-1];
795
- if( strlen(pFile->zName)>nFrom ){
795
+ if( (int)strlen(pFile->zName)>nFrom ){
796796
pNew->zName = mprintf("%s%s", zTo, pFile->zName+nFrom);
797797
}else{
798798
pNew->zName = fossil_strdup(zTo);
799799
}
800800
pNew->zPrior = pFile->zName;
@@ -1013,11 +1013,11 @@
10131013
zLen = svn_find_header(*rec, "Text-content-length");
10141014
if( zLen ){
10151015
rec->contentFlag = 1;
10161016
nLen = atoi(zLen);
10171017
blob_read_from_channel(&rec->content, pIn, nLen);
1018
- if( blob_size(&rec->content)!=nLen ){
1018
+ if( (int)blob_size(&rec->content)!=nLen ){
10191019
fossil_fatal("short read: got %d of %d bytes",
10201020
blob_size(&rec->content), nLen
10211021
);
10221022
}
10231023
}else{
@@ -1278,11 +1278,11 @@
12781278
if( gsvn.azIgnTree ){
12791279
const char **pzIgnTree;
12801280
unsigned nPath = strlen(zPath);
12811281
for( pzIgnTree = gsvn.azIgnTree; *pzIgnTree; ++pzIgnTree ){
12821282
const char *zIgn = *pzIgnTree;
1283
- int nIgn = strlen(zIgn);
1283
+ unsigned nIgn = strlen(zIgn);
12841284
if( strncmp(zPath, zIgn, nIgn) == 0
12851285
&& ( nPath == nIgn || (nPath > nIgn && zPath[nIgn] == '/')) ){
12861286
return 0;
12871287
}
12881288
}
12891289
--- 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 @@
343343
const char *z = blob_buffer(pContent);
344344
int bomSize = 0;
345345
const unsigned char *bom = get_utf8_bom(&bomSize);
346346
347347
if( pnByte ) *pnByte = bomSize;
348
- if( blob_size(pContent)<bomSize ) return 0;
348
+ if( (int)blob_size(pContent)<bomSize ) return 0;
349349
return memcmp(z, bom, bomSize)==0;
350350
}
351351
352352
/*
353353
** This function returns non-zero if the blob starts with a UTF-16
354354
--- 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 @@
427427
428428
g.argc = argc;
429429
g.argv = argv;
430430
sqlite3_initialize();
431431
#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]);
433433
#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]);
435435
#endif
436436
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++){
438438
z = g.argv[i];
439439
if( z[0]!='-' ) continue;
440440
z++;
441441
if( z[0]=='-' ) z++;
442442
/* Maintenance reminder: we do not stop at a "--" flag here,
@@ -444,11 +444,11 @@
444444
** introduces some weird corner cases, as covered in forum thread
445445
** 4382bbc66757c39f. e.g. (fossil -U -- --args ...) is handled
446446
** differently when we stop at "--" here. */
447447
if( fossil_strcmp(z, "args")==0 ) break;
448448
}
449
- if( i>=g.argc-1 ) return;
449
+ if( (int)i>=g.argc-1 ) return;
450450
451451
zFileName = g.argv[i+1];
452452
if( strcmp(zFileName,"-")==0 ){
453453
inFile = stdin;
454454
}else if( !file_isfile(zFileName, ExtFILE) ){
@@ -506,11 +506,11 @@
506506
if( z[k] ) newArgv[j++] = &z[k];
507507
}
508508
}
509509
}
510510
i += 2;
511
- while( i<g.argc ) newArgv[j++] = g.argv[i++];
511
+ while( (int)i<g.argc ) newArgv[j++] = g.argv[i++];
512512
newArgv[j] = 0;
513513
g.argc = j;
514514
g.argv = newArgv;
515515
}
516516
@@ -1761,11 +1761,11 @@
17611761
if( c=='_' ) continue;
17621762
if( c=='-' && zRepo[j-1]!='/' ) continue;
17631763
if( c=='.' && fossil_isalnum(zRepo[j-1]) && fossil_isalnum(zRepo[j+1])){
17641764
continue;
17651765
}
1766
- if( c=='.' && g.fAllowACME && j==nBase+1
1766
+ if( c=='.' && g.fAllowACME && j==(int)nBase+1
17671767
&& strncmp(&zRepo[j-1],"/.well-known/",12)==0
17681768
){
17691769
/* We allow .well-known as the top-level directory for ACME */
17701770
continue;
17711771
}
17721772
--- 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 @@
396396
/* release the given working buffer back to the cache */
397397
static void release_work_buffer(struct render *rndr, struct Blob *buf){
398398
if( !buf ) return;
399399
rndr->iDepth--;
400400
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])) ){
402402
rndr->aBlobCache[rndr->nBlobCache++] = buf;
403403
}else{
404404
fossil_free(buf);
405405
}
406406
}
@@ -1570,13 +1570,13 @@
15701570
** block. */
15711571
static size_t prefix_fencedcode(char *data, size_t size){
15721572
char c = data[0];
15731573
int nb;
15741574
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++){}
15761576
if( nb<3 ) return 0;
1577
- if( nb>=size-nb ) return 0;
1577
+ if( nb>=(int)size-nb ) return 0;
15781578
return nb;
15791579
}
15801580
15811581
/* prefix_oli -- returns ordered list item prefix */
15821582
static size_t prefix_oli(char *data, size_t size){
@@ -1687,11 +1687,11 @@
16871687
char *work_data = data;
16881688
size_t work_size = 0;
16891689
16901690
while( i<size ){
16911691
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));
16931693
/* The above is the same as:
16941694
** for(end=i+1; end<size && data[end-1]!='\n'; end++);
16951695
** "end" is left with a value such that data[end] is one byte
16961696
** past the first '\n' or one byte past the end of the string */
16971697
if( is_empty(data+i, size-i)
@@ -1760,11 +1760,11 @@
17601760
struct Blob *work = new_work_buffer(rndr);
17611761
17621762
beg = 0;
17631763
while( beg<size ){
17641764
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));
17661766
/* The above is the same as:
17671767
** for(end=beg+1; end<size && data[end-1]!='\n'; end++);
17681768
** "end" is left with a value such that data[end] is one byte
17691769
** past the first \n or past then end of the string. */
17701770
pre = prefix_code(data+beg, end-beg);
@@ -1970,13 +1970,13 @@
19701970
int level = 0;
19711971
size_t i, end, skip, span_beg, span_size;
19721972
19731973
if( !size || data[0]!='#' ) return 0;
19741974
1975
- while( level<size && level<6 && data[level]=='#' ){ level++; }
1975
+ while( level<(int)size && level<6 && data[level]=='#' ){ level++; }
19761976
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);
19781978
span_beg = i;
19791979
19801980
for(end=i; end<size && data[end]!='\n'; end++);
19811981
skip = end;
19821982
if( end<=i ) return parse_paragraph(ob, rndr, data, size);
@@ -2005,11 +2005,11 @@
20052005
size_t i, w;
20062006
20072007
/* assuming data[0]=='<' && data[1]=='/' already tested */
20082008
20092009
/* checking tag is a match */
2010
- if( (tag->size+3)>size
2010
+ if( (tag->size+3)>(int)size
20112011
|| fossil_strnicmp(data+2, tag->text, tag->size)
20122012
|| data[tag->size+2]!='>'
20132013
){
20142014
return 0;
20152015
}
@@ -2635,11 +2635,12 @@
26352635
const struct Blob *ib, /* input blob in markdown */
26362636
const struct mkd_renderer *rndrer /* renderer descriptor (callbacks) */
26372637
){
26382638
struct link_ref *lr;
26392639
struct footnote *fn;
2640
- size_t i, beg, end = 0;
2640
+ int i;
2641
+ size_t beg, end = 0;
26412642
struct render rndr;
26422643
size_t size;
26432644
Blob text = BLOB_INITIALIZER; /* input after the first pass */
26442645
Blob * const allNotes = &rndr.notes.all;
26452646
@@ -2719,11 +2720,12 @@
27192720
qsort(fn, rndr.notes.nLbled, sizeof(struct footnote), cmp_footnote_id);
27202721
27212722
/* concatenate footnotes with equal labels */
27222723
for(i=0; i<rndr.notes.nLbled ;){
27232724
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);
27252727
while(j<rndr.notes.nLbled && !blob_compare(&x->id, &fn[j].id)){
27262728
k += blob_size(&fn[j].text) + 10 + blob_size(&fn[j].upc);
27272729
j++;
27282730
nDups++;
27292731
}
@@ -2730,11 +2732,11 @@
27302732
if( i+1<j ){
27312733
Blob list = empty_blob;
27322734
blob_reserve(&list, k);
27332735
/* must match _joined_footnote_indicator in html_footnote_item() */
27342736
blob_append_literal(&list, "<ul class='fn-joined'>\n");
2735
- for(k=i; k<j; k++){
2737
+ for(k=i; (int)k<j; k++){
27362738
struct footnote *y = fn + k;
27372739
blob_append_literal(&list, "<li>");
27382740
if( blob_size(&y->upc) ){
27392741
blob_appendb(&list, &y->upc);
27402742
blob_reset(&y->upc);
@@ -2742,11 +2744,11 @@
27422744
blob_appendb(&list, &y->text);
27432745
blob_append_literal(&list, "</li>\n");
27442746
27452747
/* free memory buffer */
27462748
blob_reset(&y->text);
2747
- if( k!=i ) blob_reset(&y->id);
2749
+ if( (int)k!=i ) blob_reset(&y->id);
27482750
}
27492751
blob_append_literal(&list, "</ul>\n");
27502752
x->text = list;
27512753
g.ftntsIssues[2]++;
27522754
}
@@ -2762,11 +2764,11 @@
27622764
}
27632765
}
27642766
blob_reset( allNotes );
27652767
rndr.notes.all = filtered;
27662768
rndr.notes.nLbled = n;
2767
- assert( COUNT_FOOTNOTES(allNotes) == rndr.notes.nLbled );
2769
+ assert( (int)(COUNT_FOOTNOTES(allNotes)) == rndr.notes.nLbled );
27682770
}
27692771
}
27702772
fn = CAST_AS_FOOTNOTES( allNotes );
27712773
for(i=0; i<rndr.notes.nLbled; i++){
27722774
fn[i].index = i;
@@ -2830,11 +2832,11 @@
28302832
** If it doesn't then a compiler has done something very weird.
28312833
*/
28322834
assert( &(rndr.notes.misref.id) == &(rndr.notes.misref.text) - 1 );
28332835
assert( &(rndr.notes.misref.upc) == &(rndr.notes.misref.text) + 1 );
28342836
2835
- for(i=0; i<COUNT_FOOTNOTES(notes); i++){
2837
+ for(i=0; i<(int)(COUNT_FOOTNOTES(notes)); i++){
28362838
const struct footnote* x = CAST_AS_FOOTNOTES(notes) + i;
28372839
const int xUsed = x->bRndred ? x->nUsed : 0;
28382840
if( !x->iMark ) break;
28392841
assert( x->nUsed );
28402842
rndr.make.footnote_item(all_items, &x->text, x->iMark,
@@ -2845,11 +2847,11 @@
28452847
if( rndr.notes.misref.nUsed ){
28462848
rndr.make.footnote_item(all_items, 0, -1,
28472849
rndr.notes.misref.nUsed, rndr.make.opaque);
28482850
g.ftntsIssues[0] += rndr.notes.misref.nUsed;
28492851
}
2850
- while( ++j < COUNT_FOOTNOTES(notes) ){
2852
+ while( ++j < (int)(COUNT_FOOTNOTES(notes)) ){
28512853
const struct footnote* x = CAST_AS_FOOTNOTES(notes) + j;
28522854
assert( !x->iMark );
28532855
assert( !x->nUsed );
28542856
assert( !x->bRndred );
28552857
rndr.make.footnote_item(all_items,&x->text,0,0,rndr.make.opaque);
@@ -2865,23 +2867,23 @@
28652867
/* clean-up */
28662868
assert( rndr.iDepth==0 );
28672869
blob_reset(&text);
28682870
lr = (struct link_ref *)blob_buffer(&rndr.refs);
28692871
end = blob_size(&rndr.refs)/sizeof(struct link_ref);
2870
- for(i=0; i<end; i++){
2872
+ for(i=0; i<(int)end; i++){
28712873
blob_reset(&lr[i].id);
28722874
blob_reset(&lr[i].link);
28732875
blob_reset(&lr[i].title);
28742876
}
28752877
blob_reset(&rndr.refs);
28762878
fn = CAST_AS_FOOTNOTES( allNotes );
28772879
end = COUNT_FOOTNOTES( allNotes );
2878
- for(i=0; i<end; i++){
2880
+ for(i=0; i<(int)end; i++){
28792881
if(blob_size(&fn[i].id)) blob_reset(&fn[i].id);
28802882
if(blob_size(&fn[i].upc)) blob_reset(&fn[i].upc);
28812883
blob_reset(&fn[i].text);
28822884
}
28832885
blob_reset(&rndr.notes.all);
28842886
for(i=0; i<rndr.nBlobCache; i++){
28852887
fossil_free(rndr.aBlobCache[i]);
28862888
}
28872889
}
28882890
--- 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 @@
456456
}
457457
if( blob_read_from_file(&v2, g.argv[4], ExtFILE)<0 ){
458458
fossil_fatal("cannot read %s", g.argv[4]);
459459
}
460460
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) ){
462462
fossil_fatal("cannot write %s", g.argv[4]);
463463
}
464464
blob_reset(&pivot);
465465
blob_reset(&v1);
466466
blob_reset(&v2);
467467
--- 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 @@
864864
if( !flag_leftjustify ){
865865
register int nspace;
866866
nspace = width-length;
867867
if( nspace>0 ){
868868
count += nspace;
869
- while( nspace>=etSPACESIZE ){
869
+ while( nspace>=(int)etSPACESIZE ){
870870
blob_append(pBlob,spaces,etSPACESIZE);
871871
nspace -= etSPACESIZE;
872872
}
873873
if( nspace>0 ) blob_append(pBlob,spaces,nspace);
874874
}
@@ -880,11 +880,11 @@
880880
if( flag_leftjustify ){
881881
register int nspace;
882882
nspace = width-length;
883883
if( nspace>0 ){
884884
count += nspace;
885
- while( nspace>=etSPACESIZE ){
885
+ while( nspace>=(int)etSPACESIZE ){
886886
blob_append(pBlob,spaces,etSPACESIZE);
887887
nspace -= etSPACESIZE;
888888
}
889889
if( nspace>0 ) blob_append(pBlob,spaces,nspace);
890890
}
891891
--- 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 @@
256256
int nChild, i, cid;
257257
258258
while( rid>0 ){
259259
260260
/* Fix up the "blob.size" field if needed. */
261
- if( size!=blob_size(pBase) ){
261
+ if( size!=(int)blob_size(pBase) ){
262262
db_multi_exec(
263263
"UPDATE blob SET size=%d WHERE rid=%d", blob_size(pBase), rid
264264
);
265265
}
266266
267267
--- 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 @@
246246
blen++;
247247
}
248248
/* build the string */
249249
blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue);
250250
/* this _must_ be right */
251
- if(blob_size(&tball.pax) != blen){
251
+ if((int)blob_size(&tball.pax) != blen){
252252
fossil_panic("internal error: PAX tar header has bad length");
253253
}
254254
}
255255
256256
257257
--- 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
+1 -1
--- src/th.c
+++ src/th.c
@@ -853,11 +853,11 @@
853853
thBufferAddChar(interp, &strbuf, 0);
854854
thBufferWrite(interp, &lenbuf, &nWord, sizeof(int));
855855
nCount++;
856856
}
857857
}
858
- assert((lenbuf.nBuf/sizeof(int))==nCount);
858
+ assert((int)(lenbuf.nBuf/sizeof(int))==nCount);
859859
860860
assert((pazElem && panElem) || (!pazElem && !panElem));
861861
if( pazElem && rc==TH_OK ){
862862
int i;
863863
char *zElem;
864864
--- 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 @@
18491849
if( argc==2 ){
18501850
if( Th_ToInt(interp, argv[1], argl[1], &n) ){
18511851
return TH_ERROR;
18521852
}
18531853
if( n<1 ) n = 1;
1854
- if( n>sizeof(aRand) ) n = sizeof(aRand);
1854
+ if( n>(int)sizeof(aRand) ) n = sizeof(aRand);
18551855
}else{
18561856
n = 10;
18571857
}
18581858
sqlite3_randomness(n, aRand);
18591859
encode16(aRand, zOut, n);
18601860
--- 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 @@
547547
if( z[jj]=='\n' ) break;
548548
}
549549
}
550550
z[ii] = 0;
551551
cgi_printf("%W",z);
552
- }else if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
552
+ }else if( mxWikiLen>0 && (int)blob_size(&comment)>mxWikiLen ){
553553
Blob truncated;
554554
blob_zero(&truncated);
555555
blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
556556
blob_append(&truncated, "...", 3);
557557
@ %W(blob_str(&truncated))
@@ -3432,11 +3432,11 @@
34323432
zStartOfProject = db_text(0,
34333433
"SELECT datetime(min(mtime),toLocal(),'startofday') FROM event;"
34343434
);
34353435
timeline_temp_table();
34363436
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++){
34383438
int iAgo = aYearsAgo[i];
34393439
char *zThis = db_text(0, "SELECT date(%Q,'-%d years')", zToday, iAgo);
34403440
Blob sql;
34413441
char *zId;
34423442
if( strcmp(zThis, zStartOfProject)<0 ) break;
34433443
--- 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 @@
926926
zValue = Th_Fetch(aField[i].zName, &nValue);
927927
if( zValue ){
928928
while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; }
929929
if( ((aField[i].mUsed & USEDBY_TICKETCHNG)!=0 && nValue>0)
930930
|| memcmp(zValue, aField[i].zValue, nValue)!=0
931
- || strlen(aField[i].zValue)!=nValue
931
+ ||(int)strlen(aField[i].zValue)!=nValue
932932
){
933933
if( memcmp(aField[i].zName, "private_", 8)==0 ){
934934
zValue = db_conceal(zValue, nValue);
935935
blob_appendf(&tktchng, "J %s %s\n", aField[i].zName, zValue);
936936
aUsed[i] = JCARD_PRIVATE;
937937
--- 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 @@
157157
int nB = 0;
158158
int i;
159159
memcpy(zOrig, "abcdefghijklmnopqrstuvwyz", nA+1);
160160
memcpy(zA, zOrig, nA+1);
161161
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;
163163
printFive(zA);
164164
while( nA>0 ){
165165
int x = randint(nA);
166166
zB[nB++] = zA[x];
167167
zA[x] = zA[--nA];
168168
--- 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 @@
680680
}else{
681681
zDir = fossil_getenv("LOCALAPPDATA");
682682
if( zDir==0 ) zDir = ".";
683683
}
684684
#else
685
- for(i=0; i<sizeof(azTmp)/sizeof(azTmp[0]); i++){
685
+ for(i=0; i<(int)(sizeof(azTmp)/sizeof(azTmp[0])); i++){
686686
struct stat buf;
687687
zDir = azTmp[i];
688688
if( stat(zDir,&buf)==0 && S_ISDIR(buf.st_mode) && access(zDir,03)==0 ){
689689
break;
690690
}
691691
}
692
- if( i>=sizeof(azTmp)/sizeof(azTmp[0]) ) zDir = ".";
692
+ if( i>=(int)(sizeof(azTmp)/sizeof(azTmp[0])) ) zDir = ".";
693693
cDirSep = '/';
694694
#endif
695695
nDir = strlen(zDir);
696696
zSep[1] = 0;
697697
zSep[0] = (nDir && zDir[nDir-1]==cDirSep) ? 0 : cDirSep;
698698
--- 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
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -790,11 +790,11 @@
790790
p->endTag = 0;
791791
i = 1;
792792
}
793793
j = 0;
794794
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]);
796796
i++;
797797
}
798798
zTag[j] = 0;
799799
p->iCode = findTag(zTag);
800800
p->iType = aMarkup[p->iCode].iType;
@@ -813,11 +813,11 @@
813813
while( fossil_isspace(z[i]) ){ i++; }
814814
while( c!='>' && p->nAttr<8 && fossil_isalpha(z[i]) ){
815815
int attrOk; /* True to preserve attribute. False to ignore it */
816816
j = 0;
817817
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]);
819819
i++;
820820
}
821821
zTag[j] = 0;
822822
p->aAttr[p->nAttr].iACode = iACode = findAttr(zTag);
823823
attrOk = iACode!=0 && (seen & aAttribute[iACode].iMask)==0;
@@ -1105,11 +1105,11 @@
11051105
db_static_prepare(&q,
11061106
"SELECT 1 FROM blob WHERE uuid>=:u AND uuid<:u2"
11071107
);
11081108
db_bind_text(&q, ":u", zUuid);
11091109
n = (int)strlen(zUuid);
1110
- if( n>=sizeof(zU2) ) n = sizeof(zU2)-1;
1110
+ if( n>=(int)sizeof(zU2) ) n = sizeof(zU2)-1;
11111111
memcpy(zU2, zUuid, n);
11121112
zU2[n-1]++;
11131113
zU2[n] = 0;
11141114
db_bind_text(&q, ":u2", zU2);
11151115
rc = db_step(&q);
@@ -1358,11 +1358,11 @@
13581358
}else{
13591359
blob_appendf(pOut, "<span class=\"brokenlink\">[%h]", zTarget);
13601360
zTerm = "</span>";
13611361
}
13621362
if( zExtra ) fossil_free(zExtra);
1363
- assert( strlen(zTerm)<nClose );
1363
+ assert( (int)strlen(zTerm)<nClose );
13641364
sqlite3_snprintf(nClose, zClose, "%s", zTerm);
13651365
}
13661366
13671367
/*
13681368
** Check to see if the given parsed markup is the correct
13691369
--- 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 @@
450450
&& content_get(srcId, &src)
451451
){
452452
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", srcId);
453453
blob_delta_create(&src, pContent, &delta);
454454
size = blob_size(&delta);
455
- if( size>=blob_size(pContent)-50 ){
455
+ if( size>=(int)blob_size(pContent)-50 ){
456456
size = 0;
457457
}else if( uuid_is_shunned(zUuid) ){
458458
size = 0;
459459
}else{
460460
if( isPrivate ) blob_append(pXfer->pOut, "private\n", -1);
@@ -577,11 +577,11 @@
577577
if( uuid_is_shunned(blob_str(pUuid)) ){
578578
blob_reset(&uuid);
579579
return;
580580
}
581581
if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) ||
582
- pXfer->mxSend<=blob_size(pXfer->pOut) ){
582
+ pXfer->mxSend<=(int)blob_size(pXfer->pOut) ){
583583
const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n";
584584
blob_appendf(pXfer->pOut, zFormat /*works-like:"%b"*/, pUuid);
585585
pXfer->nIGotSent++;
586586
blob_reset(&uuid);
587587
return;
@@ -701,11 +701,11 @@
701701
const char *zName, /* Name of unversioned file to be sent */
702702
int noContent /* True to omit the content */
703703
){
704704
Stmt q1;
705705
706
- if( blob_size(pXfer->pOut)>=pXfer->mxSend ) noContent = 1;
706
+ if( (int)blob_size(pXfer->pOut)>=pXfer->mxSend ) noContent = 1;
707707
if( noContent ){
708708
db_prepare(&q1,
709709
"SELECT mtime, hash, encoding, sz FROM unversioned WHERE name=%Q",
710710
zName
711711
);
@@ -722,11 +722,11 @@
722722
if( pXfer->remoteVersion<20000 && db_column_bytes(&q1,1)>HNAME_LEN_SHA1 ){
723723
xfer_cannot_send_sha3_error(pXfer);
724724
db_reset(&q1);
725725
return;
726726
}
727
- if( blob_size(pXfer->pOut)>=pXfer->mxSend ){
727
+ if( (int)blob_size(pXfer->pOut)>=pXfer->mxSend ){
728728
/* If we have already reached the send size limit, send a (short)
729729
** uvigot card rather than a uvfile card. This only happens on the
730730
** server side. The uvigot card will provoke the client to resend
731731
** another uvgimme on the next cycle. */
732732
blob_appendf(pXfer->pOut, "uvigot %s %lld %s %d\n",
@@ -1029,11 +1029,11 @@
10291029
);
10301030
}
10311031
while( db_step(&q)==SQLITE_ROW ){
10321032
blob_appendf(pXfer->pOut, "igot %s\n", db_column_text(&q, 0));
10331033
cnt++;
1034
- if( pXfer->resync && pXfer->mxSend<blob_size(pXfer->pOut) ){
1034
+ if( pXfer->resync && pXfer->mxSend<(int)blob_size(pXfer->pOut) ){
10351035
pXfer->resync = db_column_int(&q, 1)-1;
10361036
}
10371037
}
10381038
db_finalize(&q);
10391039
if( cnt==0 ) pXfer->resync = 0;
@@ -1457,11 +1457,11 @@
14571457
if( iVers>=3 ){
14581458
cgi_set_content_type("application/x-fossil-uncompressed");
14591459
}
14601460
blob_is_int(&xfer.aToken[2], &seqno);
14611461
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){
14631463
if( time(NULL) >= xfer.maxTime ) break;
14641464
if( iVers>=3 ){
14651465
send_compressed_file(&xfer, seqno);
14661466
}else{
14671467
send_file(&xfer, seqno, 0, 1);
@@ -2228,11 +2228,11 @@
22282228
nArtifactSent++;
22292229
db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName);
22302230
if( syncFlags & SYNC_VERBOSE ){
22312231
fossil_print("\rUnversioned-file sent: %s\n", zName);
22322232
}
2233
- if( blob_size(xfer.pOut)>xfer.mxSend ) break;
2233
+ if( (int)blob_size(xfer.pOut)>xfer.mxSend ) break;
22342234
}
22352235
db_finalize(&uvq);
22362236
if( rc==SQLITE_DONE ) uvDoPush = 0;
22372237
}
22382238
}
22392239
--- 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 @@
6666
6767
/*
6868
** Ensure that blob pBlob is at least nMin bytes in size.
6969
*/
7070
static void zip_blob_minsize(Blob *pBlob, int nMin){
71
- if( blob_size(pBlob)<nMin ){
71
+ if( (int)blob_size(pBlob)<nMin ){
7272
blob_resize(pBlob, nMin);
7373
}
7474
}
7575
7676
/*************************************************************************
@@ -441,19 +441,19 @@
441441
sqlite3_bind_int(p->pInsert, 4, -1);
442442
sqlite3_bind_text(p->pInsert, 5,
443443
blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC
444444
);
445445
}else{
446
- int nIn = blob_size(pFile);
446
+ unsigned int nIn = blob_size(pFile);
447447
unsigned long int nOut = nIn;
448448
sqlite3_bind_int(p->pInsert, 2, mPerm==PERM_EXE ? 0100755 : 0100644);
449449
sqlite3_bind_int(p->pInsert, 4, nIn);
450450
zip_blob_minsize(&p->tmp, nIn);
451451
compress( (unsigned char*)
452452
blob_buffer(&p->tmp), &nOut, (unsigned char*)blob_buffer(pFile), nIn
453453
);
454
- if( nOut>=nIn ){
454
+ if( nOut>=(unsigned long)nIn ){
455455
sqlite3_bind_blob(p->pInsert, 5,
456456
blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC
457457
);
458458
}else{
459459
sqlite3_bind_blob(p->pInsert, 5,
460460
--- 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

Keyboard Shortcuts

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