From 874ba04c73c8cf1299ad618cc511d253533b6697 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 8 Apr 2009 16:10:04 +0000 Subject: [PATCH] Reconfigure the default case for the printf switch in order to improve branch coverage. (CVS 6472) FossilOrigin-Name: 3cc79162dbdbce9d08bb28942128780277101e0d --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/printf.c | 14 +++++++++----- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index cf0b900ca5..9d73a45b34 100644 --- 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 diff --git a/manifest.uuid b/manifest.uuid index 4585564c67..cb35b7e464 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6fe8b5d70247d9c6b70dd482db3990986be97e69 \ No newline at end of file +3cc79162dbdbce9d08bb28942128780277101e0d \ No newline at end of file diff --git a/src/printf.c b/src/printf.c index 7ef149c6ea..bc8d022927 100644 --- a/src/printf.c +++ b/src/printf.c @@ -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