Fossil SCM
More compiler warning fixes.
Commit
155c8b64ac314edb1ade8bb987a98f6dde74018c
Parent
c68b59b1b3974e5…
5 files changed
+1
-1
-3
+8
-2
-2
+1
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -765,11 +765,11 @@ | ||
| 765 | 765 | arg = (const char*)sqlite3_value_text(argv[0]); |
| 766 | 766 | if(!arg){ |
| 767 | 767 | sqlite3_result_error(context, "Expecting a STRING argument", -1); |
| 768 | 768 | }else{ |
| 769 | 769 | int rid; |
| 770 | - type = (2==argc) ? sqlite3_value_text(argv[1]) : 0; | |
| 770 | + type = (2==argc) ? (const char*)sqlite3_value_text(argv[1]) : 0; | |
| 771 | 771 | if(!type) type = "ci"; |
| 772 | 772 | rid = symbolic_name_to_rid( arg, type ); |
| 773 | 773 | if(rid<0){ |
| 774 | 774 | sqlite3_result_error(context, "Symbolic name is ambiguous.", -1); |
| 775 | 775 | }else if(0==rid){ |
| 776 | 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) ? 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 @@ | ||
| 104 | 104 | |
| 105 | 105 | /* |
| 106 | 106 | ** Open a new focivfs cursor. |
| 107 | 107 | */ |
| 108 | 108 | static int fociOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ |
| 109 | - FociTable *pTab = (FociTable *)pVTab; | |
| 110 | 109 | FociCursor *pCsr; |
| 111 | - int rc; | |
| 112 | - | |
| 113 | 110 | pCsr = (FociCursor *)sqlite3_malloc(sizeof(FociCursor)); |
| 114 | 111 | memset(pCsr, 0, sizeof(FociCursor)); |
| 115 | 112 | pCsr->base.pVtab = pVTab; |
| 116 | 113 | *ppCursor = (sqlite3_vtab_cursor *)pCsr; |
| 117 | 114 | return SQLITE_OK; |
| 118 | 115 |
| --- 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 @@ | ||
| 17 | 17 | char b[1000]; |
| 18 | 18 | char vx[1000]; |
| 19 | 19 | memset(b,0,sizeof(b)); |
| 20 | 20 | memset(vx,0,sizeof(vx)); |
| 21 | 21 | 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 | + } | |
| 23 | 26 | fclose(u); |
| 24 | 27 | for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){} |
| 25 | 28 | *z = 0; |
| 26 | 29 | printf("#define MANIFEST_UUID \"%s\"\n",b); |
| 27 | 30 | printf("#define MANIFEST_VERSION \"[%10.10s]\"\n",b); |
| @@ -32,11 +35,14 @@ | ||
| 32 | 35 | printf("#define MANIFEST_YEAR \"%.4s\"\n",b+2); |
| 33 | 36 | } |
| 34 | 37 | } |
| 35 | 38 | fclose(m); |
| 36 | 39 | 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 | + } | |
| 38 | 44 | fclose(v); |
| 39 | 45 | for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){} |
| 40 | 46 | *z = 0; |
| 41 | 47 | printf("#define RELEASE_VERSION \"%s\"\n", b); |
| 42 | 48 | x=0; |
| 43 | 49 |
| --- 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 |
-2
| --- src/publish.c | ||
| +++ src/publish.c | ||
| @@ -36,12 +36,10 @@ | ||
| 36 | 36 | ** OPTIONS: |
| 37 | 37 | ** --all Show all artifacts, not just checkins |
| 38 | 38 | */ |
| 39 | 39 | void unpublished_cmd(void){ |
| 40 | 40 | int bAll = find_option("all",0,0)!=0; |
| 41 | - const char *zCols; | |
| 42 | - int n = 0; | |
| 43 | 41 | |
| 44 | 42 | db_find_and_open_repository(0,0); |
| 45 | 43 | verify_all_options(); |
| 46 | 44 | if( bAll ){ |
| 47 | 45 | describe_artifacts_to_stdout("IN private", 0); |
| 48 | 46 |
| --- 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 |
+1
| --- src/sqlcmd.c | ||
| +++ src/sqlcmd.c | ||
| @@ -118,10 +118,11 @@ | ||
| 118 | 118 | sqlcmd_content, 0, 0); |
| 119 | 119 | sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0, |
| 120 | 120 | sqlcmd_compress, 0, 0); |
| 121 | 121 | sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0, |
| 122 | 122 | sqlcmd_decompress, 0, 0); |
| 123 | + return SQLITE_OK; | |
| 123 | 124 | } |
| 124 | 125 | |
| 125 | 126 | /* |
| 126 | 127 | ** This is the "automatic extension" initializer that runs right after |
| 127 | 128 | ** the connection to the repository database is opened. Set up the |
| 128 | 129 |
| --- 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 |