Reconfigure the default case for the printf switch in order to improve

branch coverage. (CVS 6472)

FossilOrigin-Name: 3cc79162dbdbce9d08bb28942128780277101e0d
This commit is contained in:
drh 2009-04-08 16:10:04 +00:00
parent bc6160b0d6
commit 874ba04c73
3 changed files with 16 additions and 12 deletions

View File

@ -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

View File

@ -1 +1 @@
6fe8b5d70247d9c6b70dd482db3990986be97e69
3cc79162dbdbce9d08bb28942128780277101e0d

View 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