Fossil SCM

Fix 2 (harmless) compiler warnings about unused variables

jan.nijtmans 2018-05-19 06:47 trunk
Commit 961787df0662be13e849054a66101a3a637e971ba64a812ad8c1ad12c9c77fc2
2 files changed +2 -3 +4 -5
+2 -3
--- src/etag.c
+++ src/etag.c
@@ -138,11 +138,11 @@
138138
** Or, if not, it will cause a Last-Modified: header to be included in the
139139
** reply.
140140
*/
141141
void etag_last_modified(sqlite3_int64 mtime){
142142
const char *zIfModifiedSince;
143
- sqlite3_int64 x, exeMtime;
143
+ sqlite3_int64 x;
144144
assert( iEtagMtime==0 ); /* Only call this routine once */
145145
assert( mtime>0 ); /* Only call with a valid mtime */
146146
iEtagMtime = mtime;
147147
148148
/* Check to see the If-Modified-Since constraint is satisfied */
@@ -152,12 +152,11 @@
152152
if( x<=0 || x>mtime ) return;
153153
154154
#if 0
155155
/* If the Fossil executable is more recent than If-Modified-Since,
156156
** go ahead and regenerate the resource. */
157
- exeMtime = file_mtime(g.nameOfExe, ExtFILE);
158
- if( exeMtime>x ) return;
157
+ if( file_mtime(g.nameOfExe, ExtFILE)>x ) return;
159158
#endif
160159
161160
/* If we reach this point, it means that the resource has not changed
162161
** and that we should generate a 304 Not Modified reply */
163162
cgi_reset_content();
164163
--- src/etag.c
+++ src/etag.c
@@ -138,11 +138,11 @@
138 ** Or, if not, it will cause a Last-Modified: header to be included in the
139 ** reply.
140 */
141 void etag_last_modified(sqlite3_int64 mtime){
142 const char *zIfModifiedSince;
143 sqlite3_int64 x, exeMtime;
144 assert( iEtagMtime==0 ); /* Only call this routine once */
145 assert( mtime>0 ); /* Only call with a valid mtime */
146 iEtagMtime = mtime;
147
148 /* Check to see the If-Modified-Since constraint is satisfied */
@@ -152,12 +152,11 @@
152 if( x<=0 || x>mtime ) return;
153
154 #if 0
155 /* If the Fossil executable is more recent than If-Modified-Since,
156 ** go ahead and regenerate the resource. */
157 exeMtime = file_mtime(g.nameOfExe, ExtFILE);
158 if( exeMtime>x ) return;
159 #endif
160
161 /* If we reach this point, it means that the resource has not changed
162 ** and that we should generate a 304 Not Modified reply */
163 cgi_reset_content();
164
--- src/etag.c
+++ src/etag.c
@@ -138,11 +138,11 @@
138 ** Or, if not, it will cause a Last-Modified: header to be included in the
139 ** reply.
140 */
141 void etag_last_modified(sqlite3_int64 mtime){
142 const char *zIfModifiedSince;
143 sqlite3_int64 x;
144 assert( iEtagMtime==0 ); /* Only call this routine once */
145 assert( mtime>0 ); /* Only call with a valid mtime */
146 iEtagMtime = mtime;
147
148 /* Check to see the If-Modified-Since constraint is satisfied */
@@ -152,12 +152,11 @@
152 if( x<=0 || x>mtime ) return;
153
154 #if 0
155 /* If the Fossil executable is more recent than If-Modified-Since,
156 ** go ahead and regenerate the resource. */
157 if( file_mtime(g.nameOfExe, ExtFILE)>x ) return;
 
158 #endif
159
160 /* If we reach this point, it means that the resource has not changed
161 ** and that we should generate a 304 Not Modified reply */
162 cgi_reset_content();
163
+4 -5
--- src/export.c
+++ src/export.c
@@ -787,11 +787,11 @@
787787
"CREATE INDEX topolink_child ON topolink(tchild);\n"
788788
);
789789
790790
/* Find a timewarp instance */
791791
db_prepare(&q1,
792
- "SELECT P.tid, P.tseq, C.tid, C.tseq\n"
792
+ "SELECT P.tseq, C.tid, C.tseq\n"
793793
" FROM toponode P, toponode C, topolink X\n"
794794
" WHERE X.tparent=P.tid\n"
795795
" AND X.tchild=C.tid\n"
796796
" AND P.tseq>=C.tseq;"
797797
);
@@ -800,14 +800,13 @@
800800
db_prepare(&chng,
801801
"UPDATE toponode SET tseq=:tseq WHERE tid=:tid"
802802
);
803803
804804
while( db_step(&q1)==SQLITE_ROW ){
805
- int iParent = db_column_int(&q1, 0);
806
- i64 iParentTime = db_column_int64(&q1, 1);
807
- int iChild = db_column_int(&q1, 2);
808
- i64 iChildTime = db_column_int64(&q1, 3);
805
+ i64 iParentTime = db_column_int64(&q1, 0);
806
+ int iChild = db_column_int(&q1, 1);
807
+ i64 iChildTime = db_column_int64(&q1, 2);
809808
nChange++;
810809
if( nChange>10000 ){
811810
fossil_fatal("failed to fix all timewarps after 100000 attempts");
812811
}
813812
db_reset(&q1);
814813
--- src/export.c
+++ src/export.c
@@ -787,11 +787,11 @@
787 "CREATE INDEX topolink_child ON topolink(tchild);\n"
788 );
789
790 /* Find a timewarp instance */
791 db_prepare(&q1,
792 "SELECT P.tid, P.tseq, C.tid, C.tseq\n"
793 " FROM toponode P, toponode C, topolink X\n"
794 " WHERE X.tparent=P.tid\n"
795 " AND X.tchild=C.tid\n"
796 " AND P.tseq>=C.tseq;"
797 );
@@ -800,14 +800,13 @@
800 db_prepare(&chng,
801 "UPDATE toponode SET tseq=:tseq WHERE tid=:tid"
802 );
803
804 while( db_step(&q1)==SQLITE_ROW ){
805 int iParent = db_column_int(&q1, 0);
806 i64 iParentTime = db_column_int64(&q1, 1);
807 int iChild = db_column_int(&q1, 2);
808 i64 iChildTime = db_column_int64(&q1, 3);
809 nChange++;
810 if( nChange>10000 ){
811 fossil_fatal("failed to fix all timewarps after 100000 attempts");
812 }
813 db_reset(&q1);
814
--- src/export.c
+++ src/export.c
@@ -787,11 +787,11 @@
787 "CREATE INDEX topolink_child ON topolink(tchild);\n"
788 );
789
790 /* Find a timewarp instance */
791 db_prepare(&q1,
792 "SELECT P.tseq, C.tid, C.tseq\n"
793 " FROM toponode P, toponode C, topolink X\n"
794 " WHERE X.tparent=P.tid\n"
795 " AND X.tchild=C.tid\n"
796 " AND P.tseq>=C.tseq;"
797 );
@@ -800,14 +800,13 @@
800 db_prepare(&chng,
801 "UPDATE toponode SET tseq=:tseq WHERE tid=:tid"
802 );
803
804 while( db_step(&q1)==SQLITE_ROW ){
805 i64 iParentTime = db_column_int64(&q1, 0);
806 int iChild = db_column_int(&q1, 1);
807 i64 iChildTime = db_column_int64(&q1, 2);
 
808 nChange++;
809 if( nChange>10000 ){
810 fossil_fatal("failed to fix all timewarps after 100000 attempts");
811 }
812 db_reset(&q1);
813

Keyboard Shortcuts

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