]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Comment out unused code when SQLITE_OMIT_FLOATING_POINT is selected.
authordrh <drh@noemail.net>
Wed, 13 Jan 2010 04:22:20 +0000 (04:22 +0000)
committerdrh <drh@noemail.net>
Wed, 13 Jan 2010 04:22:20 +0000 (04:22 +0000)
Added testcase() macros to boundary conditions in util.c routines.

FossilOrigin-Name: dfc6595d347ea87923a857778b68751103f535d2

manifest
manifest.uuid
src/expr.c
src/util.c

index 7a0a73f86a73df3e9bc5daaecebdf80f101983cd..8194b0fe4f3d5854ec1b8f3742d528599a784c3d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Make\sthe\ssqlite3_result_double()\sinterface\swork\sthe\ssame\sas\nsqlite3_result_int64()\swhen\sSQLITE_OMIT_FLOATING_POINT\sis\sdefined.
-D 2010-01-13T00:04:14
+C Comment\sout\sunused\scode\swhen\sSQLITE_OMIT_FLOATING_POINT\sis\sselected.\nAdded\stestcase()\smacros\sto\sboundary\sconditions\sin\sutil.c\sroutines.
+D 2010-01-13T04:22:21
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -119,7 +119,7 @@ F src/callback.c 908f3e0172c3d4058f4ca0acd42c637c52e9669f
 F src/complete.c 4c8a742c4a4a6d9c835912648f5c8f032ea36c7b
 F src/date.c 485a4409a384310e6d93fd1104a9d0a8658becd9
 F src/delete.c 610dc008e88a9599f905f5cbe9577ac9c36e0581
-F src/expr.c e6f042e88b3603f9ca698c0453c4ee0b91506788
+F src/expr.c d0a345e1d8995e142bc5d9f39a97b9981d7d8f23
 F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
 F src/fkey.c e2116672a6bd610dc888e27df292ebc7999c9bb0
 F src/func.c 7cd1b3abad8bcccf555fad9274d608da972467a3
@@ -210,7 +210,7 @@ F src/tokenize.c e7f3606cc1b51a819a2bfee99100648d35bc791d
 F src/trigger.c d46f9389e3bf3dd1cc1d288aba2f289c96b34200
 F src/update.c c0dc6b75ad28b76b619042d934f337b02acee208
 F src/utf.c dad16adcc0c35ef2437dca125a4b07419d361052
-F src/util.c ad4f03079ba0fe83590d1cc9197e8e4844e38592
+F src/util.c 4f0fb8561b7576a450fc86212ac7f7800e169077
 F src/vacuum.c 28ee5a4963d16cf2477075d85966c0f461cd79de
 F src/vdbe.c 1e2c66f2612275a26e156889ec123e8e13c4821d
 F src/vdbe.h bea1f0cd530775bdb58a340265f3cf3ee920e9b2
@@ -788,14 +788,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 0209f17180065d9c213b6c437be1c3c40660665f
-R cf91a5f9af46740c8cb7efa5ec1af48a
+P 61df5986600b6c9e6d5c42efc0067a27fe54251f
+R ed1297a5ea74ad9a93623001b89f8fe6
 U drh
-Z 97e81790c76e29bd9114b4c586f71151
+Z 6850a89c31f37b37c7103946a0617fb2
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFLTQ4CoxKgR168RlERAjaGAJ9a3rhtgM5CkbPdrrYtI7H7xDIdgQCcD1xr
-TRvM1K3kFoXXPzKKn3+X1RM=
-=KiNC
+iD8DBQFLTUqAoxKgR168RlERArrjAJ4+fjS5/JTEovzvoqB7ZbKz9iMf2wCeITA6
+uHjhIi3LJdPEe5X1lDBaOhI=
+=jnHU
 -----END PGP SIGNATURE-----
index 90deda23d66533d7f4abd5d10893a3cc37446629..42fa9a8cbb52704b858ca3ae7b674b007ee00f7d 100644 (file)
@@ -1 +1 @@
-61df5986600b6c9e6d5c42efc0067a27fe54251f
\ No newline at end of file
+dfc6595d347ea87923a857778b68751103f535d2
\ No newline at end of file
index 88c790a583964b356638ef2f74de0529f23b5891..dcadd9856a87b377859a1421aaa2e3d58a0970c5 100644 (file)
@@ -2754,6 +2754,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
         target
       ));
 
+#ifndef SQLITE_OMIT_FLOATING_POINT
       /* If the column has REAL affinity, it may currently be stored as an
       ** integer. Use OP_RealAffinity to make sure it is really real.  */
       if( pExpr->iColumn>=0 
@@ -2761,6 +2762,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
       ){
         sqlite3VdbeAddOp1(v, OP_RealAffinity, target);
       }
+#endif
       break;
     }
 
index 81e42b4ae500a786c0a19b3424509a42ea49695d..36498f95236a6b05087809f9e6e7ebdf49ffea5b 100644 (file)
@@ -255,6 +255,7 @@ int sqlite3IsNumber(const char *z, int *realnum, u8 enc){
   z += incr;
   *realnum = 0;
   while( sqlite3Isdigit(*z) ){ z += incr; }
+#ifndef SQLITE_OMIT_FLOATING_POINT
   if( *z=='.' ){
     z += incr;
     if( !sqlite3Isdigit(*z) ) return 0;
@@ -268,6 +269,7 @@ int sqlite3IsNumber(const char *z, int *realnum, u8 enc){
     while( sqlite3Isdigit(*z) ){ z += incr; }
     *realnum = 1;
   }
+#endif
   return *z==0;
 }
 
@@ -429,6 +431,9 @@ static int compare2pow63(const char *zNum){
   c = memcmp(zNum,"922337203685477580",18)*10;
   if( c==0 ){
     c = zNum[18] - '8';
+    testcase( c==(-1) );
+    testcase( c==0 );
+    testcase( c==(+1) );
   }
   return c;
 }
@@ -465,6 +470,9 @@ int sqlite3Atoi64(const char *zNum, i64 *pNum){
     v = v*10 + c - '0';
   }
   *pNum = neg ? -v : v;
+  testcase( i==18 );
+  testcase( i==19 );
+  testcase( i==20 );
   if( c!=0 || (i==0 && zStart==zNum) || i>19 ){
     /* zNum is empty or contains non-numeric text or is longer
     ** than 19 digits (thus guaranting that it is too large) */
@@ -508,6 +516,9 @@ int sqlite3FitsIn64Bits(const char *zNum, int negFlag){
     zNum++;   /* Skip leading zeros.  Ticket #2454 */
   }
   for(i=0; zNum[i]; i++){ assert( zNum[i]>='0' && zNum[i]<='9' ); }
+  testcase( i==18 );
+  testcase( i==19 );
+  testcase( i==20 );
   if( i<19 ){
     /* Guaranteed to fit if less than 19 digits */
     return 1;
@@ -548,9 +559,11 @@ int sqlite3GetInt32(const char *zNum, int *pValue){
   **             1234567890
   **     2^31 -> 2147483648
   */
+  testcase( i==10 );
   if( i>10 ){
     return 0;
   }
+  testcase( v-neg==2147483647 );
   if( v-neg>2147483647 ){
     return 0;
   }