Fossil SCM

Merged the compiler warning fixes into mainstream

jnc 2007-09-25 21:28 trunk merge
Commit 92291035fe251899a61464d304c16973ee241da0
+2 -2
--- src/cgi.c
+++ src/cgi.c
@@ -1022,11 +1022,11 @@
10221022
cgi_setenv("REQUEST_URI", zToken);
10231023
for(i=0; zToken[i] && zToken[i]!='?'; i++){}
10241024
if( zToken[i] ) zToken[i++] = 0;
10251025
cgi_setenv("PATH_INFO", zToken);
10261026
cgi_setenv("QUERY_STRING", &zToken[i]);
1027
- if( getpeername(fileno(stdin), (struct sockaddr*)&remoteName, &size)>=0 ){
1027
+ if( getpeername(fileno(stdin), (struct sockaddr*)&remoteName, (socklen_t*)&size)>=0 ){
10281028
char *zIpAddr = inet_ntoa(remoteName.sin_addr);
10291029
cgi_setenv("REMOTE_ADDR", zIpAddr);
10301030
10311031
/* Set the Global.zIpAddr variable to the server we are talking to.
10321032
** This is used to populate the ipaddr column of the rcvfrom table,
@@ -1125,11 +1125,11 @@
11251125
delay.tv_usec = 0;
11261126
FD_ZERO(&readfds);
11271127
FD_SET( listener, &readfds);
11281128
if( select( listener+1, &readfds, 0, 0, &delay) ){
11291129
lenaddr = sizeof(inaddr);
1130
- connection = accept(listener, (struct sockaddr*)&inaddr, &lenaddr);
1130
+ connection = accept(listener, (struct sockaddr*)&inaddr, (socklen_t*) &lenaddr);
11311131
if( connection>=0 ){
11321132
child = fork();
11331133
if( child!=0 ){
11341134
if( child>0 ) nchildren++;
11351135
close(connection);
11361136
--- src/cgi.c
+++ src/cgi.c
@@ -1022,11 +1022,11 @@
1022 cgi_setenv("REQUEST_URI", zToken);
1023 for(i=0; zToken[i] && zToken[i]!='?'; i++){}
1024 if( zToken[i] ) zToken[i++] = 0;
1025 cgi_setenv("PATH_INFO", zToken);
1026 cgi_setenv("QUERY_STRING", &zToken[i]);
1027 if( getpeername(fileno(stdin), (struct sockaddr*)&remoteName, &size)>=0 ){
1028 char *zIpAddr = inet_ntoa(remoteName.sin_addr);
1029 cgi_setenv("REMOTE_ADDR", zIpAddr);
1030
1031 /* Set the Global.zIpAddr variable to the server we are talking to.
1032 ** This is used to populate the ipaddr column of the rcvfrom table,
@@ -1125,11 +1125,11 @@
1125 delay.tv_usec = 0;
1126 FD_ZERO(&readfds);
1127 FD_SET( listener, &readfds);
1128 if( select( listener+1, &readfds, 0, 0, &delay) ){
1129 lenaddr = sizeof(inaddr);
1130 connection = accept(listener, (struct sockaddr*)&inaddr, &lenaddr);
1131 if( connection>=0 ){
1132 child = fork();
1133 if( child!=0 ){
1134 if( child>0 ) nchildren++;
1135 close(connection);
1136
--- src/cgi.c
+++ src/cgi.c
@@ -1022,11 +1022,11 @@
1022 cgi_setenv("REQUEST_URI", zToken);
1023 for(i=0; zToken[i] && zToken[i]!='?'; i++){}
1024 if( zToken[i] ) zToken[i++] = 0;
1025 cgi_setenv("PATH_INFO", zToken);
1026 cgi_setenv("QUERY_STRING", &zToken[i]);
1027 if( getpeername(fileno(stdin), (struct sockaddr*)&remoteName, (socklen_t*)&size)>=0 ){
1028 char *zIpAddr = inet_ntoa(remoteName.sin_addr);
1029 cgi_setenv("REMOTE_ADDR", zIpAddr);
1030
1031 /* Set the Global.zIpAddr variable to the server we are talking to.
1032 ** This is used to populate the ipaddr column of the rcvfrom table,
@@ -1125,11 +1125,11 @@
1125 delay.tv_usec = 0;
1126 FD_ZERO(&readfds);
1127 FD_SET( listener, &readfds);
1128 if( select( listener+1, &readfds, 0, 0, &delay) ){
1129 lenaddr = sizeof(inaddr);
1130 connection = accept(listener, (struct sockaddr*)&inaddr, (socklen_t*) &lenaddr);
1131 if( connection>=0 ){
1132 child = fork();
1133 if( child!=0 ){
1134 if( child>0 ) nchildren++;
1135 close(connection);
1136
+1 -1
--- src/delta.c
+++ src/delta.c
@@ -334,11 +334,11 @@
334334
** literal sections of the delta.
335335
*/
336336
base = 0; /* We have already generated everything before zOut[base] */
337337
while( base+NHASH<lenOut ){
338338
int iSrc, iBlock;
339
- unsigned int bestCnt, bestOfst, bestLitsz;
339
+ unsigned int bestCnt, bestOfst=0, bestLitsz=0;
340340
hash_init(&h, &zOut[base]);
341341
i = 0; /* Trying to match a landmark against zOut[base+i] */
342342
bestCnt = 0;
343343
while( 1 ){
344344
int hv;
345345
--- src/delta.c
+++ src/delta.c
@@ -334,11 +334,11 @@
334 ** literal sections of the delta.
335 */
336 base = 0; /* We have already generated everything before zOut[base] */
337 while( base+NHASH<lenOut ){
338 int iSrc, iBlock;
339 unsigned int bestCnt, bestOfst, bestLitsz;
340 hash_init(&h, &zOut[base]);
341 i = 0; /* Trying to match a landmark against zOut[base+i] */
342 bestCnt = 0;
343 while( 1 ){
344 int hv;
345
--- src/delta.c
+++ src/delta.c
@@ -334,11 +334,11 @@
334 ** literal sections of the delta.
335 */
336 base = 0; /* We have already generated everything before zOut[base] */
337 while( base+NHASH<lenOut ){
338 int iSrc, iBlock;
339 unsigned int bestCnt, bestOfst=0, bestLitsz=0;
340 hash_init(&h, &zOut[base]);
341 i = 0; /* Trying to match a landmark against zOut[base+i] */
342 bestCnt = 0;
343 while( 1 ){
344 int hv;
345
+1 -1
--- src/diff.c
+++ src/diff.c
@@ -174,11 +174,11 @@
174174
#endif
175175
176176
x = y = 0;
177177
cnt = nContext;
178178
while( x<nA || y<nB ){
179
- int t1, t2;
179
+ int t1=0, t2=0;
180180
if( (t1 = M(x+1,y))<0 || (t2 = M(x,y+1))<0 ){
181181
if( cnt>=nContext ){
182182
blob_appendf(pOut, "@@ -%d +%d @@\n",
183183
x-nContext+iStart+2, y-nContext+iStart+2);
184184
for(i=x-nContext+1; i<x; i++){
185185
--- src/diff.c
+++ src/diff.c
@@ -174,11 +174,11 @@
174 #endif
175
176 x = y = 0;
177 cnt = nContext;
178 while( x<nA || y<nB ){
179 int t1, t2;
180 if( (t1 = M(x+1,y))<0 || (t2 = M(x,y+1))<0 ){
181 if( cnt>=nContext ){
182 blob_appendf(pOut, "@@ -%d +%d @@\n",
183 x-nContext+iStart+2, y-nContext+iStart+2);
184 for(i=x-nContext+1; i<x; i++){
185
--- src/diff.c
+++ src/diff.c
@@ -174,11 +174,11 @@
174 #endif
175
176 x = y = 0;
177 cnt = nContext;
178 while( x<nA || y<nB ){
179 int t1=0, t2=0;
180 if( (t1 = M(x+1,y))<0 || (t2 = M(x,y+1))<0 ){
181 if( cnt>=nContext ){
182 blob_appendf(pOut, "@@ -%d +%d @@\n",
183 x-nContext+iStart+2, y-nContext+iStart+2);
184 for(i=x-nContext+1; i<x; i++){
185
+2 -2
--- src/file.c
+++ src/file.c
@@ -189,11 +189,11 @@
189189
blob_set(pOut, zOrigName);
190190
blob_materialize(pOut);
191191
}else{
192192
char zPwd[2000];
193193
if( getcwd(zPwd, sizeof(zPwd)-20)==0 ){
194
- fprintf(stderr, "pwd too big: max %d\n", sizeof(zPwd)-20);
194
+ fprintf(stderr, "pwd too big: max %d\n", (int)sizeof(zPwd)-20);
195195
exit(1);
196196
}
197197
blob_zero(pOut);
198198
blob_appendf(pOut, "%//%/", zPwd, zOrigName);
199199
}
@@ -228,11 +228,11 @@
228228
if( zPath[0]=='/' ){
229229
int i, j;
230230
Blob tmp;
231231
char zPwd[2000];
232232
if( getcwd(zPwd, sizeof(zPwd)-20)==0 ){
233
- fprintf(stderr, "pwd too big: max %d\n", sizeof(zPwd)-20);
233
+ fprintf(stderr, "pwd too big: max %d\n", (int)sizeof(zPwd)-20);
234234
exit(1);
235235
}
236236
for(i=1; zPath[i] && zPwd[i]==zPath[i]; i++){}
237237
if( zPath[i]==0 ){
238238
blob_reset(pOut);
239239
--- src/file.c
+++ src/file.c
@@ -189,11 +189,11 @@
189 blob_set(pOut, zOrigName);
190 blob_materialize(pOut);
191 }else{
192 char zPwd[2000];
193 if( getcwd(zPwd, sizeof(zPwd)-20)==0 ){
194 fprintf(stderr, "pwd too big: max %d\n", sizeof(zPwd)-20);
195 exit(1);
196 }
197 blob_zero(pOut);
198 blob_appendf(pOut, "%//%/", zPwd, zOrigName);
199 }
@@ -228,11 +228,11 @@
228 if( zPath[0]=='/' ){
229 int i, j;
230 Blob tmp;
231 char zPwd[2000];
232 if( getcwd(zPwd, sizeof(zPwd)-20)==0 ){
233 fprintf(stderr, "pwd too big: max %d\n", sizeof(zPwd)-20);
234 exit(1);
235 }
236 for(i=1; zPath[i] && zPwd[i]==zPath[i]; i++){}
237 if( zPath[i]==0 ){
238 blob_reset(pOut);
239
--- src/file.c
+++ src/file.c
@@ -189,11 +189,11 @@
189 blob_set(pOut, zOrigName);
190 blob_materialize(pOut);
191 }else{
192 char zPwd[2000];
193 if( getcwd(zPwd, sizeof(zPwd)-20)==0 ){
194 fprintf(stderr, "pwd too big: max %d\n", (int)sizeof(zPwd)-20);
195 exit(1);
196 }
197 blob_zero(pOut);
198 blob_appendf(pOut, "%//%/", zPwd, zOrigName);
199 }
@@ -228,11 +228,11 @@
228 if( zPath[0]=='/' ){
229 int i, j;
230 Blob tmp;
231 char zPwd[2000];
232 if( getcwd(zPwd, sizeof(zPwd)-20)==0 ){
233 fprintf(stderr, "pwd too big: max %d\n", (int)sizeof(zPwd)-20);
234 exit(1);
235 }
236 for(i=1; zPath[i] && zPwd[i]==zPath[i]; i++){}
237 if( zPath[i]==0 ){
238 blob_reset(pOut);
239
+2
--- src/http.c
+++ src/http.c
@@ -121,10 +121,11 @@
121121
signal(SIGPIPE, SIG_IGN);
122122
#endif
123123
return 0;
124124
}
125125
126
+#ifdef __MINGW32__
126127
/*
127128
** Read the socket until a newline '\n' is found. Return the number
128129
** of characters read. pSockId contains the socket handel. pOut
129130
** contains a pointer to the buffer to write to. pOutSize contains
130131
** the maximum size of the line that pOut can handle.
@@ -167,10 +168,11 @@
167168
}
168169
blob_append(pBlob, rbuf, read);
169170
}
170171
return blob_size(pBlob);
171172
}
173
+#endif
172174
173175
/*
174176
** Make a single attempt to talk to the server. Return TRUE on success
175177
** and FALSE on a failure.
176178
**
177179
--- src/http.c
+++ src/http.c
@@ -121,10 +121,11 @@
121 signal(SIGPIPE, SIG_IGN);
122 #endif
123 return 0;
124 }
125
 
126 /*
127 ** Read the socket until a newline '\n' is found. Return the number
128 ** of characters read. pSockId contains the socket handel. pOut
129 ** contains a pointer to the buffer to write to. pOutSize contains
130 ** the maximum size of the line that pOut can handle.
@@ -167,10 +168,11 @@
167 }
168 blob_append(pBlob, rbuf, read);
169 }
170 return blob_size(pBlob);
171 }
 
172
173 /*
174 ** Make a single attempt to talk to the server. Return TRUE on success
175 ** and FALSE on a failure.
176 **
177
--- src/http.c
+++ src/http.c
@@ -121,10 +121,11 @@
121 signal(SIGPIPE, SIG_IGN);
122 #endif
123 return 0;
124 }
125
126 #ifdef __MINGW32__
127 /*
128 ** Read the socket until a newline '\n' is found. Return the number
129 ** of characters read. pSockId contains the socket handel. pOut
130 ** contains a pointer to the buffer to write to. pOutSize contains
131 ** the maximum size of the line that pOut can handle.
@@ -167,10 +168,11 @@
168 }
169 blob_append(pBlob, rbuf, read);
170 }
171 return blob_size(pBlob);
172 }
173 #endif
174
175 /*
176 ** Make a single attempt to talk to the server. Return TRUE on success
177 ** and FALSE on a failure.
178 **
179
--- src/manifest.c
+++ src/manifest.c
@@ -572,10 +572,13 @@
572572
tid = uuid_to_rid(m.aTag[i].zUuid, 1);
573573
switch( m.aTag[i].zName[0] ){
574574
case '+': type = 1; break;
575575
case '*': type = 2; break;
576576
case '-': type = 0; break;
577
+ default:
578
+ fossil_fatal("unknown tag type in manifest: %s", m.aTag);
579
+ return 0;
577580
}
578581
tag_insert(&m.aTag[i].zName[1], type, m.aTag[i].zValue,
579582
rid, m.rDate, tid);
580583
}
581584
if( parentid ){
582585
--- src/manifest.c
+++ src/manifest.c
@@ -572,10 +572,13 @@
572 tid = uuid_to_rid(m.aTag[i].zUuid, 1);
573 switch( m.aTag[i].zName[0] ){
574 case '+': type = 1; break;
575 case '*': type = 2; break;
576 case '-': type = 0; break;
 
 
 
577 }
578 tag_insert(&m.aTag[i].zName[1], type, m.aTag[i].zValue,
579 rid, m.rDate, tid);
580 }
581 if( parentid ){
582
--- src/manifest.c
+++ src/manifest.c
@@ -572,10 +572,13 @@
572 tid = uuid_to_rid(m.aTag[i].zUuid, 1);
573 switch( m.aTag[i].zName[0] ){
574 case '+': type = 1; break;
575 case '*': type = 2; break;
576 case '-': type = 0; break;
577 default:
578 fossil_fatal("unknown tag type in manifest: %s", m.aTag);
579 return 0;
580 }
581 tag_insert(&m.aTag[i].zName[1], type, m.aTag[i].zValue,
582 rid, m.rDate, tid);
583 }
584 if( parentid ){
585
+2
--- src/name.c
+++ src/name.c
@@ -99,10 +99,12 @@
9999
rc = 1;
100100
}else{
101101
rc = 0;
102102
}
103103
}
104
+ }else{
105
+ rc = 0;
104106
}
105107
return rc;
106108
}
107109
108110
/*
109111
--- src/name.c
+++ src/name.c
@@ -99,10 +99,12 @@
99 rc = 1;
100 }else{
101 rc = 0;
102 }
103 }
 
 
104 }
105 return rc;
106 }
107
108 /*
109
--- src/name.c
+++ src/name.c
@@ -99,10 +99,12 @@
99 rc = 1;
100 }else{
101 rc = 0;
102 }
103 }
104 }else{
105 rc = 0;
106 }
107 return rc;
108 }
109
110 /*
111
+1 -1
--- src/pivot.c
+++ src/pivot.c
@@ -82,11 +82,11 @@
8282
** the secondaries. Return its rid. Return 0 if no common ancestor
8383
** can be found.
8484
*/
8585
int pivot_find(void){
8686
Stmt q1, q2, u1, i1;
87
- int rid;
87
+ int rid = 0;
8888
8989
/* aqueue must contain at least one primary and one other. Otherwise
9090
** we abort early
9191
*/
9292
if( db_int(0, "SELECT count(distinct src) FROM aqueue")<2 ){
9393
--- src/pivot.c
+++ src/pivot.c
@@ -82,11 +82,11 @@
82 ** the secondaries. Return its rid. Return 0 if no common ancestor
83 ** can be found.
84 */
85 int pivot_find(void){
86 Stmt q1, q2, u1, i1;
87 int rid;
88
89 /* aqueue must contain at least one primary and one other. Otherwise
90 ** we abort early
91 */
92 if( db_int(0, "SELECT count(distinct src) FROM aqueue")<2 ){
93
--- src/pivot.c
+++ src/pivot.c
@@ -82,11 +82,11 @@
82 ** the secondaries. Return its rid. Return 0 if no common ancestor
83 ** can be found.
84 */
85 int pivot_find(void){
86 Stmt q1, q2, u1, i1;
87 int rid = 0;
88
89 /* aqueue must contain at least one primary and one other. Otherwise
90 ** we abort early
91 */
92 if( db_int(0, "SELECT count(distinct src) FROM aqueue")<2 ){
93
+3 -1
--- src/tag.c
+++ src/tag.c
@@ -232,11 +232,13 @@
232232
zTag = g.argv[2];
233233
switch( zTag[0] ){
234234
case '+': tagtype = 1; break;
235235
case '*': tagtype = 2; break;
236236
case '-': tagtype = 0; break;
237
- default: fossil_fatal("tag should begin with '+', '*', or '-'");
237
+ default:
238
+ fossil_fatal("tag should begin with '+', '*', or '-'");
239
+ return;
238240
}
239241
rid = name_to_rid(g.argv[3]);
240242
if( rid==0 ){
241243
fossil_fatal("no such object: %s", g.argv[3]);
242244
}
243245
--- src/tag.c
+++ src/tag.c
@@ -232,11 +232,13 @@
232 zTag = g.argv[2];
233 switch( zTag[0] ){
234 case '+': tagtype = 1; break;
235 case '*': tagtype = 2; break;
236 case '-': tagtype = 0; break;
237 default: fossil_fatal("tag should begin with '+', '*', or '-'");
 
 
238 }
239 rid = name_to_rid(g.argv[3]);
240 if( rid==0 ){
241 fossil_fatal("no such object: %s", g.argv[3]);
242 }
243
--- src/tag.c
+++ src/tag.c
@@ -232,11 +232,13 @@
232 zTag = g.argv[2];
233 switch( zTag[0] ){
234 case '+': tagtype = 1; break;
235 case '*': tagtype = 2; break;
236 case '-': tagtype = 0; break;
237 default:
238 fossil_fatal("tag should begin with '+', '*', or '-'");
239 return;
240 }
241 rid = name_to_rid(g.argv[3]);
242 if( rid==0 ){
243 fossil_fatal("no such object: %s", g.argv[3]);
244 }
245
+3 -1
--- src/tag.c
+++ src/tag.c
@@ -232,11 +232,13 @@
232232
zTag = g.argv[2];
233233
switch( zTag[0] ){
234234
case '+': tagtype = 1; break;
235235
case '*': tagtype = 2; break;
236236
case '-': tagtype = 0; break;
237
- default: fossil_fatal("tag should begin with '+', '*', or '-'");
237
+ default:
238
+ fossil_fatal("tag should begin with '+', '*', or '-'");
239
+ return;
238240
}
239241
rid = name_to_rid(g.argv[3]);
240242
if( rid==0 ){
241243
fossil_fatal("no such object: %s", g.argv[3]);
242244
}
243245
--- src/tag.c
+++ src/tag.c
@@ -232,11 +232,13 @@
232 zTag = g.argv[2];
233 switch( zTag[0] ){
234 case '+': tagtype = 1; break;
235 case '*': tagtype = 2; break;
236 case '-': tagtype = 0; break;
237 default: fossil_fatal("tag should begin with '+', '*', or '-'");
 
 
238 }
239 rid = name_to_rid(g.argv[3]);
240 if( rid==0 ){
241 fossil_fatal("no such object: %s", g.argv[3]);
242 }
243
--- src/tag.c
+++ src/tag.c
@@ -232,11 +232,13 @@
232 zTag = g.argv[2];
233 switch( zTag[0] ){
234 case '+': tagtype = 1; break;
235 case '*': tagtype = 2; break;
236 case '-': tagtype = 0; break;
237 default:
238 fossil_fatal("tag should begin with '+', '*', or '-'");
239 return;
240 }
241 rid = name_to_rid(g.argv[3]);
242 if( rid==0 ){
243 fossil_fatal("no such object: %s", g.argv[3]);
244 }
245
+1 -1
--- src/timeline.c
+++ src/timeline.c
@@ -396,11 +396,11 @@
396396
*/
397397
void print_timeline(Stmt *q, int mxLine){
398398
int nLine = 0;
399399
char zPrevDate[20];
400400
char *delims;
401
- const char *zCurrentUuid;
401
+ const char *zCurrentUuid=0;
402402
Stmt currentQ;
403403
int rid = db_lget_int("checkout", 0);
404404
zPrevDate[0] = 0;
405405
406406
db_prepare(&currentQ,
407407
--- src/timeline.c
+++ src/timeline.c
@@ -396,11 +396,11 @@
396 */
397 void print_timeline(Stmt *q, int mxLine){
398 int nLine = 0;
399 char zPrevDate[20];
400 char *delims;
401 const char *zCurrentUuid;
402 Stmt currentQ;
403 int rid = db_lget_int("checkout", 0);
404 zPrevDate[0] = 0;
405
406 db_prepare(&currentQ,
407
--- src/timeline.c
+++ src/timeline.c
@@ -396,11 +396,11 @@
396 */
397 void print_timeline(Stmt *q, int mxLine){
398 int nLine = 0;
399 char zPrevDate[20];
400 char *delims;
401 const char *zCurrentUuid=0;
402 Stmt currentQ;
403 int rid = db_lget_int("checkout", 0);
404 zPrevDate[0] = 0;
405
406 db_prepare(&currentQ,
407

Keyboard Shortcuts

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