Cure tclshext build warning. Sync w/trunk.
FossilOrigin-Name: e9f2119106f687ecf9bc9c5f78c043ce7dd91874d3fb516d7621dbd806d8a174
This commit is contained in:
@@ -997,12 +997,15 @@ static int udbEventHandle(void *pv, NoticeKind nk, void *pvSubject,
|
||||
case NK_DbAboutToClose:
|
||||
if( ix>=0 ) udbRemove(pudb, ix);
|
||||
break;
|
||||
|
||||
/* Only above need handling. (So, clever tools, be quiet!) */
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Create the UserDb object supporting TCL "udb" command operations.
|
||||
/* Create the UserDb object supporting TCL "udb" command operations.
|
||||
* It's not wholly created because it is a singleton. Any subsequent
|
||||
* creation is ignored; instead, the singleton is returned. This
|
||||
* object is made to release resources only upon shutdown. If a TCL
|
||||
|
||||
+9
-4
@@ -96,6 +96,11 @@ typedef unsigned int u32;
|
||||
#endif
|
||||
#endif /* !defined(SQLITE_AMALGAMATION) */
|
||||
|
||||
/* Macro to check for 4-byte alignment. Only used inside of assert() */
|
||||
#ifdef SQLITE_DEBUG
|
||||
# define FOUR_BYTE_ALIGNED(X) ((((char*)(X) - (char*)0) & 3)==0)
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
@@ -502,7 +507,7 @@ static int readInt16(u8 *p){
|
||||
return (p[0]<<8) + p[1];
|
||||
}
|
||||
static void readCoord(u8 *p, RtreeCoord *pCoord){
|
||||
assert( (((sqlite3_uint64)p)&3)==0 ); /* p is always 4-byte aligned */
|
||||
assert( FOUR_BYTE_ALIGNED(p) );
|
||||
#if SQLITE_BYTEORDER==1234 && MSVC_VERSION>=1300
|
||||
pCoord->u = _byteswap_ulong(*(u32*)p);
|
||||
#elif SQLITE_BYTEORDER==1234 && GCC_VERSION>=4003000
|
||||
@@ -556,7 +561,7 @@ static void writeInt16(u8 *p, int i){
|
||||
}
|
||||
static int writeCoord(u8 *p, RtreeCoord *pCoord){
|
||||
u32 i;
|
||||
assert( (((sqlite3_uint64)p)&3)==0 ); /* p is always 4-byte aligned */
|
||||
assert( FOUR_BYTE_ALIGNED(p) );
|
||||
assert( sizeof(RtreeCoord)==4 );
|
||||
assert( sizeof(u32)==4 );
|
||||
#if SQLITE_BYTEORDER==1234 && GCC_VERSION>=4003000
|
||||
@@ -1284,7 +1289,7 @@ static void rtreeNonleafConstraint(
|
||||
assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE
|
||||
|| p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_TRUE
|
||||
|| p->op==RTREE_FALSE );
|
||||
assert( (((sqlite3_uint64)pCellData)&3)==0 ); /* 4-byte aligned */
|
||||
assert( FOUR_BYTE_ALIGNED(pCellData) );
|
||||
switch( p->op ){
|
||||
case RTREE_TRUE: return; /* Always satisfied */
|
||||
case RTREE_FALSE: break; /* Never satisfied */
|
||||
@@ -1337,7 +1342,7 @@ static void rtreeLeafConstraint(
|
||||
|| p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_TRUE
|
||||
|| p->op==RTREE_FALSE );
|
||||
pCellData += 8 + p->iCoord*4;
|
||||
assert( (((sqlite3_uint64)pCellData)&3)==0 ); /* 4-byte aligned */
|
||||
assert( FOUR_BYTE_ALIGNED(pCellData) );
|
||||
RTREE_DECODE_COORD(eInt, pCellData, xN);
|
||||
switch( p->op ){
|
||||
case RTREE_TRUE: return; /* Always satisfied */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
C Sync\sw/trunk.
|
||||
D 2023-06-17T01:56:55.752
|
||||
C Cure\stclshext\sbuild\swarning.\sSync\sw/trunk.
|
||||
D 2023-06-17T23:53:51.915
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@@ -319,7 +319,7 @@ F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52
|
||||
F ext/misc/spellfix.c 94df9bbfa514a563c1484f684a2df3d128a2f7209a84ca3ca100c68a0163e29f
|
||||
F ext/misc/sqlar.c 53e7d48f68d699a24f1a92e68e71eca8b3a9ff991fe9588c2a05bde103c6e7b7
|
||||
F ext/misc/stmt.c bc30d60d55e70d0133f10ac6103fe9336543f673740b73946f98758a2bb16dd7
|
||||
F ext/misc/tclshext.c.in 066f3b5cb386244167aeb03d7a46b5974b50ac72d17d6546649a66ceb7614613
|
||||
F ext/misc/tclshext.c.in 732f33460956d1416f5ed7a991cfd367d3767f35ad20cb68343a54e50b32ba74
|
||||
F ext/misc/templatevtab.c 8a16a91a5ceaccfcbd6aaaa56d46828806e460dd194965b3f77bf38f14b942c4
|
||||
F ext/misc/totype.c fa4aedeb07f66169005dffa8de3b0a2b621779fd44f85c103228a42afa71853b
|
||||
F ext/misc/uint.c 053fed3bce2e89583afcd4bf804d75d659879bbcedac74d0fa9ed548839a030b
|
||||
@@ -408,7 +408,7 @@ F ext/repair/test/checkindex01.test b530f141413b587c9eb78ff734de6bb79bc3515c3350
|
||||
F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c
|
||||
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
|
||||
F ext/rtree/geopoly.c 971e0b5bd9adaf0811feb8c0842a310811159da10319eb0e74fdb42bf26b99ca
|
||||
F ext/rtree/rtree.c 33d6642fcf956e62ca0e4aa06631c3529e3a9ac9bb4108542d81ac2bd0a8d24a
|
||||
F ext/rtree/rtree.c fb36e05027505f2c0dab24564e1d58ca4b789a6dfa48cf51aeee570018cf4814
|
||||
F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412
|
||||
F ext/rtree/rtree1.test 877d40b8b61b1f88cec9d4dc0ff8334f5b05299fac12a35141532e2881860e9d
|
||||
F ext/rtree/rtree2.test 9d9deddbb16fd0c30c36e6b4fdc3ee3132d765567f0f9432ee71e1303d32603d
|
||||
@@ -586,7 +586,7 @@ F src/build.c cb54df6fd018a18e940a251c5e31780ffba8bc6c7a01e670b96a489adcbfb3b4
|
||||
F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d490
|
||||
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
|
||||
F src/ctime.c 20507cc0b0a6c19cd882fcd0eaeda32ae6a4229fb4b024cfdf3183043d9b703d
|
||||
F src/date.c 36dfd2525c5544dbb246084e93839b839366e2204e7fb4a1a68a50f4344d32bc
|
||||
F src/date.c 62e7936bc31a6a78ad93d36e5261c41113a4c1cad7f043c77790a5ffc8c63e2d
|
||||
F src/dbpage.c f3eea5f7ec47e09ee7da40f42b25092ecbe961fc59566b8e5f705f34335b2387
|
||||
F src/dbstat.c ec92074baa61d883de58c945162d9e666c13cd7cf3a23bc38b4d1c4d0b2c2bef
|
||||
F src/delete.c 092d745aa08969204a351711193e7f34de449ea57755eacbd11f1c316e9f7673
|
||||
@@ -653,8 +653,8 @@ F src/sqliteInt.h 51409a4f9456865fe7b15a9c0563bcf193d52f8a1c4f7a951ee988160ed265
|
||||
F src/sqliteLimit.h 33b1c9baba578d34efe7dfdb43193b366111cdf41476b1e82699e14c11ee1fb6
|
||||
F src/status.c 160c445d7d28c984a0eae38c144f6419311ed3eace59b44ac6dafc20db4af749
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
F src/tclsqlite.c 9952874a1f1bb9fa6406b334cadf748c273cd2f2d4501152022a95dd37dc7958
|
||||
F src/test1.c 8ae514d6a0d030f7953a99ff5dca6419cb7a5ad1a1c392d1fdf0f069e6ca792b
|
||||
F src/tclsqlite.c ecbc3c99c0d0c3ed122a913f143026c26d38d57f33e06bb71185dd5c1efe37cd
|
||||
F src/test1.c e6ab4a00671f052366a01bcb7fdf2e2f6bb4aa884cd01e738c5590dcf47a99ca
|
||||
F src/test2.c 827446e259a3b7ab949da1542953edda7b5117982576d3e6f1c24a0dd20a5cef
|
||||
F src/test3.c e5178558c41ff53236ae0271e9acb3d6885a94981d2eb939536ee6474598840e
|
||||
F src/test4.c 4533b76419e7feb41b40582554663ed3cd77aaa54e135cf76b3205098cd6e664
|
||||
@@ -2052,8 +2052,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P b0cb4cfceaa45c31c217e8e0edf4b1431f5e1bd05f85d49528792d69bdbdd6dc 365caf2f97e8f15842f52536e8d05d359e9d6e863182e020ce14a9a9f27ee057
|
||||
R f7e4b86dfb1aed4513de35498c9dac88
|
||||
P 746733c1c5905ec8c372eaf0dd720b7efac63e1102f0c63812a2bc3bb4ed6dc3 bc4d20f362925e4ce5c79f0d7a27a8e9bbac92525bd4cea2ae983798e3f8c37d
|
||||
R 2fb26f5046a3ccf5f88d8314d156acd8
|
||||
U larrybr
|
||||
Z b071645d2d583c5fbb5c87c4a4c85152
|
||||
Z 61abe442578afdfc76fe84f58fca864e
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
746733c1c5905ec8c372eaf0dd720b7efac63e1102f0c63812a2bc3bb4ed6dc3
|
||||
e9f2119106f687ecf9bc9c5f78c043ce7dd91874d3fb516d7621dbd806d8a174
|
||||
+8
-42
@@ -448,56 +448,22 @@ static void computeYMD(DateTime *p){
|
||||
p->validYMD = 1;
|
||||
}
|
||||
|
||||
/* GCC (and sometimes Clang too) will sometimes be off by 1 millisecond
|
||||
** in computeHMS() on 32-bit platforms with optimization enabled.
|
||||
** I don't know if this is a compiler bug or a bug in the code. It is hard
|
||||
** to debug because with optimization enabled, gdb skips around so much
|
||||
** you cannot see what is happening, and if you try adding debug printf()s
|
||||
** to the code, the problem goes away.
|
||||
**
|
||||
** For now, I will work around the problem by disabling optimizations in
|
||||
** the computeHMS() routine.
|
||||
**
|
||||
** Problem seen using gcc-5.4.0, gcc-9.4.0, clang-10. Works ok on
|
||||
** MSVC, clang-3.4, and clang-6.0.
|
||||
**
|
||||
** Whatever the problem is, it causes some answers to be off by one
|
||||
** millisecond. So we get results like "2021-03-05 03:04:05.599" instead
|
||||
** of the desired result of "2021-03-05 03:04:05.600".
|
||||
**
|
||||
** To reproduce the problem using TH3:
|
||||
**
|
||||
** ./th3make debug.rc -O1 -m32 cfg/c1.cfg cov1/date8.test
|
||||
*/
|
||||
#if SQLITE_PTRSIZE==4 && GCC_VERSION>0
|
||||
#pragma GCC push_options
|
||||
#pragma GCC optimize ("O0")
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Compute the Hour, Minute, and Seconds from the julian day number.
|
||||
*/
|
||||
static void computeHMS(DateTime *p){
|
||||
int s;
|
||||
int day_ms, day_min; /* milliseconds, minutes into the day */
|
||||
if( p->validHMS ) return;
|
||||
computeJD(p);
|
||||
s = (int)((p->iJD + 43200000) % 86400000);
|
||||
p->s = s/1000.0;
|
||||
s = (int)p->s;
|
||||
p->s -= s;
|
||||
p->h = s/3600;
|
||||
s -= p->h*3600;
|
||||
p->m = s/60;
|
||||
p->s += s - p->m*60;
|
||||
day_ms = (int)((p->iJD + 43200000) % 86400000);
|
||||
p->s = (day_ms % 60000)/1000.0;
|
||||
day_min = day_ms/60000;
|
||||
p->m = day_min % 60;
|
||||
p->h = day_min / 60;
|
||||
p->rawS = 0;
|
||||
p->validHMS = 1;
|
||||
}
|
||||
|
||||
/* Reactivate GCC optimization */
|
||||
#if SQLITE_PTRSIZE==4 && GCC_VERSION>0
|
||||
#pragma GCC pop_options
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Compute both YMD and HMS
|
||||
*/
|
||||
@@ -1160,7 +1126,7 @@ static void datetimeFunc(
|
||||
zBuf[16] = '0' + (x.m)%10;
|
||||
zBuf[17] = ':';
|
||||
if( x.useSubsec ){
|
||||
s = (int)1000.0*x.s;
|
||||
s = (int)(1000.0*x.s + 0.5);
|
||||
zBuf[18] = '0' + (s/10000)%10;
|
||||
zBuf[19] = '0' + (s/1000)%10;
|
||||
zBuf[20] = '.';
|
||||
@@ -1207,7 +1173,7 @@ static void timeFunc(
|
||||
zBuf[4] = '0' + (x.m)%10;
|
||||
zBuf[5] = ':';
|
||||
if( x.useSubsec ){
|
||||
s = (int)1000.0*x.s;
|
||||
s = (int)(1000.0*x.s + 0.5);
|
||||
zBuf[6] = '0' + (s/10000)%10;
|
||||
zBuf[7] = '0' + (s/1000)%10;
|
||||
zBuf[8] = '.';
|
||||
|
||||
+23
-4
@@ -55,6 +55,25 @@
|
||||
# include <string.h>
|
||||
# include <assert.h>
|
||||
typedef unsigned char u8;
|
||||
# ifndef SQLITE_PTRSIZE
|
||||
# if defined(__SIZEOF_POINTER__)
|
||||
# define SQLITE_PTRSIZE __SIZEOF_POINTER__
|
||||
# elif defined(i386) || defined(__i386__) || defined(_M_IX86) || \
|
||||
defined(_M_ARM) || defined(__arm__) || defined(__x86) || \
|
||||
(defined(__APPLE__) && defined(__POWERPC__)) || \
|
||||
(defined(__TOS_AIX__) && !defined(__64BIT__))
|
||||
# define SQLITE_PTRSIZE 4
|
||||
# else
|
||||
# define SQLITE_PTRSIZE 8
|
||||
# endif
|
||||
# endif /* SQLITE_PTRSIZE */
|
||||
# if defined(HAVE_STDINT_H)
|
||||
typedef uintptr_t uptr;
|
||||
# elif SQLITE_PTRSIZE==4
|
||||
typedef unsigned int uptr;
|
||||
# else
|
||||
typedef sqlite3_uint64 uptr;
|
||||
# endif
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -675,7 +694,7 @@ static int DbTraceV2Handler(
|
||||
pCmd = Tcl_NewStringObj(pDb->zTraceV2, -1);
|
||||
Tcl_IncrRefCount(pCmd);
|
||||
Tcl_ListObjAppendElement(pDb->interp, pCmd,
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)pStmt));
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)(uptr)pStmt));
|
||||
Tcl_ListObjAppendElement(pDb->interp, pCmd,
|
||||
Tcl_NewStringObj(zSql, -1));
|
||||
Tcl_EvalObjEx(pDb->interp, pCmd, TCL_EVAL_DIRECT);
|
||||
@@ -690,7 +709,7 @@ static int DbTraceV2Handler(
|
||||
pCmd = Tcl_NewStringObj(pDb->zTraceV2, -1);
|
||||
Tcl_IncrRefCount(pCmd);
|
||||
Tcl_ListObjAppendElement(pDb->interp, pCmd,
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)pStmt));
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)(uptr)pStmt));
|
||||
Tcl_ListObjAppendElement(pDb->interp, pCmd,
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)ns));
|
||||
Tcl_EvalObjEx(pDb->interp, pCmd, TCL_EVAL_DIRECT);
|
||||
@@ -704,7 +723,7 @@ static int DbTraceV2Handler(
|
||||
pCmd = Tcl_NewStringObj(pDb->zTraceV2, -1);
|
||||
Tcl_IncrRefCount(pCmd);
|
||||
Tcl_ListObjAppendElement(pDb->interp, pCmd,
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)pStmt));
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)(uptr)pStmt));
|
||||
Tcl_EvalObjEx(pDb->interp, pCmd, TCL_EVAL_DIRECT);
|
||||
Tcl_DecrRefCount(pCmd);
|
||||
Tcl_ResetResult(pDb->interp);
|
||||
@@ -716,7 +735,7 @@ static int DbTraceV2Handler(
|
||||
pCmd = Tcl_NewStringObj(pDb->zTraceV2, -1);
|
||||
Tcl_IncrRefCount(pCmd);
|
||||
Tcl_ListObjAppendElement(pDb->interp, pCmd,
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)db));
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)(uptr)db));
|
||||
Tcl_EvalObjEx(pDb->interp, pCmd, TCL_EVAL_DIRECT);
|
||||
Tcl_DecrRefCount(pCmd);
|
||||
Tcl_ResetResult(pDb->interp);
|
||||
|
||||
+4
-4
@@ -3648,7 +3648,7 @@ static int SQLITE_TCLAPI test_intarray_addr(
|
||||
}
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((sqlite3_int64)p));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((uptr)p));
|
||||
return TCL_OK;
|
||||
}
|
||||
/*
|
||||
@@ -3684,7 +3684,7 @@ static int SQLITE_TCLAPI test_int64array_addr(
|
||||
p[i] = v;
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((sqlite3_int64)p));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((uptr)p));
|
||||
return TCL_OK;
|
||||
}
|
||||
/*
|
||||
@@ -3718,7 +3718,7 @@ static int SQLITE_TCLAPI test_doublearray_addr(
|
||||
}
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((sqlite3_int64)p));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((uptr)p));
|
||||
return TCL_OK;
|
||||
}
|
||||
/*
|
||||
@@ -3751,7 +3751,7 @@ static int SQLITE_TCLAPI test_textarray_addr(
|
||||
}
|
||||
}
|
||||
n = objc-1;
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((sqlite3_int64)p));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((uptr)p));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user