Fossil SCM

Fix harmless compiler warnings.

drh 2018-06-22 01:28 UTC email-alerts
Commit 5fde17bbbc2cba69d3f8e2af67bf12890d9a7a13b8f19c8b2fb60445ce810b58
3 files changed +1 -4 +3 -11 -3
+1 -4
--- src/db.c
+++ src/db.c
@@ -910,23 +910,20 @@
910910
const unsigned char *zIn = sqlite3_value_text(argv[0]);
911911
int nIn = sqlite3_value_bytes(argv[0]);
912912
unsigned char *zOut;
913913
if( zIn==0 ) return;
914914
if( nIn&1 ) return;
915
- if( !validate16(zIn, nIn) ) return;
915
+ if( !validate16((const char*)zIn, nIn) ) return;
916916
zOut = sqlite3_malloc64( nIn/2 );
917917
if( zOut==0 ){
918918
sqlite3_result_error_nomem(context);
919919
return;
920920
}
921921
decode16(zIn, zOut, nIn);
922922
sqlite3_result_blob(context, zOut, nIn/2, sqlite3_free);
923923
}
924924
925
-/*
926
-**
927
-
928925
/*
929926
** Register the SQL functions that are useful both to the internal
930927
** representation and to the "fossil sql" command.
931928
*/
932929
void db_add_aux_functions(sqlite3 *db){
933930
--- src/db.c
+++ src/db.c
@@ -910,23 +910,20 @@
910 const unsigned char *zIn = sqlite3_value_text(argv[0]);
911 int nIn = sqlite3_value_bytes(argv[0]);
912 unsigned char *zOut;
913 if( zIn==0 ) return;
914 if( nIn&1 ) return;
915 if( !validate16(zIn, nIn) ) return;
916 zOut = sqlite3_malloc64( nIn/2 );
917 if( zOut==0 ){
918 sqlite3_result_error_nomem(context);
919 return;
920 }
921 decode16(zIn, zOut, nIn);
922 sqlite3_result_blob(context, zOut, nIn/2, sqlite3_free);
923 }
924
925 /*
926 **
927
928 /*
929 ** Register the SQL functions that are useful both to the internal
930 ** representation and to the "fossil sql" command.
931 */
932 void db_add_aux_functions(sqlite3 *db){
933
--- src/db.c
+++ src/db.c
@@ -910,23 +910,20 @@
910 const unsigned char *zIn = sqlite3_value_text(argv[0]);
911 int nIn = sqlite3_value_bytes(argv[0]);
912 unsigned char *zOut;
913 if( zIn==0 ) return;
914 if( nIn&1 ) return;
915 if( !validate16((const char*)zIn, nIn) ) return;
916 zOut = sqlite3_malloc64( nIn/2 );
917 if( zOut==0 ){
918 sqlite3_result_error_nomem(context);
919 return;
920 }
921 decode16(zIn, zOut, nIn);
922 sqlite3_result_blob(context, zOut, nIn/2, sqlite3_free);
923 }
924
 
 
 
925 /*
926 ** Register the SQL functions that are useful both to the internal
927 ** representation and to the "fossil sql" command.
928 */
929 void db_add_aux_functions(sqlite3 *db){
930
+3 -11
--- src/email.c
+++ src/email.c
@@ -541,11 +541,10 @@
541541
blob_zero(&body);
542542
blob_zero(&prompt);
543543
}
544544
else if( strncmp(zCmd, "settings", nCmd)==0 ){
545545
int isGlobal = find_option("global",0,0)!=0;
546
- int i;
547546
int nSetting;
548547
const Setting *pSetting = setting_info(&nSetting);
549548
db_open_config(1, 0);
550549
verify_all_options();
551550
if( g.argc!=3 && g.argc!=5 ) usage("setting [NAME VALUE]");
@@ -667,11 +666,11 @@
667666
*/
668667
void subscribe_page(void){
669668
int needCaptcha;
670669
unsigned int uSeed;
671670
const char *zDecoded;
672
- char *zCaptcha;
671
+ char *zCaptcha = 0;
673672
char *zErr = 0;
674673
int eErr = 0;
675674
676675
login_check_credentials();
677676
if( !g.perm.EmailAlert ){
@@ -840,15 +839,12 @@
840839
Stmt q;
841840
int sa, sc, st, sw;
842841
int sdigest, sdonotcall, sverified;
843842
const char *ssub;
844843
const char *semail;
845
- const char *sctime;
846
- const char *smtime;
847844
const char *smip;
848845
const char *suname;
849
- int i;
850846
int eErr = 0;
851847
char *zErr = 0;
852848
853849
login_check_credentials();
854850
if( !g.perm.EmailAlert ){
@@ -917,12 +913,10 @@
917913
" semail,"
918914
" sverified,"
919915
" sdonotcall,"
920916
" sdigest,"
921917
" ssub,"
922
- " datetime(sctime),"
923
- " datetime(smtime),"
924918
" smip,"
925919
" suname"
926920
" FROM subscriber WHERE subscriberCode=hextoblob(%Q)", zName);
927921
if( db_step(&q)!=SQLITE_ROW ){
928922
db_finalize(&q);
@@ -937,14 +931,12 @@
937931
ssub = db_column_text(&q, 4);
938932
sa = strchr(ssub,'a')!=0;
939933
sc = strchr(ssub,'c')!=0;
940934
st = strchr(ssub,'t')!=0;
941935
sw = strchr(ssub,'w')!=0;
942
- sctime = db_column_text(&q, 5);
943
- smtime = db_column_text(&q, 6);
944
- smip = db_column_text(&q, 7);
945
- suname = db_column_text(&q, 8);
936
+ smip = db_column_text(&q, 5);
937
+ suname = db_column_text(&q, 6);
946938
if( !g.perm.Admin && !sverified ){
947939
db_multi_exec(
948940
"UPDATE subscriber SET sverified=1 WHERE subscriberCode=hextoblob(%Q)",
949941
zName);
950942
@ <h1>Your email alert subscription has been verified!</h1>
951943
--- src/email.c
+++ src/email.c
@@ -541,11 +541,10 @@
541 blob_zero(&body);
542 blob_zero(&prompt);
543 }
544 else if( strncmp(zCmd, "settings", nCmd)==0 ){
545 int isGlobal = find_option("global",0,0)!=0;
546 int i;
547 int nSetting;
548 const Setting *pSetting = setting_info(&nSetting);
549 db_open_config(1, 0);
550 verify_all_options();
551 if( g.argc!=3 && g.argc!=5 ) usage("setting [NAME VALUE]");
@@ -667,11 +666,11 @@
667 */
668 void subscribe_page(void){
669 int needCaptcha;
670 unsigned int uSeed;
671 const char *zDecoded;
672 char *zCaptcha;
673 char *zErr = 0;
674 int eErr = 0;
675
676 login_check_credentials();
677 if( !g.perm.EmailAlert ){
@@ -840,15 +839,12 @@
840 Stmt q;
841 int sa, sc, st, sw;
842 int sdigest, sdonotcall, sverified;
843 const char *ssub;
844 const char *semail;
845 const char *sctime;
846 const char *smtime;
847 const char *smip;
848 const char *suname;
849 int i;
850 int eErr = 0;
851 char *zErr = 0;
852
853 login_check_credentials();
854 if( !g.perm.EmailAlert ){
@@ -917,12 +913,10 @@
917 " semail,"
918 " sverified,"
919 " sdonotcall,"
920 " sdigest,"
921 " ssub,"
922 " datetime(sctime),"
923 " datetime(smtime),"
924 " smip,"
925 " suname"
926 " FROM subscriber WHERE subscriberCode=hextoblob(%Q)", zName);
927 if( db_step(&q)!=SQLITE_ROW ){
928 db_finalize(&q);
@@ -937,14 +931,12 @@
937 ssub = db_column_text(&q, 4);
938 sa = strchr(ssub,'a')!=0;
939 sc = strchr(ssub,'c')!=0;
940 st = strchr(ssub,'t')!=0;
941 sw = strchr(ssub,'w')!=0;
942 sctime = db_column_text(&q, 5);
943 smtime = db_column_text(&q, 6);
944 smip = db_column_text(&q, 7);
945 suname = db_column_text(&q, 8);
946 if( !g.perm.Admin && !sverified ){
947 db_multi_exec(
948 "UPDATE subscriber SET sverified=1 WHERE subscriberCode=hextoblob(%Q)",
949 zName);
950 @ <h1>Your email alert subscription has been verified!</h1>
951
--- src/email.c
+++ src/email.c
@@ -541,11 +541,10 @@
541 blob_zero(&body);
542 blob_zero(&prompt);
543 }
544 else if( strncmp(zCmd, "settings", nCmd)==0 ){
545 int isGlobal = find_option("global",0,0)!=0;
 
546 int nSetting;
547 const Setting *pSetting = setting_info(&nSetting);
548 db_open_config(1, 0);
549 verify_all_options();
550 if( g.argc!=3 && g.argc!=5 ) usage("setting [NAME VALUE]");
@@ -667,11 +666,11 @@
666 */
667 void subscribe_page(void){
668 int needCaptcha;
669 unsigned int uSeed;
670 const char *zDecoded;
671 char *zCaptcha = 0;
672 char *zErr = 0;
673 int eErr = 0;
674
675 login_check_credentials();
676 if( !g.perm.EmailAlert ){
@@ -840,15 +839,12 @@
839 Stmt q;
840 int sa, sc, st, sw;
841 int sdigest, sdonotcall, sverified;
842 const char *ssub;
843 const char *semail;
 
 
844 const char *smip;
845 const char *suname;
 
846 int eErr = 0;
847 char *zErr = 0;
848
849 login_check_credentials();
850 if( !g.perm.EmailAlert ){
@@ -917,12 +913,10 @@
913 " semail,"
914 " sverified,"
915 " sdonotcall,"
916 " sdigest,"
917 " ssub,"
 
 
918 " smip,"
919 " suname"
920 " FROM subscriber WHERE subscriberCode=hextoblob(%Q)", zName);
921 if( db_step(&q)!=SQLITE_ROW ){
922 db_finalize(&q);
@@ -937,14 +931,12 @@
931 ssub = db_column_text(&q, 4);
932 sa = strchr(ssub,'a')!=0;
933 sc = strchr(ssub,'c')!=0;
934 st = strchr(ssub,'t')!=0;
935 sw = strchr(ssub,'w')!=0;
936 smip = db_column_text(&q, 5);
937 suname = db_column_text(&q, 6);
 
 
938 if( !g.perm.Admin && !sverified ){
939 db_multi_exec(
940 "UPDATE subscriber SET sverified=1 WHERE subscriberCode=hextoblob(%Q)",
941 zName);
942 @ <h1>Your email alert subscription has been verified!</h1>
943
--- src/forum.c
+++ src/forum.c
@@ -101,13 +101,11 @@
101101
itemId
102102
);
103103
while( db_step(&q)==SQLITE_ROW ){
104104
int id = db_column_int(&q, 0);
105105
const char *zUser = db_column_text(&q, 1);
106
- const char *zStat = db_column_text(&q, 2);
107106
const char *zMime = db_column_text(&q, 3);
108
- const char *zIp = db_column_text(&q, 4);
109107
int iDepth = db_column_int(&q, 7);
110108
double rMTime = db_column_double(&q, 8);
111109
char *zAge = db_timespan_name(rNow - rMTime);
112110
Blob body;
113111
@ <!-- Forum post %d(id) -->
@@ -257,11 +255,10 @@
257255
void forum_edit_page(void){
258256
int itemId;
259257
int parentId;
260258
char *zErr = 0;
261259
login_check_credentials();
262
- const char *zBody;
263260
const char *zMime;
264261
const char *zSub;
265262
if( !g.perm.WrForum ){ login_needed(g.anon.WrForum); return; }
266263
forum_verify_schema();
267264
itemId = atoi(PD("item","0"));
268265
--- src/forum.c
+++ src/forum.c
@@ -101,13 +101,11 @@
101 itemId
102 );
103 while( db_step(&q)==SQLITE_ROW ){
104 int id = db_column_int(&q, 0);
105 const char *zUser = db_column_text(&q, 1);
106 const char *zStat = db_column_text(&q, 2);
107 const char *zMime = db_column_text(&q, 3);
108 const char *zIp = db_column_text(&q, 4);
109 int iDepth = db_column_int(&q, 7);
110 double rMTime = db_column_double(&q, 8);
111 char *zAge = db_timespan_name(rNow - rMTime);
112 Blob body;
113 @ <!-- Forum post %d(id) -->
@@ -257,11 +255,10 @@
257 void forum_edit_page(void){
258 int itemId;
259 int parentId;
260 char *zErr = 0;
261 login_check_credentials();
262 const char *zBody;
263 const char *zMime;
264 const char *zSub;
265 if( !g.perm.WrForum ){ login_needed(g.anon.WrForum); return; }
266 forum_verify_schema();
267 itemId = atoi(PD("item","0"));
268
--- src/forum.c
+++ src/forum.c
@@ -101,13 +101,11 @@
101 itemId
102 );
103 while( db_step(&q)==SQLITE_ROW ){
104 int id = db_column_int(&q, 0);
105 const char *zUser = db_column_text(&q, 1);
 
106 const char *zMime = db_column_text(&q, 3);
 
107 int iDepth = db_column_int(&q, 7);
108 double rMTime = db_column_double(&q, 8);
109 char *zAge = db_timespan_name(rNow - rMTime);
110 Blob body;
111 @ <!-- Forum post %d(id) -->
@@ -257,11 +255,10 @@
255 void forum_edit_page(void){
256 int itemId;
257 int parentId;
258 char *zErr = 0;
259 login_check_credentials();
 
260 const char *zMime;
261 const char *zSub;
262 if( !g.perm.WrForum ){ login_needed(g.anon.WrForum); return; }
263 forum_verify_schema();
264 itemId = atoi(PD("item","0"));
265

Keyboard Shortcuts

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