]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add JSON1 and FTS5 to the set of extensions subject to close compiler warning
authordrh <drh@noemail.net>
Thu, 11 Feb 2016 15:37:18 +0000 (15:37 +0000)
committerdrh <drh@noemail.net>
Thu, 11 Feb 2016 15:37:18 +0000 (15:37 +0000)
analysis.  Fix some warnings in each.   More (harmless) warnings still exist
in FTS5.

FossilOrigin-Name: cfe2eb88b504f5e9b1351022036641b1ac4c3e78

ext/fts5/fts5Int.h
ext/fts5/fts5_buffer.c
ext/fts5/fts5_config.c
ext/misc/json1.c
manifest
manifest.uuid
tool/warnings.sh

index 6318af900f74ded4a6cce49a2c6e6d73ac8054a0..f8afd1c1222ade4006be1dd47c9525d755b60285 100644 (file)
@@ -80,6 +80,12 @@ extern int sqlite3_fts5_may_be_corrupt;
 # define assert_nc(x) assert(x)
 #endif
 
+/* Mark a function parameter as unused, to suppress nuisance compiler
+** warnings. */
+#ifndef UNUSED_PARAM
+# define UNUSED_PARAM(X)  (void)(X)
+#endif
+
 typedef struct Fts5Global Fts5Global;
 typedef struct Fts5Colset Fts5Colset;
 
@@ -345,16 +351,6 @@ struct Fts5IndexIter {
 int sqlite3Fts5IndexOpen(Fts5Config *pConfig, int bCreate, Fts5Index**, char**);
 int sqlite3Fts5IndexClose(Fts5Index *p);
 
-/*
-** for(
-**   sqlite3Fts5IndexQuery(p, "token", 5, 0, 0, &pIter);
-**   0==sqlite3Fts5IterEof(pIter);
-**   sqlite3Fts5IterNext(pIter)
-** ){
-**   i64 iRowid = sqlite3Fts5IterRowid(pIter);
-** }
-*/
-
 /*
 ** Return a simple checksum value based on the arguments.
 */
@@ -396,7 +392,6 @@ int sqlite3Fts5IndexQuery(
 */
 int sqlite3Fts5IterNext(Fts5IndexIter*);
 int sqlite3Fts5IterNextFrom(Fts5IndexIter*, i64 iMatch);
-i64 sqlite3Fts5IterRowid(Fts5IndexIter*);
 
 /*
 ** Close an iterator opened by sqlite3Fts5IndexQuery().
index c552e860eb10b8e1c0bfec18c3b6849d2b189fb7..0098846be961eaa6c778754701cee2a0d6d89320 100644 (file)
@@ -236,7 +236,7 @@ int sqlite3Fts5PoslistWriterAppend(
   Fts5PoslistWriter *pWriter,
   i64 iPos
 ){
-  int rc;
+  int rc = 0;   /* Initialized only to suppress erroneous warning from Clang */
   if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc;
   sqlite3Fts5PoslistSafeAppend(pBuf, &pWriter->iPrev, iPos);
   return SQLITE_OK;
@@ -390,6 +390,3 @@ void sqlite3Fts5TermsetFree(Fts5Termset *p){
     sqlite3_free(p);
   }
 }
-
-
-
index 70b1229edbbe22c27840562ca9a6dc46c6fa34c6..f49cede129cd4d1244f0747d4d6a57f686ed53d1 100644 (file)
@@ -206,7 +206,7 @@ static int fts5ConfigSetEnum(
   const char *zEnum, 
   int *peVal
 ){
-  int nEnum = strlen(zEnum);
+  int nEnum = (int)strlen(zEnum);
   int i;
   int iVal = -1;
 
@@ -943,4 +943,3 @@ int sqlite3Fts5ConfigLoad(Fts5Config *pConfig, int iCookie){
   }
   return rc;
 }
-
index 3c63b6e9469471fd1aa79ac6801850f7b2efaee8..99d299c29c7842a56b9fef9cf166a81b4d29393b 100644 (file)
@@ -31,7 +31,11 @@ SQLITE_EXTENSION_INIT1
 #include <stdlib.h>
 #include <stdarg.h>
 
-#define UNUSED_PARAM(X)  (void)(X)
+/* Mark a function parameter as unused, to suppress nuisance compiler
+** warnings. */
+#ifndef UNUSED_PARAM
+# define UNUSED_PARAM(X)  (void)(X)
+#endif
 
 #ifndef LARGEST_INT64
 # define LARGEST_INT64  (0xffffffff|(((sqlite3_int64)0x7fffffff)<<32))
@@ -1552,6 +1556,7 @@ static void jsonArrayStep(
   sqlite3_value **argv
 ){
   JsonString *pStr;
+  UNUSED_PARAM(argc);
   pStr = (JsonString*)sqlite3_aggregate_context(ctx, sizeof(*pStr));
   if( pStr ){
     if( pStr->zBuf==0 ){
@@ -1597,6 +1602,7 @@ static void jsonObjectStep(
   JsonString *pStr;
   const char *z;
   u32 n;
+  UNUSED_PARAM(argc);
   pStr = (JsonString*)sqlite3_aggregate_context(ctx, sizeof(*pStr));
   if( pStr ){
     if( pStr->zBuf==0 ){
index 3c4770b096a982883630498bc005e740f67bc24e..2416a082a843003e212fca925a75f479bdecbbfe 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C In\sthe\sMSVC\smakefile,\sinclude\sthe\sworking\sdirectory\sso\sthat\sit\scan\spickup\sbuild\sgenerated\sfiles\s(e.g.\ssqlite3.h,\setc).
-D 2016-02-10T21:45:25.033
+C Add\sJSON1\sand\sFTS5\sto\sthe\sset\sof\sextensions\ssubject\sto\sclose\scompiler\swarning\nanalysis.\s\sFix\ssome\swarnings\sin\seach.\s\s\sMore\s(harmless)\swarnings\sstill\sexist\nin\sFTS5.
+D 2016-02-11T15:37:18.370
 F Makefile.in 4e90dc1521879022aa9479268a4cd141d1771142
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 463edfba5c6fccebc61d8c094ccd463a6a55becb
@@ -98,10 +98,10 @@ F ext/fts3/unicode/mkunicode.tcl 95cf7ec186e48d4985e433ff8a1c89090a774252
 F ext/fts3/unicode/parseunicode.tcl da577d1384810fb4e2b209bf3313074353193e95
 F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0
 F ext/fts5/fts5.h ff9c2782e8ed890b0de2f697a8d63971939e70c7
-F ext/fts5/fts5Int.h efb02807dbe5a2bfb0ea592a472d1171cb553d53
+F ext/fts5/fts5Int.h cb495e7cb2d140ab3fc3547750e14d1feeec1ca8
 F ext/fts5/fts5_aux.c b9bcce753ef5b451267b2232f0ca153ddeb3951d
-F ext/fts5/fts5_buffer.c 5142f73defd7d2ad7419f3a8e487681b38b72097
-F ext/fts5/fts5_config.c 0c384ebdd23fd055e2e50a93277b8d59da538238
+F ext/fts5/fts5_buffer.c 4c1502d4c956cd092c89ce4480867f9d8bf325cd
+F ext/fts5/fts5_config.c 35c5173cae4eb17e82164a7f5aeef56a48903079
 F ext/fts5/fts5_expr.c ff5c451a6d025909639ac0f0d0af0cc595b50feb
 F ext/fts5/fts5_hash.c 1b113977296cf4212c6ec667d5e3f2bd18036955
 F ext/fts5/fts5_index.c 28f72130400cb54d179a9a120b7232915e3e7a4e
@@ -206,7 +206,7 @@ F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
 F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
 F ext/misc/fuzzer.c 4c84635c71c26cfa7c2e5848cf49fe2d2cfcd767
 F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c
-F ext/misc/json1.c a27cf1eca6583f9b6e18abab5c2a9a82c4540ca9
+F ext/misc/json1.c b9c88d5c3b6ecd8c731ffdd7f5b3d902857f8c96
 F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
 F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
 F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc
@@ -1425,9 +1425,9 @@ F tool/varint.c 5d94cb5003db9dbbcbcc5df08d66f16071aee003
 F tool/vdbe-compress.tcl 5926c71f9c12d2ab73ef35c29376e756eb68361c
 F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
-F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
+F tool/warnings.sh ef6ebc6fd8d2dc35db3b622015c16a023d4fef4f
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 970881befd5da6cc837c474d6e917de0bf029350
-R 5eb3b947cad1b703762744d4a1125c44
-U mistachkin
-Z 4770d0013fc64e8d84870f88c904e1b8
+P e9e6000bd2f7e0ef85178db2b5b8f20e4cf0093c
+R 203364b475629e5387d880c7b72b1d29
+U drh
+Z 7bc360a50dcd258c28a9003183e0bafc
index 8eebb781612fcfc919d28a65291ef907cd15b5fc..4cf611f7271617188bf4e6ef25701e2fb299a9ae 100644 (file)
@@ -1 +1 @@
-e9e6000bd2f7e0ef85178db2b5b8f20e4cf0093c
\ No newline at end of file
+cfe2eb88b504f5e9b1351022036641b1ac4c3e78
\ No newline at end of file
index d69cbaf5dbc76d553a8b95f460e3ac7eccbf506a..6c7cb3a8f8e2c7944e5cf379e9a2be7008e26787 100644 (file)
@@ -5,9 +5,10 @@
 #
 rm -f sqlite3.c
 make sqlite3.c
-echo '********** No optimizations.  Includes FTS4 and RTREE *********'
+echo '********** No optimizations.  Includes FTS4/5, RTREE, JSON1 ***'
 gcc -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
       -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
+      -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
       sqlite3.c
 echo '********** Android configuration ******************************'
 gcc -c \
@@ -35,7 +36,8 @@ echo '********** No optimizations. ENABLE_STAT4. THREADSAFE=0 *******'
 gcc -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
       -ansi -DSQLITE_ENABLE_STAT4 -DSQLITE_THREADSAFE=0 \
       sqlite3.c
-echo '********** Optimized -O3.  Includes FTS4 and RTREE ************'
+echo '********** Optimized -O3.  Includes FTS4/5, RTREE, JSON1 ******'
 gcc -O3 -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
       -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
+      -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
       sqlite3.c