1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix harmless compiler warnings that show up on 32-bit RaspberryPI builds.

FossilOrigin-Name: bc4d20f362925e4ce5c79f0d7a27a8e9bbac92525bd4cea2ae983798e3f8c37d
This commit is contained in:
drh
2023-06-17 15:42:44 +00:00
parent 0587a1a8bb
commit 8e5cef7bca
5 changed files with 45 additions and 21 deletions

View File

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