]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Reconfigure the default case for the printf switch in order to improve
authordrh <drh@noemail.net>
Wed, 8 Apr 2009 16:10:04 +0000 (16:10 +0000)
committerdrh <drh@noemail.net>
Wed, 8 Apr 2009 16:10:04 +0000 (16:10 +0000)
branch coverage. (CVS 6472)

FossilOrigin-Name: 3cc79162dbdbce9d08bb28942128780277101e0d

manifest
manifest.uuid
src/printf.c

index cf0b900ca5a8d44e18f0ce6e97765b05825b048b..9d73a45b342bd1c9d006c9a5882ad4a737a91314 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\sa\spair\sunnecessary\sconditions\sfrom\sprintf.c.\s\sThe\s"db"\sparameter\sis\nnow\srequired\sfor\ssqlite3MPrintf().\s(CVS\s6471)
-D 2009-04-08T15:45:32
+C Reconfigure\sthe\sdefault\scase\sfor\sthe\sprintf\sswitch\sin\sorder\sto\simprove\nbranch\scoverage.\s(CVS\s6472)
+D 2009-04-08T16:10:04
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -151,7 +151,7 @@ F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
 F src/pcache1.c f587565f4ba0fd1772067eaa96814dce761b7a4c
 F src/pragma.c c26c16c49a80d03c8597f0e6c7daba53f283428f
 F src/prepare.c 0ad1ba3290e0626aa4e7589ed6ab6af2572875b0
-F src/printf.c 3c974cdc394cb8a5b4cec329ebc84dfa4b51c7b2
+F src/printf.c ea2d76000cc5f4579d7e9cb2f5460433eec0d384
 F src/random.c 676b9d7ac820fe81e6fb2394ac8c10cff7f38628
 F src/resolve.c 094e44450371fb27869eb8bf679aacbe51fdc56d
 F src/rowset.c badb9f36b3a2ced9ee9551f4ce730f5fab442791
@@ -716,7 +716,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 44ded2ea67374f187a111df69c3f51f866735400
-R ee7351ef875401c5fa93cfd4594cb2aa
+P 6fe8b5d70247d9c6b70dd482db3990986be97e69
+R 1217eb61b95942982b0af25be8e3d84f
 U drh
-Z 93f4b53543075867b4a12492e8da02b4
+Z 52886030af0cdafae5902b187d1061f2
index 4585564c67b7be1e9163fa5b8451546f31736d9b..cb35b7e464fd166770c3c113f0afd3556c876fa5 100644 (file)
@@ -1 +1 @@
-6fe8b5d70247d9c6b70dd482db3990986be97e69
\ No newline at end of file
+3cc79162dbdbce9d08bb28942128780277101e0d
\ No newline at end of file
index 7ef149c6eaae33cf7e21e25faac3d1f6966d58bd..bc8d022927fbd029142a4eb6dc8bdf655e74d673 100644 (file)
@@ -5,7 +5,7 @@
 ** an historical reference.  Most of the "enhancements" have been backed
 ** out so that the functionality is now the same as standard printf().
 **
-** $Id: printf.c,v 1.101 2009/04/08 15:45:32 drh Exp $
+** $Id: printf.c,v 1.102 2009/04/08 16:10:04 drh Exp $
 **
 **************************************************************************
 **
@@ -77,6 +77,8 @@
 #define etSQLESCAPE3 15 /* %w -> Strings with '\"' doubled */
 #define etORDINAL    16 /* %r -> 1st, 2nd, 3rd, 4th, etc.  English only */
 
+#define etINVALID     0 /* Any unrecognized conversion type */
+
 
 /*
 ** An "etByte" is an 8-bit unsigned value.
@@ -338,7 +340,8 @@ void sqlite3VXPrintf(
       flag_long = flag_longlong = 0;
     }
     /* Fetch the info entry for the field */
-    infop = 0;
+    infop = &fmtinfo[0];
+    xtype = etINVALID;
     for(idx=0; idx<ArraySize(fmtinfo); idx++){
       if( c==fmtinfo[idx].fmttype ){
         infop = &fmtinfo[idx];
@@ -351,9 +354,6 @@ void sqlite3VXPrintf(
       }
     }
     zExtra = 0;
-    if( infop==0 ){
-      return;
-    }
 
 
     /* Limit the precision to prevent overflowing buf[] during conversion */
@@ -691,6 +691,10 @@ void sqlite3VXPrintf(
         length = width = 0;
         break;
       }
+      default: {
+        assert( xtype==etINVALID );
+        return;
+      }
     }/* End switch over the format type */
     /*
     ** The text of the conversion is pointed to by "bufpt" and is