]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
For shell, silence some clang warnings, and cure one bona-fide gripe.
authorlarrybr <larrybr@noemail.net>
Fri, 8 Apr 2022 03:40:05 +0000 (03:40 +0000)
committerlarrybr <larrybr@noemail.net>
Fri, 8 Apr 2022 03:40:05 +0000 (03:40 +0000)
FossilOrigin-Name: 52be86685006ac66cce79a7d8026d671030b308823c6ba427b52377591ba7064

manifest
manifest.uuid
src/shell.c.in

index a093bfcfe12c65142c607235cc015bd3682ebf9d..51b4322c42a5a8bd6fa5da5ad766e5433c1dced0 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Revamp\sand\ssimplify\sshell\shelp\sextension\sinterface,\sand\sprovide\sfor\sscripted\sshell\sextensions\sto\sbe\sseen\sin\s.help\soutput.
-D 2022-04-08T03:20:39.765
+C For\sshell,\ssilence\ssome\sclang\swarnings,\sand\scure\sone\sbona-fide\sgripe.
+D 2022-04-08T03:40:05.593
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -556,7 +556,7 @@ F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c
 F src/resolve.c ea935b87d6fb36c78b70cdc7b28561dc8f33f2ef37048389549c7b5ef9b0ba5e
 F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
 F src/select.c c366c05e48e836ea04f8ecefb9c1225745dc250c3f01bdb39e9cbb0dc25e3610
-F src/shell.c.in 1cdd4be0d417a96f0c40202b6997e7c42a8ac34d993a2bac244393773bf6a22d x
+F src/shell.c.in 7776a6657604a00e9f63aac47ba782f4091f298c08b55d477a658faf79257204 x
 F src/shext_linkage.h 8a3990b43db032451e8ea04030ed67d99b15c7af10400032e9e8f6985e88ff73
 F src/sqlite.h.in 2a35f62185eb5e7ecc64a2f68442b538ce9be74f80f28a00abc24837edcf1c17
 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
@@ -1951,8 +1951,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 588c3512286491e2128103bcef0d6b3bdd0a0d0dcdc6bdc3e3068db552d70ed4
-R 780767747c65f5eb7755f095f488e743
+P aa785473d948b9f05f32c2107fb302374573a2906d867b4599a7063943277b0f
+R 56075a3576ea3234aa59180bfb50420a
 U larrybr
-Z 31343ddc807d11a76817aa4117ba46c9
+Z 13655dab6a777a188e42ca713dec502b
 # Remove this line to create a well-formed Fossil manifest.
index e7a319f172a6230899e3a45a58b8e69160b85022..76014cb5a7412ff46e57a01902f034a27138720e 100644 (file)
@@ -1 +1 @@
-aa785473d948b9f05f32c2107fb302374573a2906d867b4599a7063943277b0f
\ No newline at end of file
+52be86685006ac66cce79a7d8026d671030b308823c6ba427b52377591ba7064
\ No newline at end of file
index 82fa918e31942223c12ee617f21c93a0e4058019..00fe32a09802fa3f2d0dbb6e1d1409aa9a2efb66 100755 (executable)
@@ -1188,9 +1188,14 @@ struct EQPGraph {
   char zPrefix[100];    /* Graph prefix */
 };
 
-/* By default, omit the extension options that are not done yet. */
+/* By default, omit the extension options that are not done yet.
+ * "SHELL_EXTENSIONS" is short for "Some shell extensions are built in." */
 #ifndef SHELL_OMIT_EXTENSIONS
 # define SHELL_OMIT_EXTENSIONS 4
+# define SHELL_EXTENSIONS 1
+#else
+# define SHELL_EXTENSIONS \
+  (0!=((~SHELL_OMIT_EXTENSIONS) & SHELL_ALL_EXTENSIONS))
 #endif
 
 #ifdef SQLITE_OMIT_LOAD_EXTENSION
@@ -1219,11 +1224,6 @@ struct EQPGraph {
 
 #define SHELL_ALL_EXTENSIONS \
   (1<<SHEXT_PARSING_BIT)+(1<<SHEXT_DYNEXT_BIT)+(1<<SHEXT_VAREXP_BIT)
-#if !defined(SHELL_OMIT_EXTENSIONS)
-# define SHELL_EXTENSIONS SHELL_ALL_EXTENSIONS
-#else
-# define SHELL_EXTENSIONS ((~SHELL_OMIT_EXTENSIONS) & SHELL_ALL_EXTENSIONS)
-#endif
 
 /* Runtime test for shell extended parsing, given ShellInState pointer */
 #if SHELL_EXTENDED_PARSING
@@ -8072,8 +8072,8 @@ static int subscribe_events(ShellExState *p, ExtensionId eid, void *pvUserData,
     /* unsubscribe (if now subscribed) */
     while( pes < pesLim ){
       if( (eventHandler==0 || eventHandler==pes->eventHandler)
-          && (pes->eid==0 || eid==eid)
-          && (eid!=0 ||eventHandler!=0 ||/* for shell use */ pvUserData==p ) ){
+          && (pes->eid==0 || pes->eid==eid)
+          && (eid!=0 || eventHandler!=0 ||/*for shell use*/ pvUserData==p ) ){
         int nLeft = pesLim - pes;
         assert(pes->eventHandler!=0);
         pes->eventHandler(pes->pvUserData, NK_Unsubscribe, pes->eid, p);
@@ -9359,8 +9359,8 @@ DISPATCHABLE_COMMAND( filectrl ? 2 0 ){
     char zBuf[100];
     sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", iRes);
     raw_printf(psi->out, "%s\n", zBuf);
-    return DCR_Ok;
   }
+  return DCR_Ok;
 }
 
 DISPATCHABLE_COMMAND( fullschema ? 1 2 ){
@@ -13382,7 +13382,7 @@ static char *zPrepForEval(const char *zVal, int ntc){
      * land past the end of the allocation made just below.
      */
     int nle = ixNewline>0;
-    return smprintf( "%.*s%s", ntc, zVal, "\n"+nle );
+    return smprintf( "%.*s%s", ntc, zVal, &"\n"[nle] );
   }else{
     return 0;
   }
@@ -14603,6 +14603,8 @@ static void dot_command_scan(char *zCmd, DCmd_ScanState *pScanState){
       ss = twixtArgs;
       c = *zCmd++;
       continue;
+    case endEscaped: case isOpenMask: default:
+      ; /* Not reachable, but quiet compilers unable to see this. */
     }
   }
  atEnd:
@@ -14843,6 +14845,7 @@ static DotCmdRC process_input(ShellInState *psi){
           }
         }
         break;
+      case Tbd: case Eof: default: assert(0); /* Not reachable */
       } /* end switch on inKind */
       /* Collect and accumulate more input if group not yet complete. */
       if( disposition==Incoming ){