From: drh <> Date: Thu, 14 Sep 2023 16:45:46 +0000 (+0000) Subject: According to [forum:/forumpost/9f6db917e1|forum post 9f6db917e1], older X-Git-Tag: version-3.44.0~195^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Flegacy-msvc-workaround;p=thirdparty%2Fsqlite.git According to [forum:/forumpost/9f6db917e1|forum post 9f6db917e1], older MSVC compilers are unable to convert a double directly into an unsigned long long int, but must first go through a signed long long int. Work around this by restricting the range of doubles that are converted into long long integers so that only the lower 63 bits are used. FossilOrigin-Name: 0ab05871ba36e2a0eddfbc700c1d39891c54c453727a4effcdac3327efec163b --- diff --git a/manifest b/manifest index bfc381e9f9..251175f529 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Document\sthe\suse\sof\sOPFLAG_ISNOOP\sas\sthe\sP2\sargument\son\sOP_Delete.\s\sNo\nfunctional\scode\schanges. -D 2023-09-14T16:02:56.452 +C According\sto\s[forum:/forumpost/9f6db917e1|forum\spost\s9f6db917e1],\solder\nMSVC\scompilers\sare\sunable\sto\sconvert\sa\sdouble\sdirectly\sinto\san\sunsigned\nlong\slong\sint,\sbut\smust\sfirst\sgo\sthrough\sa\ssigned\slong\slong\sint.\s\sWork\naround\sthis\sby\srestricting\sthe\srange\sof\sdoubles\sthat\sare\sconverted\sinto\nlong\slong\sintegers\sso\sthat\sonly\sthe\slower\s63\sbits\sare\sused. +D 2023-09-14T16:45:46.508 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -777,7 +777,7 @@ F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0 F src/update.c 6904814dd62a7a93bbb86d9f1419c7f134a9119582645854ab02b36b676d9f92 F src/upsert.c fa125a8d3410ce9a97b02cb50f7ae68a2476c405c76aa692d3acf6b8586e9242 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 -F src/util.c 81f6d47ecda50b87e87f86d0bf87aac213698b3eec0d95d4cbaea971794e2e25 +F src/util.c e87f66258c37f87724f46e849572c3ece4c74ef5614ba41eb221e98f0dbc95de F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104 F src/vdbe.c cd112eb00d20fc5cc44f631d0e713838602637328b0f127c2f3c2aa8cea3cc91 F src/vdbe.h 41485521f68e9437fdb7ec4a90f9d86ab294e9bb8281e33b235915e29122cfc0 @@ -2120,8 +2120,11 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 6bf3e90687d48243544cc07baa01cb1b25ee0b77c59437f96c8da8e5d8b8095e -R c58a6531964633c6b2bff9cf50a88483 +P d88f41b2cf2b721170d2428a50b717976091389d9a07d0ffa15c3323b0eaad37 +R 6e9fdfd96a217f016b03340a643ca4a6 +T *branch * legacy-msvc-workaround +T *sym-legacy-msvc-workaround * +T -sym-trunk * U drh -Z 6a0608e494f78cecea487dbc940f5225 +Z abca420c386c3b858f38fb26a0353eaf # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 29925bb419..e43e8e800c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d88f41b2cf2b721170d2428a50b717976091389d9a07d0ffa15c3323b0eaad37 \ No newline at end of file +0ab05871ba36e2a0eddfbc700c1d39891c54c453727a4effcdac3327efec163b \ No newline at end of file diff --git a/src/util.c b/src/util.c index 7f8a33f9cc..58591590dc 100644 --- a/src/util.c +++ b/src/util.c @@ -1029,29 +1029,29 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ double rr[2]; rr[0] = r; rr[1] = 0.0; - if( rr[0]>1.84e+19 ){ - while( rr[0]>1.84e+119 ){ + if( rr[0]>9.223372036854774784e+18 ){ + while( rr[0]>9.223372036854774784e+118 ){ exp += 100; dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117); } - while( rr[0]>1.84e+29 ){ + while( rr[0]>9.223372036854774784e+28 ){ exp += 10; dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27); } - while( rr[0]>1.84e+19 ){ + while( rr[0]>9.223372036854774784e+18 ){ exp += 1; dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18); } }else{ - while( rr[0]<1.84e-82 ){ + while( rr[0]<9.223372036854774784e-83 ){ exp -= 100; dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83); } - while( rr[0]<1.84e+08 ){ + while( rr[0]<9.223372036854774784e+07 ){ exp -= 10; dekkerMul2(rr, 1.0e+10, 0.0); } - while( rr[0]<1.84e+18 ){ + while( rr[0]<9.22337203685477478e+17 ){ exp -= 1; dekkerMul2(rr, 1.0e+01, 0.0); }