Fossil SCM

More compiler warning fixes.

drh 2014-12-01 21:29 UTC DBP-workflow
Commit 155c8b64ac314edb1ade8bb987a98f6dde74018c
+1 -1
--- src/db.c
+++ src/db.c
@@ -765,11 +765,11 @@
765765
arg = (const char*)sqlite3_value_text(argv[0]);
766766
if(!arg){
767767
sqlite3_result_error(context, "Expecting a STRING argument", -1);
768768
}else{
769769
int rid;
770
- type = (2==argc) ? sqlite3_value_text(argv[1]) : 0;
770
+ type = (2==argc) ? (const char*)sqlite3_value_text(argv[1]) : 0;
771771
if(!type) type = "ci";
772772
rid = symbolic_name_to_rid( arg, type );
773773
if(rid<0){
774774
sqlite3_result_error(context, "Symbolic name is ambiguous.", -1);
775775
}else if(0==rid){
776776
--- src/db.c
+++ src/db.c
@@ -765,11 +765,11 @@
765 arg = (const char*)sqlite3_value_text(argv[0]);
766 if(!arg){
767 sqlite3_result_error(context, "Expecting a STRING argument", -1);
768 }else{
769 int rid;
770 type = (2==argc) ? sqlite3_value_text(argv[1]) : 0;
771 if(!type) type = "ci";
772 rid = symbolic_name_to_rid( arg, type );
773 if(rid<0){
774 sqlite3_result_error(context, "Symbolic name is ambiguous.", -1);
775 }else if(0==rid){
776
--- src/db.c
+++ src/db.c
@@ -765,11 +765,11 @@
765 arg = (const char*)sqlite3_value_text(argv[0]);
766 if(!arg){
767 sqlite3_result_error(context, "Expecting a STRING argument", -1);
768 }else{
769 int rid;
770 type = (2==argc) ? (const char*)sqlite3_value_text(argv[1]) : 0;
771 if(!type) type = "ci";
772 rid = symbolic_name_to_rid( arg, type );
773 if(rid<0){
774 sqlite3_result_error(context, "Symbolic name is ambiguous.", -1);
775 }else if(0==rid){
776
-3
--- src/foci.c
+++ src/foci.c
@@ -104,14 +104,11 @@
104104
105105
/*
106106
** Open a new focivfs cursor.
107107
*/
108108
static int fociOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){
109
- FociTable *pTab = (FociTable *)pVTab;
110109
FociCursor *pCsr;
111
- int rc;
112
-
113110
pCsr = (FociCursor *)sqlite3_malloc(sizeof(FociCursor));
114111
memset(pCsr, 0, sizeof(FociCursor));
115112
pCsr->base.pVtab = pVTab;
116113
*ppCursor = (sqlite3_vtab_cursor *)pCsr;
117114
return SQLITE_OK;
118115
--- src/foci.c
+++ src/foci.c
@@ -104,14 +104,11 @@
104
105 /*
106 ** Open a new focivfs cursor.
107 */
108 static int fociOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){
109 FociTable *pTab = (FociTable *)pVTab;
110 FociCursor *pCsr;
111 int rc;
112
113 pCsr = (FociCursor *)sqlite3_malloc(sizeof(FociCursor));
114 memset(pCsr, 0, sizeof(FociCursor));
115 pCsr->base.pVtab = pVTab;
116 *ppCursor = (sqlite3_vtab_cursor *)pCsr;
117 return SQLITE_OK;
118
--- src/foci.c
+++ src/foci.c
@@ -104,14 +104,11 @@
104
105 /*
106 ** Open a new focivfs cursor.
107 */
108 static int fociOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){
 
109 FociCursor *pCsr;
 
 
110 pCsr = (FociCursor *)sqlite3_malloc(sizeof(FociCursor));
111 memset(pCsr, 0, sizeof(FociCursor));
112 pCsr->base.pVtab = pVTab;
113 *ppCursor = (sqlite3_vtab_cursor *)pCsr;
114 return SQLITE_OK;
115
+8 -2
--- src/mkversion.c
+++ src/mkversion.c
@@ -17,11 +17,14 @@
1717
char b[1000];
1818
char vx[1000];
1919
memset(b,0,sizeof(b));
2020
memset(vx,0,sizeof(vx));
2121
u = fopen(argv[1],"r");
22
- fgets(b, sizeof(b)-1,u);
22
+ if( fgets(b, sizeof(b)-1,u)==0 ){
23
+ fprintf(stderr, "malformed manifest.uuid file: %s\n", argv[1]);
24
+ exit(1);
25
+ }
2326
fclose(u);
2427
for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
2528
*z = 0;
2629
printf("#define MANIFEST_UUID \"%s\"\n",b);
2730
printf("#define MANIFEST_VERSION \"[%10.10s]\"\n",b);
@@ -32,11 +35,14 @@
3235
printf("#define MANIFEST_YEAR \"%.4s\"\n",b+2);
3336
}
3437
}
3538
fclose(m);
3639
v = fopen(argv[3],"r");
37
- fgets(b, sizeof(b)-1,v);
40
+ if( fgets(b, sizeof(b)-1,v)==0 ){
41
+ fprintf(stderr, "malformed VERSION file: %s\n", argv[3]);
42
+ exit(1);
43
+ }
3844
fclose(v);
3945
for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
4046
*z = 0;
4147
printf("#define RELEASE_VERSION \"%s\"\n", b);
4248
x=0;
4349
--- src/mkversion.c
+++ src/mkversion.c
@@ -17,11 +17,14 @@
17 char b[1000];
18 char vx[1000];
19 memset(b,0,sizeof(b));
20 memset(vx,0,sizeof(vx));
21 u = fopen(argv[1],"r");
22 fgets(b, sizeof(b)-1,u);
 
 
 
23 fclose(u);
24 for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
25 *z = 0;
26 printf("#define MANIFEST_UUID \"%s\"\n",b);
27 printf("#define MANIFEST_VERSION \"[%10.10s]\"\n",b);
@@ -32,11 +35,14 @@
32 printf("#define MANIFEST_YEAR \"%.4s\"\n",b+2);
33 }
34 }
35 fclose(m);
36 v = fopen(argv[3],"r");
37 fgets(b, sizeof(b)-1,v);
 
 
 
38 fclose(v);
39 for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
40 *z = 0;
41 printf("#define RELEASE_VERSION \"%s\"\n", b);
42 x=0;
43
--- src/mkversion.c
+++ src/mkversion.c
@@ -17,11 +17,14 @@
17 char b[1000];
18 char vx[1000];
19 memset(b,0,sizeof(b));
20 memset(vx,0,sizeof(vx));
21 u = fopen(argv[1],"r");
22 if( fgets(b, sizeof(b)-1,u)==0 ){
23 fprintf(stderr, "malformed manifest.uuid file: %s\n", argv[1]);
24 exit(1);
25 }
26 fclose(u);
27 for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
28 *z = 0;
29 printf("#define MANIFEST_UUID \"%s\"\n",b);
30 printf("#define MANIFEST_VERSION \"[%10.10s]\"\n",b);
@@ -32,11 +35,14 @@
35 printf("#define MANIFEST_YEAR \"%.4s\"\n",b+2);
36 }
37 }
38 fclose(m);
39 v = fopen(argv[3],"r");
40 if( fgets(b, sizeof(b)-1,v)==0 ){
41 fprintf(stderr, "malformed VERSION file: %s\n", argv[3]);
42 exit(1);
43 }
44 fclose(v);
45 for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
46 *z = 0;
47 printf("#define RELEASE_VERSION \"%s\"\n", b);
48 x=0;
49
--- src/publish.c
+++ src/publish.c
@@ -36,12 +36,10 @@
3636
** OPTIONS:
3737
** --all Show all artifacts, not just checkins
3838
*/
3939
void unpublished_cmd(void){
4040
int bAll = find_option("all",0,0)!=0;
41
- const char *zCols;
42
- int n = 0;
4341
4442
db_find_and_open_repository(0,0);
4543
verify_all_options();
4644
if( bAll ){
4745
describe_artifacts_to_stdout("IN private", 0);
4846
--- src/publish.c
+++ src/publish.c
@@ -36,12 +36,10 @@
36 ** OPTIONS:
37 ** --all Show all artifacts, not just checkins
38 */
39 void unpublished_cmd(void){
40 int bAll = find_option("all",0,0)!=0;
41 const char *zCols;
42 int n = 0;
43
44 db_find_and_open_repository(0,0);
45 verify_all_options();
46 if( bAll ){
47 describe_artifacts_to_stdout("IN private", 0);
48
--- src/publish.c
+++ src/publish.c
@@ -36,12 +36,10 @@
36 ** OPTIONS:
37 ** --all Show all artifacts, not just checkins
38 */
39 void unpublished_cmd(void){
40 int bAll = find_option("all",0,0)!=0;
 
 
41
42 db_find_and_open_repository(0,0);
43 verify_all_options();
44 if( bAll ){
45 describe_artifacts_to_stdout("IN private", 0);
46
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -118,10 +118,11 @@
118118
sqlcmd_content, 0, 0);
119119
sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
120120
sqlcmd_compress, 0, 0);
121121
sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0,
122122
sqlcmd_decompress, 0, 0);
123
+ return SQLITE_OK;
123124
}
124125
125126
/*
126127
** This is the "automatic extension" initializer that runs right after
127128
** the connection to the repository database is opened. Set up the
128129
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -118,10 +118,11 @@
118 sqlcmd_content, 0, 0);
119 sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
120 sqlcmd_compress, 0, 0);
121 sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0,
122 sqlcmd_decompress, 0, 0);
 
123 }
124
125 /*
126 ** This is the "automatic extension" initializer that runs right after
127 ** the connection to the repository database is opened. Set up the
128
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -118,10 +118,11 @@
118 sqlcmd_content, 0, 0);
119 sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
120 sqlcmd_compress, 0, 0);
121 sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0,
122 sqlcmd_decompress, 0, 0);
123 return SQLITE_OK;
124 }
125
126 /*
127 ** This is the "automatic extension" initializer that runs right after
128 ** the connection to the repository database is opened. Set up the
129

Keyboard Shortcuts

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