diff options
Diffstat (limited to 'vendor/modernc.org/sqlite/lib/sqlite_linux_386.go')
-rw-r--r-- | vendor/modernc.org/sqlite/lib/sqlite_linux_386.go | 23338 |
1 files changed, 8277 insertions, 15061 deletions
diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go index a099d0369..369204635 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go @@ -1,7 +1,6 @@ -// Code generated for linux/386 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/386 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/386 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/386 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && 386 -// +build linux,386 package sqlite3 @@ -12,27 +11,10 @@ import ( "modernc.org/libc" ) -var ( - _ reflect.Type - _ unsafe.Pointer -) +var _ reflect.Type +var _ unsafe.Pointer -const ACCESSPERMS = 511 -const ADJ_ESTERROR = 8 -const ADJ_FREQUENCY = 2 -const ADJ_MAXERROR = 4 -const ADJ_MICRO = 4096 -const ADJ_NANO = 8192 -const ADJ_OFFSET = 1 -const ADJ_OFFSET_SINGLESHOT = 32769 -const ADJ_OFFSET_SS_READ = 40961 -const ADJ_SETOFFSET = 256 -const ADJ_STATUS = 16 -const ADJ_TAI = 128 -const ADJ_TICK = 16384 -const ADJ_TIMECONST = 32 const ALLBITS = -1 -const ALLPERMS = 4095 const AT_EACCESS = 512 const AT_EMPTY_PATH = 4096 const AT_FDCWD = -100 @@ -104,10 +86,9 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 -const BUFSIZ = 8192 +const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 -const CBRK = 0 const CC_AND = 24 const CC_BANG = 15 const CC_BOM = 30 @@ -139,18 +120,9 @@ const CC_TILDA = 25 const CC_VARALPHA = 5 const CC_VARNUM = 6 const CC_X = 0 -const CDISCARD = 15 -const CDSUSP = 25 -const CEOF = 4 -const CEOL = 0 -const CEOT = 4 -const CERASE = 127 -const CFLUSH = 15 -const CINTR = 3 const CKCNSTRNT_COLUMN = 1 const CKCNSTRNT_ROWID = 2 -const CKILL = 21 -const CLNEXT = 22 +const CLOCKS_PER_SEC = 1000000 const CLOCK_BOOTTIME = 7 const CLOCK_BOOTTIME_ALARM = 9 const CLOCK_MONOTONIC = 1 @@ -160,11 +132,9 @@ const CLOCK_PROCESS_CPUTIME_ID = 2 const CLOCK_REALTIME = 0 const CLOCK_REALTIME_ALARM = 8 const CLOCK_REALTIME_COARSE = 5 +const CLOCK_SGI_CYCLE = 10 const CLOCK_TAI = 11 const CLOCK_THREAD_CPUTIME_ID = 3 -const CLOSE_RANGE_CLOEXEC = 4 -const CLOSE_RANGE_UNSHARE = 2 -const CMIN = 1 const COLFLAG_BUSY = 256 const COLFLAG_GENERATED = 96 const COLFLAG_HASCOLL = 512 @@ -191,14 +161,6 @@ const COLTYPE_INT = 3 const COLTYPE_INTEGER = 4 const COLTYPE_REAL = 5 const COLTYPE_TEXT = 6 -const CQUIT = 28 -const CREPRINT = 18 -const CRPRNT = 18 -const CSTART = 17 -const CSTATUS = 0 -const CSTOP = 19 -const CSUSP = 26 -const CTIME = 0 const CURSOR_FAULT = 4 const CURSOR_INVALID = 1 const CURSOR_REQUIRESEEK = 3 @@ -208,7 +170,6 @@ const CURTYPE_BTREE = 0 const CURTYPE_PSEUDO = 3 const CURTYPE_SORTER = 1 const CURTYPE_VTAB = 2 -const CWERASE = 23 const DBFLAG_EncodingFixed = 64 const DBFLAG_InternalFunc = 32 const DBFLAG_PreferBuiltin = 2 @@ -220,11 +181,7 @@ const DBSTAT_PAGE_PADDING_BYTES = 256 const DB_ResetWanted = 8 const DB_SchemaLoaded = 1 const DB_UnresetViews = 2 -const DEFFILEMODE = 438 const DIRECT_MODE = 0 -const DLFO_EH_SEGMENT_TYPE = 0 -const DLFO_STRUCT_HAS_EH_COUNT = 0 -const DLFO_STRUCT_HAS_EH_DBASE = 1 const DN_ACCESS = 1 const DN_ATTRIB = 32 const DN_CREATE = 4 @@ -338,7 +295,6 @@ const ENOTSUP = 95 const ENOTTY = 25 const ENOTUNIQ = 76 const ENXIO = 6 -const EOF = -1 const EOPNOTSUPP = 95 const EOVERFLOW = 75 const EOWNERDEAD = 130 @@ -422,13 +378,8 @@ const F2FS_IOC_COMMIT_ATOMIC_WRITE = 62722 const F2FS_IOC_GET_FEATURES = 2147546380 const F2FS_IOC_START_ATOMIC_WRITE = 62721 const F2FS_IOC_START_VOLATILE_WRITE = 62723 -const FALLOC_FL_COLLAPSE_RANGE = 8 -const FALLOC_FL_INSERT_RANGE = 32 const FALLOC_FL_KEEP_SIZE = 1 -const FALLOC_FL_NO_HIDE_STALE = 4 const FALLOC_FL_PUNCH_HOLE = 2 -const FALLOC_FL_UNSHARE_RANGE = 64 -const FALLOC_FL_ZERO_RANGE = 16 const FAPPEND = 1024 const FASYNC = 8192 const FD_CLOEXEC = 1 @@ -437,24 +388,20 @@ const FFSYNC = 1052672 const FILENAME_MAX = 4096 const FIOASYNC = 21586 const FIOCLEX = 21585 +const FIOGETOWN = 35075 const FIONBIO = 21537 const FIONCLEX = 21584 const FIONREAD = 21531 const FIOQSIZE = 21600 +const FIOSETOWN = 35073 const FLAG_SIGNED = 1 const FLAG_STRING = 4 const FNDELAY = 2048 const FNONBLOCK = 2048 +const FOPEN_MAX = 1000 const FP_ILOGB0 = -2147483648 const FP_ILOGBNAN = -2147483648 const FP_INFINITE = 1 -const FP_INT_DOWNWARD = 1 -const FP_INT_TONEAREST = 4 -const FP_INT_TONEARESTFROMZERO = 3 -const FP_INT_TOWARDZERO = 2 -const FP_INT_UPWARD = 0 -const FP_LLOGB0 = -2147483648 -const FP_LLOGBNAN = -2147483648 const FP_NAN = 0 const FP_NORMAL = 4 const FP_SUBNORMAL = 3 @@ -582,15 +529,16 @@ const FTS5_WORK_UNIT = 64 const FULLY_WITHIN = 2 const FUNC_PERFECT_MATCH = 6 const F_ADD_SEALS = 1033 +const F_CANCELLK = 1029 const F_DUPFD = 0 const F_DUPFD_CLOEXEC = 1030 -const F_EXLCK = 4 const F_GETFD = 1 const F_GETFL = 3 const F_GETLEASE = 1025 const F_GETLK = 12 const F_GETLK64 = 12 const F_GETOWN = 9 +const F_GETOWNER_UIDS = 17 const F_GETOWN_EX = 16 const F_GETPIPE_SZ = 1032 const F_GETSIG = 11 @@ -603,6 +551,10 @@ const F_OFD_GETLK = 36 const F_OFD_SETLK = 37 const F_OFD_SETLKW = 38 const F_OK = 0 +const F_OWNER_GID = 2 +const F_OWNER_PGRP = 2 +const F_OWNER_PID = 1 +const F_OWNER_TID = 0 const F_RDLCK = 0 const F_SEAL_FUTURE_WRITE = 16 const F_SEAL_GROW = 4 @@ -622,7 +574,6 @@ const F_SETPIPE_SZ = 1031 const F_SETSIG = 10 const F_SET_FILE_RW_HINT = 1038 const F_SET_RW_HINT = 1036 -const F_SHLCK = 8 const F_TEST = 3 const F_TLOCK = 2 const F_ULOCK = 0 @@ -644,14 +595,8 @@ const HAVE_PREAD = 1 const HAVE_PWRITE = 1 const HAVE_READLINK = 1 const HAVE_USLEEP = 1 -const HUGE_VAL = 0 +const HUGE = 0 const HUGE_VALF = 0 -const HUGE_VALL = 0 -const HUGE_VAL_F128 = 0 -const HUGE_VAL_F32 = 0 -const HUGE_VAL_F32X = 0 -const HUGE_VAL_F64 = 0 -const HUGE_VAL_F64X = 0 const INCRINIT_NORMAL = 0 const INCRINIT_ROOT = 2 const INCRINIT_TASK = 1 @@ -677,11 +622,9 @@ const IN_INDEX_MEMBERSHIP = 2 const IN_INDEX_NOOP = 5 const IN_INDEX_NOOP_OK = 1 const IN_INDEX_ROWID = 1 -const IOCSIZE_MASK = 1073676288 -const IOCSIZE_SHIFT = 16 -const IOC_IN = 1073741824 -const IOC_INOUT = 3221225472 -const IOC_OUT = 2147483648 +const ITIMER_PROF = 2 +const ITIMER_REAL = 0 +const ITIMER_VIRTUAL = 1 const IsStat4 = 1 const JEACH_ATOM = 3 const JEACH_FULLKEY = 6 @@ -745,25 +688,15 @@ const KEYINFO_ORDER_DESC = 1 const LEGACY_SCHEMA_TABLE = "sqlite_master" const LEGACY_TEMP_SCHEMA_TABLE = "sqlite_temp_master" const LITTLE_ENDIAN = 1234 -const LM_ID_BASE = 0 -const LM_ID_NEWLM = -1 const LOCATE_NOERR = 2 const LOCATE_VIEW = 1 -const LOCK_EX = 2 -const LOCK_MAND = 32 -const LOCK_NB = 4 -const LOCK_READ = 64 -const LOCK_RW = 192 -const LOCK_SH = 1 -const LOCK_UN = 8 -const LOCK_WRITE = 128 const LONGDOUBLE_TYPE = 0 const LOOKASIDE_SMALL = 128 const L_INCR = 1 const L_SET = 0 const L_XTND = 2 -const L_ctermid = 9 -const L_cuserid = 9 +const L_ctermid = 20 +const L_cuserid = 20 const L_tmpnam = 20 const M10d_Any = 1 const M10d_No = 2 @@ -774,7 +707,6 @@ const MADV_DOFORK = 11 const MADV_DONTDUMP = 16 const MADV_DONTFORK = 10 const MADV_DONTNEED = 4 -const MADV_DONTNEED_LOCKED = 24 const MADV_FREE = 8 const MADV_HUGEPAGE = 14 const MADV_HWPOISON = 100 @@ -783,11 +715,10 @@ const MADV_MERGEABLE = 12 const MADV_NOHUGEPAGE = 15 const MADV_NORMAL = 0 const MADV_PAGEOUT = 21 -const MADV_POPULATE_READ = 22 -const MADV_POPULATE_WRITE = 23 const MADV_RANDOM = 1 const MADV_REMOVE = 9 const MADV_SEQUENTIAL = 2 +const MADV_SOFT_OFFLINE = 101 const MADV_UNMERGEABLE = 13 const MADV_WILLNEED = 3 const MADV_WIPEONFORK = 18 @@ -802,6 +733,19 @@ const MAP_FIXED = 16 const MAP_FIXED_NOREPLACE = 1048576 const MAP_GROWSDOWN = 256 const MAP_HUGETLB = 262144 +const MAP_HUGE_16GB = 2281701376 +const MAP_HUGE_16KB = 939524096 +const MAP_HUGE_16MB = 1610612736 +const MAP_HUGE_1GB = 2013265920 +const MAP_HUGE_1MB = 1342177280 +const MAP_HUGE_256MB = 1879048192 +const MAP_HUGE_2GB = 2080374784 +const MAP_HUGE_2MB = 1409286144 +const MAP_HUGE_32MB = 1677721600 +const MAP_HUGE_512KB = 1275068416 +const MAP_HUGE_512MB = 1946157056 +const MAP_HUGE_64KB = 1073741824 +const MAP_HUGE_8MB = 1543503872 const MAP_HUGE_MASK = 63 const MAP_HUGE_SHIFT = 26 const MAP_LOCKED = 8192 @@ -816,7 +760,6 @@ const MAP_SYNC = 524288 const MAP_TYPE = 15 const MATH_ERREXCEPT = 2 const MATH_ERRNO = 1 -const MAXFLOAT = 0 const MAX_HANDLE_SZ = 128 const MAX_PATHNAME = 512 const MAX_SECTOR_SIZE = 65536 @@ -850,17 +793,6 @@ const MFD_ALLOW_SEALING = 2 const MFD_CLOEXEC = 1 const MFD_HUGETLB = 4 const MLOCK_ONFAULT = 1 -const MOD_CLKA = 32769 -const MOD_CLKB = 16384 -const MOD_ESTERROR = 8 -const MOD_FREQUENCY = 2 -const MOD_MAXERROR = 4 -const MOD_MICRO = 4096 -const MOD_NANO = 8192 -const MOD_OFFSET = 1 -const MOD_STATUS = 16 -const MOD_TAI = 128 -const MOD_TIMECONST = 32 const MREMAP_DONTUNMAP = 4 const MREMAP_FIXED = 2 const MREMAP_MAYMOVE = 1 @@ -869,112 +801,20 @@ const MS_ASYNC = 1 const MS_INVALIDATE = 2 const MS_SYNC = 4 const M_1_PI = 0 -const M_1_PIf = 0 -const M_1_PIf128 = 0 -const M_1_PIf32 = 0 -const M_1_PIf32x = 0 -const M_1_PIf64 = 0 -const M_1_PIf64x = 0 -const M_1_PIl = 0 const M_2_PI = 0 -const M_2_PIf = 0 -const M_2_PIf128 = 0 -const M_2_PIf32 = 0 -const M_2_PIf32x = 0 -const M_2_PIf64 = 0 -const M_2_PIf64x = 0 -const M_2_PIl = 0 const M_2_SQRTPI = 0 -const M_2_SQRTPIf = 0 -const M_2_SQRTPIf128 = 0 -const M_2_SQRTPIf32 = 0 -const M_2_SQRTPIf32x = 0 -const M_2_SQRTPIf64 = 0 -const M_2_SQRTPIf64x = 0 -const M_2_SQRTPIl = 0 const M_E = 0 -const M_Ef = 0 -const M_Ef128 = 0 -const M_Ef32 = 0 -const M_Ef32x = 0 -const M_Ef64 = 0 -const M_Ef64x = 0 -const M_El = 0 const M_LN10 = 0 -const M_LN10f = 0 -const M_LN10f128 = 0 -const M_LN10f32 = 0 -const M_LN10f32x = 0 -const M_LN10f64 = 0 -const M_LN10f64x = 0 -const M_LN10l = 0 const M_LN2 = 0 -const M_LN2f = 0 -const M_LN2f128 = 0 -const M_LN2f32 = 0 -const M_LN2f32x = 0 -const M_LN2f64 = 0 -const M_LN2f64x = 0 -const M_LN2l = 0 const M_LOG10E = 0 -const M_LOG10Ef = 0 -const M_LOG10Ef128 = 0 -const M_LOG10Ef32 = 0 -const M_LOG10Ef32x = 0 -const M_LOG10Ef64 = 0 -const M_LOG10Ef64x = 0 -const M_LOG10El = 0 const M_LOG2E = 0 -const M_LOG2Ef = 0 -const M_LOG2Ef128 = 0 -const M_LOG2Ef32 = 0 -const M_LOG2Ef32x = 0 -const M_LOG2Ef64 = 0 -const M_LOG2Ef64x = 0 -const M_LOG2El = 0 const M_PI = 3.141592653589793 const M_PI_2 = 0 -const M_PI_2f = 0 -const M_PI_2f128 = 0 -const M_PI_2f32 = 0 -const M_PI_2f32x = 0 -const M_PI_2f64 = 0 -const M_PI_2f64x = 0 -const M_PI_2l = 0 const M_PI_4 = 0 -const M_PI_4f = 0 -const M_PI_4f128 = 0 -const M_PI_4f32 = 0 -const M_PI_4f32x = 0 -const M_PI_4f64 = 0 -const M_PI_4f64x = 0 -const M_PI_4l = 0 -const M_PIf = 0 -const M_PIf128 = 0 -const M_PIf32 = 0 -const M_PIf32x = 0 -const M_PIf64 = 0 -const M_PIf64x = 0 -const M_PIl = 0 const M_SQRT1_2 = 0 -const M_SQRT1_2f = 0 -const M_SQRT1_2f128 = 0 -const M_SQRT1_2f32 = 0 -const M_SQRT1_2f32x = 0 -const M_SQRT1_2f64 = 0 -const M_SQRT1_2f64x = 0 -const M_SQRT1_2l = 0 const M_SQRT2 = 0 -const M_SQRT2f = 0 -const M_SQRT2f128 = 0 -const M_SQRT2f32 = 0 -const M_SQRT2f32x = 0 -const M_SQRT2f64 = 0 -const M_SQRT2f64x = 0 -const M_SQRT2l = 0 const NAN = 0 const NB = 3 -const NCC = 8 const NC_AllowAgg = 1 const NC_AllowWin = 16384 const NC_Complex = 8192 @@ -998,28 +838,39 @@ const NC_UEList = 128 const NC_UUpsert = 512 const NC_Where = 1048576 const NDEBUG = 1 -const NFDBITS = "__NFDBITS" const NN = 1 const NOT_WITHIN = 0 const NO_LOCK = 0 const N_6PACK = 7 const N_AX25 = 5 +const N_CAIF = 20 +const N_GIGASET_M101 = 16 +const N_GSM0710 = 21 const N_HCI = 15 const N_HDLC = 13 const N_IRDA = 11 const N_MASC = 8 const N_MOUSE = 2 +const N_NCI = 25 +const N_NULL = 27 const N_OR_COST = 3 const N_PPP = 3 +const N_PPS = 18 const N_PROFIBUS_FDL = 10 const N_R3964 = 9 +const N_SLCAN = 17 const N_SLIP = 1 const N_SMSBLOCK = 12 const N_SORT_BUCKET = 32 +const N_SPEAKUP = 26 const N_STATEMENT = 8 const N_STRIP = 4 const N_SYNC_PPP = 14 +const N_TI_WL = 22 +const N_TRACEROUTER = 24 +const N_TRACESINK = 23 const N_TTY = 0 +const N_V253 = 19 const N_X25 = 6 const OE_Abort = 2 const OE_Cascade = 10 @@ -1256,7 +1107,7 @@ const OP_Variable = 78 const OP_Yield = 12 const OP_ZeroOrNull = 92 const OS_VXWORKS = 0 -const O_ACCMODE = 3 +const O_ACCMODE = 2097155 const O_APPEND = 1024 const O_ASYNC = 8192 const O_BINARY = 0 @@ -1266,7 +1117,7 @@ const O_DIRECT = 16384 const O_DIRECTORY = 65536 const O_DSYNC = 4096 const O_EXCL = 128 -const O_FSYNC = 1052672 +const O_EXEC = 2097152 const O_LARGEFILE = 32768 const O_NDELAY = 2048 const O_NOATIME = 262144 @@ -1277,9 +1128,11 @@ const O_PATH = 2097152 const O_RDONLY = 0 const O_RDWR = 2 const O_RSYNC = 1052672 +const O_SEARCH = 2097152 const O_SYNC = 1052672 const O_TMPFILE = 4259840 const O_TRUNC = 512 +const O_TTY_INIT = 0 const O_WRONLY = 1 const P4_COLLSEQ = -2 const P4_DYNAMIC = -6 @@ -1357,8 +1210,7 @@ const PGHDR_MMAP = 32 const PGHDR_NEED_SYNC = 8 const PGHDR_WAL_APPEND = 64 const PGHDR_WRITEABLE = 4 -const PKEY_DISABLE_ACCESS = 1 -const PKEY_DISABLE_WRITE = 2 +const POSIX_CLOSE_RESTART = 0 const POSIX_FADV_DONTNEED = 4 const POSIX_FADV_NOREUSE = 5 const POSIX_FADV_NORMAL = 0 @@ -1476,9 +1328,6 @@ const RBU_UPDATE = 6 const RBU_ZIPVFS_CTRL_FILE_POINTER = 230439 const READMARK_NOT_USED = 4294967295 const READ_LOCK = 1 -const RENAME_EXCHANGE = 2 -const RENAME_NOREPLACE = 1 -const RENAME_WHITEOUT = 4 const RESERVED_BYTE = 1 const RESERVED_LOCK = 2 const RNDAWAY = 0 @@ -1487,8 +1336,7 @@ const ROWSET_ALLOCATION_SIZE = 1024 const ROWSET_ENTRY_PER_CHUNK = 1016 const ROWSET_NEXT = 2 const ROWSET_SORTED = 1 -const RTLD_BINDING_MASK = 3 -const RTLD_DEEPBIND = 8 +const RTLD_DI_LINKMAP = 2 const RTLD_GLOBAL = 256 const RTLD_LAZY = 1 const RTLD_LOCAL = 0 @@ -1521,18 +1369,14 @@ const RWH_WRITE_LIFE_EXTREME = 5 const RWH_WRITE_LIFE_LONG = 4 const RWH_WRITE_LIFE_MEDIUM = 3 const RWH_WRITE_LIFE_NONE = 1 -const RWH_WRITE_LIFE_NOT_SET = 0 const RWH_WRITE_LIFE_SHORT = 2 const R_OK = 4 const SAVEPOINT_BEGIN = 0 const SAVEPOINT_RELEASE = 1 const SAVEPOINT_ROLLBACK = 2 const SCHEMA_ROOT = 1 -const SEEK_CUR = 1 const SEEK_DATA = 3 -const SEEK_END = 2 const SEEK_HOLE = 4 -const SEEK_SET = 0 const SESSIONS_ROWID = "_rowid_" const SESSIONS_STRM_CHUNK_SIZE = 1024 const SESSION_MAX_BUFFER_SZ = 2147483391 @@ -1573,6 +1417,7 @@ const SHARED_SIZE = 510 const SIOCADDDLCI = 35200 const SIOCADDMULTI = 35121 const SIOCADDRT = 35083 +const SIOCATMARK = 35077 const SIOCDARP = 35155 const SIOCDELDLCI = 35201 const SIOCDELMULTI = 35122 @@ -1600,7 +1445,10 @@ const SIOCGIFNETMASK = 35099 const SIOCGIFPFLAGS = 35125 const SIOCGIFSLAVE = 35113 const SIOCGIFTXQLEN = 35138 +const SIOCGPGRP = 35076 const SIOCGRARP = 35169 +const SIOCGSTAMP = 2147518726 +const SIOCGSTAMPNS = 2147518727 const SIOCPROTOPRIVATE = 35296 const SIOCRTMSG = 35085 const SIOCSARP = 35157 @@ -1622,18 +1470,11 @@ const SIOCSIFNETMASK = 35100 const SIOCSIFPFLAGS = 35124 const SIOCSIFSLAVE = 35120 const SIOCSIFTXQLEN = 35139 +const SIOCSPGRP = 35074 const SIOCSRARP = 35170 const SIOGIFINDEX = 35123 const SLOT_2_0 = 2080895 const SLOT_4_2_0 = 4028612735 -const SNAN = 0 -const SNANF = 0 -const SNANF128 = 0 -const SNANF32 = 0 -const SNANF32X = 0 -const SNANF64 = 0 -const SNANF64X = 0 -const SNANL = 0 const SORTER_MAX_MERGE_COUNT = 16 const SORTER_TYPE_INTEGER = 1 const SORTER_TYPE_TEXT = 2 @@ -2261,7 +2102,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e" +const SQLITE_SOURCE_ID = "2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2369,8 +2210,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.46.0" -const SQLITE_VERSION_NUMBER = 3046000 +const SQLITE_VERSION = "3.46.1" +const SQLITE_VERSION_NUMBER = 3046001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -2402,59 +2243,29 @@ const SRT_Union = 1 const SRT_Upfrom = 15 const STATX_ALL = 4095 const STATX_ATIME = 32 -const STATX_ATTR_APPEND = 32 -const STATX_ATTR_AUTOMOUNT = 4096 -const STATX_ATTR_COMPRESSED = 4 -const STATX_ATTR_DAX = 2097152 -const STATX_ATTR_ENCRYPTED = 2048 -const STATX_ATTR_IMMUTABLE = 16 -const STATX_ATTR_MOUNT_ROOT = 8192 -const STATX_ATTR_NODUMP = 64 -const STATX_ATTR_VERITY = 1048576 const STATX_BASIC_STATS = 2047 const STATX_BLOCKS = 1024 const STATX_BTIME = 2048 const STATX_CTIME = 128 const STATX_GID = 16 const STATX_INO = 256 -const STATX_MNT_ID = 4096 const STATX_MODE = 2 const STATX_MTIME = 64 const STATX_NLINK = 4 const STATX_SIZE = 512 const STATX_TYPE = 1 const STATX_UID = 8 -const STATX__RESERVED = 2147483648 const STAT_GET_NDLT = 4 const STAT_GET_NEQ = 2 const STAT_GET_NLT = 3 const STAT_GET_ROWID = 1 const STAT_GET_STAT1 = 0 -const STA_CLK = 32768 -const STA_CLOCKERR = 4096 -const STA_DEL = 32 -const STA_FLL = 8 -const STA_FREQHOLD = 128 -const STA_INS = 16 -const STA_MODE = 16384 -const STA_NANO = 8192 -const STA_PLL = 1 -const STA_PPSERROR = 2048 -const STA_PPSFREQ = 2 -const STA_PPSJITTER = 512 -const STA_PPSSIGNAL = 256 -const STA_PPSTIME = 4 -const STA_PPSWANDER = 1024 -const STA_RONLY = 65280 -const STA_UNSYNC = 64 const STDERR_FILENO = 2 const STDIN_FILENO = 0 const STDOUT_FILENO = 1 const SYNC_FILE_RANGE_WAIT_AFTER = 4 const SYNC_FILE_RANGE_WAIT_BEFORE = 1 const SYNC_FILE_RANGE_WRITE = 2 -const SYNC_FILE_RANGE_WRITE_AND_WAIT = 7 -const S_BLKSIZE = 512 const S_IEXEC = 64 const S_IFBLK = 24576 const S_IFCHR = 8192 @@ -2487,7 +2298,6 @@ const TABTYP_VTAB = 1 const TCFLSH = 21515 const TCGETA = 21509 const TCGETS = 21505 -const TCGETS2 = 2147505194 const TCGETX = 21554 const TCSBRK = 21513 const TCSBRKP = 21541 @@ -2495,11 +2305,8 @@ const TCSETA = 21510 const TCSETAF = 21512 const TCSETAW = 21511 const TCSETS = 21506 -const TCSETS2 = 1073763371 const TCSETSF = 21508 -const TCSETSF2 = 1073763373 const TCSETSW = 21507 -const TCSETSW2 = 1073763372 const TCSETX = 21555 const TCSETXF = 21556 const TCSETXW = 21557 @@ -2543,16 +2350,16 @@ const TIME_UTC = 1 const TIOCCBRK = 21544 const TIOCCONS = 21533 const TIOCEXCL = 21516 -const TIOCGDEV = 2147505202 +const TIOCGDEV = 2147767346 const TIOCGETD = 21540 -const TIOCGEXCL = 2147505216 +const TIOCGEXCL = 2147767360 const TIOCGICOUNT = 21597 -const TIOCGISO7816 = 2147505218 +const TIOCGISO7816 = 2150126658 const TIOCGLCKTRMIOS = 21590 const TIOCGPGRP = 21519 -const TIOCGPKT = 2147505208 -const TIOCGPTLCK = 2147505209 -const TIOCGPTN = 2147505200 +const TIOCGPKT = 2147767352 +const TIOCGPTLCK = 2147767353 +const TIOCGPTN = 2147767344 const TIOCGPTPEER = 21569 const TIOCGRS485 = 21550 const TIOCGSERIAL = 21534 @@ -2572,6 +2379,9 @@ const TIOCM_CTS = 32 const TIOCM_DSR = 256 const TIOCM_DTR = 2 const TIOCM_LE = 1 +const TIOCM_LOOP = 32768 +const TIOCM_OUT1 = 8192 +const TIOCM_OUT2 = 16384 const TIOCM_RI = 128 const TIOCM_RNG = 128 const TIOCM_RTS = 4 @@ -2600,11 +2410,11 @@ const TIOCSERSETMULTI = 21595 const TIOCSERSWILD = 21589 const TIOCSER_TEMT = 1 const TIOCSETD = 21539 -const TIOCSIG = 1073763382 -const TIOCSISO7816 = 3221247043 +const TIOCSIG = 1074025526 +const TIOCSISO7816 = 3223868483 const TIOCSLCKTRMIOS = 21591 const TIOCSPGRP = 21520 -const TIOCSPTLCK = 1073763377 +const TIOCSPTLCK = 1074025521 const TIOCSRS485 = 21551 const TIOCSSERIAL = 21535 const TIOCSSOFTCAR = 21530 @@ -2796,7 +2606,7 @@ const TK_WHERE = 149 const TK_WINDOW = 164 const TK_WITH = 81 const TK_WITHOUT = 26 -const TMP_MAX = 238328 +const TMP_MAX = 10000 const TOKEN = 0 const TRANS_NONE = 0 const TRANS_READ = 1 @@ -2804,11 +2614,6 @@ const TRANS_WRITE = 2 const TREETRACE_ENABLED = 0 const TRIGGER_AFTER = 2 const TRIGGER_BEFORE = 1 -const TTYDEF_CFLAG = 0 -const TTYDEF_IFLAG = 0 -const TTYDEF_LFLAG = 0 -const TTYDEF_OFLAG = 0 -const TTYDEF_SPEED = 0 const UNIXFILE_DELETE = 32 const UNIXFILE_DIRSYNC = 8 const UNIXFILE_EXCL = 1 @@ -2855,8 +2660,6 @@ const WAL_RETRY_PROTOCOL_LIMIT = 100 const WAL_SAVEPOINT_NDATA = 4 const WAL_SHM_RDONLY = 2 const WAL_WRITE_LOCK = 0 -const WCONTINUED = 8 -const WEXITED = 4 const WHERE_AGG_DISTINCT = 1024 const WHERE_AUTO_INDEX = 16384 const WHERE_BIGNULL_SORT = 524288 @@ -2882,6 +2685,7 @@ const WHERE_IN_ABLE = 2048 const WHERE_IN_EARLYOUT = 262144 const WHERE_IN_SEEKSCAN = 1048576 const WHERE_IPK = 256 +const WHERE_KEEP_ALL_JOINS = 8192 const WHERE_MULTI_OR = 8192 const WHERE_OMIT_OFFSET = 16777216 const WHERE_ONEPASS_DESIRED = 4 @@ -2912,7 +2716,6 @@ const WINDOW_RETURN_ROW = 1 const WINDOW_STARTING_INT = 0 const WINDOW_STARTING_NUM = 3 const WNOHANG = 1 -const WNOWAIT = 16777216 const WO_ALL = 16383 const WO_AND = 1024 const WO_AUX = 64 @@ -2933,7 +2736,6 @@ const WRC_Abort = 2 const WRC_Continue = 0 const WRC_Prune = 1 const WRITE_LOCK = 2 -const WSTOPPED = 2 const WUNTRACED = 2 const W_OK = 2 const XN_EXPR = -2 @@ -2971,82 +2773,89 @@ const YY_REDUCE_MIN = -275 const YY_SHIFT_COUNT = 582 const YY_SHIFT_MAX = 2128 const YY_SHIFT_MIN = 0 -const _ALLOCA_H = 1 -const _ASSERT_H = 1 -const _BITS_BYTESWAP_H = 1 -const _BITS_ENDIANNESS_H = 1 -const _BITS_ENDIAN_H = 1 -const _BITS_ERRNO_H = 1 -const _BITS_LIBM_SIMD_DECL_STUBS_H = 1 -const _BITS_POSIX_OPT_H = 1 -const _BITS_PTHREADTYPES_ARCH_H = 1 -const _BITS_PTHREADTYPES_COMMON_H = 1 -const _BITS_STAT_H = 1 -const _BITS_STDINT_INTN_H = 1 -const _BITS_STDIO_LIM_H = 1 -const _BITS_STRUCT_STAT_H = 1 -const _BITS_TIME64_H = 1 -const _BITS_TIMEX_H = 1 -const _BITS_TIME_H = 1 -const _BITS_TYPESIZES_H = 1 -const _BITS_TYPES_H = 1 -const _BITS_TYPES_LOCALE_T_H = 1 -const _BITS_TYPES___LOCALE_T_H = 1 -const _BITS_UINTN_IDENTITY_H = 1 -const _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS = 0 -const _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 0 -const _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 0 -const _DLFCN_H = 1 -const _ENDIAN_H = 1 -const _ERRNO_H = 1 -const _FCNTL_H = 1 -const _FEATURES_H = 1 +const _CS_GNU_LIBC_VERSION = 2 +const _CS_GNU_LIBPTHREAD_VERSION = 3 +const _CS_PATH = 0 +const _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS = 4 +const _CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116 +const _CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117 +const _CS_POSIX_V6_ILP32_OFF32_LIBS = 1118 +const _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119 +const _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120 +const _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121 +const _CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122 +const _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123 +const _CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124 +const _CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125 +const _CS_POSIX_V6_LP64_OFF64_LIBS = 1126 +const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127 +const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128 +const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129 +const _CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130 +const _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131 +const _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1 +const _CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132 +const _CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133 +const _CS_POSIX_V7_ILP32_OFF32_LIBS = 1134 +const _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135 +const _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136 +const _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137 +const _CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138 +const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139 +const _CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140 +const _CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141 +const _CS_POSIX_V7_LP64_OFF64_LIBS = 1142 +const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143 +const _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144 +const _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145 +const _CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146 +const _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147 +const _CS_POSIX_V7_THREADS_CFLAGS = 1150 +const _CS_POSIX_V7_THREADS_LDFLAGS = 1151 +const _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 5 +const _CS_V6_ENV = 1148 +const _CS_V7_ENV = 1149 const _FILE_OFFSET_BITS = 64 -const _GETOPT_CORE_H = 1 -const _GETOPT_POSIX_H = 1 +const _GNU_SOURCE = 1 const _ILP32 = 1 -const _IOC_DIRBITS = 2 -const _IOC_DIRMASK = 3 -const _IOC_DIRSHIFT = 30 const _IOC_NONE = 0 -const _IOC_NRBITS = 8 -const _IOC_NRMASK = 255 -const _IOC_NRSHIFT = 0 const _IOC_READ = 2 -const _IOC_SIZEBITS = 14 -const _IOC_SIZEMASK = 16383 -const _IOC_SIZESHIFT = 16 -const _IOC_TYPEBITS = 8 -const _IOC_TYPEMASK = 255 -const _IOC_TYPESHIFT = 8 const _IOC_WRITE = 1 const _IOFBF = 0 const _IOLBF = 1 const _IONBF = 2 -const _IO_EOF_SEEN = 16 -const _IO_ERR_SEEN = 32 -const _IO_USER_LOCK = 32768 +const _LARGEFILE64_SOURCE = 1 +const _LARGEFILE_SOURCE = 1 const _LARGE_FILE = 1 -const _LFS64_ASYNCHRONOUS_IO = 1 -const _LFS64_LARGEFILE = 1 -const _LFS64_STDIO = 1 -const _LFS_ASYNCHRONOUS_IO = 1 -const _LFS_LARGEFILE = 1 -const _MATH_H = 1 -const _POSIX2_CHAR_TERM = 200809 +const _PC_2_SYMLINKS = 20 +const _PC_ALLOC_SIZE_MIN = 18 +const _PC_ASYNC_IO = 10 +const _PC_CHOWN_RESTRICTED = 6 +const _PC_FILESIZEBITS = 13 +const _PC_LINK_MAX = 0 +const _PC_MAX_CANON = 1 +const _PC_MAX_INPUT = 2 +const _PC_NAME_MAX = 3 +const _PC_NO_TRUNC = 7 +const _PC_PATH_MAX = 4 +const _PC_PIPE_BUF = 5 +const _PC_PRIO_IO = 11 +const _PC_REC_INCR_XFER_SIZE = 14 +const _PC_REC_MAX_XFER_SIZE = 15 +const _PC_REC_MIN_XFER_SIZE = 16 +const _PC_REC_XFER_ALIGN = 17 +const _PC_SOCK_MAXBUF = 12 +const _PC_SYMLINK_MAX = 19 +const _PC_SYNC_IO = 9 +const _PC_VDISABLE = 8 const _POSIX2_C_BIND = 200809 -const _POSIX2_C_DEV = 200809 -const _POSIX2_C_VERSION = 200809 -const _POSIX2_LOCALEDEF = 200809 -const _POSIX2_SW_DEV = 200809 const _POSIX2_VERSION = 200809 const _POSIX_ADVISORY_INFO = 200809 const _POSIX_ASYNCHRONOUS_IO = 200809 -const _POSIX_ASYNC_IO = 1 const _POSIX_BARRIERS = 200809 -const _POSIX_CHOWN_RESTRICTED = 0 +const _POSIX_CHOWN_RESTRICTED = 1 const _POSIX_CLOCK_SELECTION = 200809 -const _POSIX_CPUTIME = 0 +const _POSIX_CPUTIME = 200809 const _POSIX_FSYNC = 200809 const _POSIX_IPV6 = 200809 const _POSIX_JOB_CONTROL = 1 @@ -3055,14 +2864,11 @@ const _POSIX_MEMLOCK = 200809 const _POSIX_MEMLOCK_RANGE = 200809 const _POSIX_MEMORY_PROTECTION = 200809 const _POSIX_MESSAGE_PASSING = 200809 -const _POSIX_MONOTONIC_CLOCK = 0 +const _POSIX_MONOTONIC_CLOCK = 200809 const _POSIX_NO_TRUNC = 1 -const _POSIX_PRIORITIZED_IO = 200809 -const _POSIX_PRIORITY_SCHEDULING = 200809 const _POSIX_RAW_SOCKETS = 200809 const _POSIX_READER_WRITER_LOCKS = 200809 const _POSIX_REALTIME_SIGNALS = 200809 -const _POSIX_REENTRANT_FUNCTIONS = 1 const _POSIX_REGEXP = 1 const _POSIX_SAVED_IDS = 1 const _POSIX_SEMAPHORES = 200809 @@ -3070,67 +2876,168 @@ const _POSIX_SHARED_MEMORY_OBJECTS = 200809 const _POSIX_SHELL = 1 const _POSIX_SPAWN = 200809 const _POSIX_SPIN_LOCKS = 200809 -const _POSIX_SPORADIC_SERVER = -1 -const _POSIX_SYNCHRONIZED_IO = 200809 const _POSIX_THREADS = 200809 const _POSIX_THREAD_ATTR_STACKADDR = 200809 const _POSIX_THREAD_ATTR_STACKSIZE = 200809 -const _POSIX_THREAD_CPUTIME = 0 +const _POSIX_THREAD_CPUTIME = 200809 const _POSIX_THREAD_PRIORITY_SCHEDULING = 200809 -const _POSIX_THREAD_PRIO_INHERIT = 200809 -const _POSIX_THREAD_PRIO_PROTECT = 200809 const _POSIX_THREAD_PROCESS_SHARED = 200809 -const _POSIX_THREAD_ROBUST_PRIO_INHERIT = 200809 -const _POSIX_THREAD_ROBUST_PRIO_PROTECT = -1 const _POSIX_THREAD_SAFE_FUNCTIONS = 200809 -const _POSIX_THREAD_SPORADIC_SERVER = -1 const _POSIX_TIMEOUTS = 200809 const _POSIX_TIMERS = 200809 -const _POSIX_TRACE = -1 -const _POSIX_TRACE_EVENT_FILTER = -1 -const _POSIX_TRACE_INHERIT = -1 -const _POSIX_TRACE_LOG = -1 -const _POSIX_TYPED_MEMORY_OBJECTS = -1 -const _POSIX_V6_ILP32_OFF32 = 1 const _POSIX_V6_ILP32_OFFBIG = 1 -const _POSIX_V7_ILP32_OFF32 = 1 const _POSIX_V7_ILP32_OFFBIG = 1 const _POSIX_VDISABLE = 0 const _POSIX_VERSION = 200809 -const _PRINTF_NAN_LEN_MAX = 4 -const _SC_PAGE_SIZE = 0 -const _SIGSET_NWORDS = 1024 +const _REDIR_TIME64 = 1 +const _SC_2_CHAR_TERM = 95 +const _SC_2_C_BIND = 47 +const _SC_2_C_DEV = 48 +const _SC_2_FORT_DEV = 49 +const _SC_2_FORT_RUN = 50 +const _SC_2_LOCALEDEF = 52 +const _SC_2_PBS = 168 +const _SC_2_PBS_ACCOUNTING = 169 +const _SC_2_PBS_CHECKPOINT = 175 +const _SC_2_PBS_LOCATE = 170 +const _SC_2_PBS_MESSAGE = 171 +const _SC_2_PBS_TRACK = 172 +const _SC_2_SW_DEV = 51 +const _SC_2_UPE = 97 +const _SC_2_VERSION = 46 +const _SC_ADVISORY_INFO = 132 +const _SC_AIO_LISTIO_MAX = 23 +const _SC_AIO_MAX = 24 +const _SC_AIO_PRIO_DELTA_MAX = 25 +const _SC_ARG_MAX = 0 +const _SC_ASYNCHRONOUS_IO = 12 +const _SC_ATEXIT_MAX = 87 +const _SC_AVPHYS_PAGES = 86 +const _SC_BARRIERS = 133 +const _SC_BC_BASE_MAX = 36 +const _SC_BC_DIM_MAX = 37 +const _SC_BC_SCALE_MAX = 38 +const _SC_BC_STRING_MAX = 39 +const _SC_CHILD_MAX = 1 +const _SC_CLK_TCK = 2 +const _SC_CLOCK_SELECTION = 137 +const _SC_COLL_WEIGHTS_MAX = 40 +const _SC_CPUTIME = 138 +const _SC_DELAYTIMER_MAX = 26 +const _SC_EXPR_NEST_MAX = 42 +const _SC_FSYNC = 15 +const _SC_GETGR_R_SIZE_MAX = 69 +const _SC_GETPW_R_SIZE_MAX = 70 +const _SC_HOST_NAME_MAX = 180 +const _SC_IOV_MAX = 60 +const _SC_IPV6 = 235 +const _SC_JOB_CONTROL = 7 +const _SC_LINE_MAX = 43 +const _SC_LOGIN_NAME_MAX = 71 +const _SC_MAPPED_FILES = 16 +const _SC_MEMLOCK = 17 +const _SC_MEMLOCK_RANGE = 18 +const _SC_MEMORY_PROTECTION = 19 +const _SC_MESSAGE_PASSING = 20 +const _SC_MINSIGSTKSZ = 249 +const _SC_MONOTONIC_CLOCK = 149 +const _SC_MQ_OPEN_MAX = 27 +const _SC_MQ_PRIO_MAX = 28 +const _SC_NGROUPS_MAX = 3 +const _SC_NPROCESSORS_CONF = 83 +const _SC_NPROCESSORS_ONLN = 84 +const _SC_NZERO = 109 +const _SC_OPEN_MAX = 4 +const _SC_PAGESIZE = 30 +const _SC_PAGE_SIZE = 30 +const _SC_PASS_MAX = 88 +const _SC_PHYS_PAGES = 85 +const _SC_PRIORITIZED_IO = 13 +const _SC_PRIORITY_SCHEDULING = 10 +const _SC_RAW_SOCKETS = 236 +const _SC_READER_WRITER_LOCKS = 153 +const _SC_REALTIME_SIGNALS = 9 +const _SC_REGEXP = 155 +const _SC_RE_DUP_MAX = 44 +const _SC_RTSIG_MAX = 31 +const _SC_SAVED_IDS = 8 +const _SC_SEMAPHORES = 21 +const _SC_SEM_NSEMS_MAX = 32 +const _SC_SEM_VALUE_MAX = 33 +const _SC_SHARED_MEMORY_OBJECTS = 22 +const _SC_SHELL = 157 +const _SC_SIGQUEUE_MAX = 34 +const _SC_SIGSTKSZ = 250 +const _SC_SPAWN = 159 +const _SC_SPIN_LOCKS = 154 +const _SC_SPORADIC_SERVER = 160 +const _SC_SS_REPL_MAX = 241 +const _SC_STREAMS = 174 +const _SC_STREAM_MAX = 5 +const _SC_SYMLOOP_MAX = 173 +const _SC_SYNCHRONIZED_IO = 14 +const _SC_THREADS = 67 +const _SC_THREAD_ATTR_STACKADDR = 77 +const _SC_THREAD_ATTR_STACKSIZE = 78 +const _SC_THREAD_CPUTIME = 139 +const _SC_THREAD_DESTRUCTOR_ITERATIONS = 73 +const _SC_THREAD_KEYS_MAX = 74 +const _SC_THREAD_PRIORITY_SCHEDULING = 79 +const _SC_THREAD_PRIO_INHERIT = 80 +const _SC_THREAD_PRIO_PROTECT = 81 +const _SC_THREAD_PROCESS_SHARED = 82 +const _SC_THREAD_ROBUST_PRIO_INHERIT = 247 +const _SC_THREAD_ROBUST_PRIO_PROTECT = 248 +const _SC_THREAD_SAFE_FUNCTIONS = 68 +const _SC_THREAD_SPORADIC_SERVER = 161 +const _SC_THREAD_STACK_MIN = 75 +const _SC_THREAD_THREADS_MAX = 76 +const _SC_TIMEOUTS = 164 +const _SC_TIMERS = 11 +const _SC_TIMER_MAX = 35 +const _SC_TRACE = 181 +const _SC_TRACE_EVENT_FILTER = 182 +const _SC_TRACE_EVENT_NAME_MAX = 242 +const _SC_TRACE_INHERIT = 183 +const _SC_TRACE_LOG = 184 +const _SC_TRACE_NAME_MAX = 243 +const _SC_TRACE_SYS_MAX = 244 +const _SC_TRACE_USER_EVENT_MAX = 245 +const _SC_TTY_NAME_MAX = 72 +const _SC_TYPED_MEMORY_OBJECTS = 165 +const _SC_TZNAME_MAX = 6 +const _SC_UIO_MAXIOV = 60 +const _SC_V6_ILP32_OFF32 = 176 +const _SC_V6_ILP32_OFFBIG = 177 +const _SC_V6_LP64_OFF64 = 178 +const _SC_V6_LPBIG_OFFBIG = 179 +const _SC_V7_ILP32_OFF32 = 237 +const _SC_V7_ILP32_OFFBIG = 238 +const _SC_V7_LP64_OFF64 = 239 +const _SC_V7_LPBIG_OFFBIG = 240 +const _SC_VERSION = 29 +const _SC_XBS5_ILP32_OFF32 = 125 +const _SC_XBS5_ILP32_OFFBIG = 126 +const _SC_XBS5_LP64_OFF64 = 127 +const _SC_XBS5_LPBIG_OFFBIG = 128 +const _SC_XOPEN_CRYPT = 92 +const _SC_XOPEN_ENH_I18N = 93 +const _SC_XOPEN_LEGACY = 129 +const _SC_XOPEN_REALTIME = 130 +const _SC_XOPEN_REALTIME_THREADS = 131 +const _SC_XOPEN_SHM = 94 +const _SC_XOPEN_STREAMS = 246 +const _SC_XOPEN_UNIX = 91 +const _SC_XOPEN_VERSION = 89 +const _SC_XOPEN_XCU_VERSION = 90 +const _SC_XOPEN_XPG2 = 98 +const _SC_XOPEN_XPG3 = 99 +const _SC_XOPEN_XPG4 = 100 const _STDC_PREDEF_H = 1 -const _STDIO_H = 1 -const _STDLIB_H = 1 -const _STRINGS_H = 1 -const _STRING_H = 1 -const _STRUCT_TIMESPEC = 1 -const _SYS_CDEFS_H = 1 -const _SYS_IOCTL_H = 1 -const _SYS_MMAN_H = 1 -const _SYS_SELECT_H = 1 -const _SYS_STAT_H = 1 -const _SYS_TIME_H = 1 -const _SYS_TYPES_H = 1 -const _THREAD_MUTEX_INTERNAL_H = 1 -const _THREAD_SHARED_TYPES_H = 1 -const _TIME_H = 1 -const _UNISTD_H = 1 -const _XBS5_ILP32_OFF32 = 1 -const _XBS5_ILP32_OFFBIG = 1 const _XOPEN_ENH_I18N = 1 -const _XOPEN_LEGACY = 1 -const _XOPEN_REALTIME = 1 -const _XOPEN_REALTIME_THREADS = 1 -const _XOPEN_SHM = 1 +const _XOPEN_SOURCE = 600 const _XOPEN_UNIX = 1 const _XOPEN_VERSION = 700 -const _XOPEN_XCU_VERSION = 4 -const _XOPEN_XPG2 = 1 -const _XOPEN_XPG3 = 1 -const _XOPEN_XPG4 = 1 -const __ASSERT_VOID_CAST = 0 const __ATOMIC_ACQUIRE = 2 const __ATOMIC_ACQ_REL = 4 const __ATOMIC_CONSUME = 1 @@ -3141,18 +3048,10 @@ const __ATOMIC_RELEASE = 3 const __ATOMIC_SEQ_CST = 5 const __BIGGEST_ALIGNMENT__ = 16 const __BIG_ENDIAN = 4321 -const __BIT_TYPES_DEFINED__ = 1 -const __BLKCNT64_T_TYPE = 0 -const __BLKCNT_T_TYPE = "__SYSCALL_SLONG_TYPE" -const __BLKSIZE_T_TYPE = "__SYSCALL_SLONG_TYPE" const __BYTE_ORDER = 1234 const __BYTE_ORDER__ = 1234 const __CCGO__ = 1 const __CHAR_BIT__ = 8 -const __CLOCKID_T_TYPE = 0 -const __CLOCK_T_TYPE = "__SYSCALL_SLONG_TYPE" -const __CPU_MASK_TYPE = "__SYSCALL_ULONG_TYPE" -const __DADDR_T_TYPE = 0 const __DBL_DECIMAL_DIG__ = 17 const __DBL_DIG__ = 15 const __DBL_HAS_DENORM__ = 1 @@ -3188,12 +3087,8 @@ const __DEC64_SUBNORMAL_MIN__ = 0 const __DECIMAL_BID_FORMAT__ = 1 const __DECIMAL_DIG__ = 17 const __DEC_EVAL_METHOD__ = 2 -const __DEV_T_TYPE = 0 const __ELF__ = 1 -const __FD_SETSIZE = 1024 -const __FILE_defined = 1 const __FINITE_MATH_ONLY__ = 0 -const __FLOAT_WORD_ORDER = 1234 const __FLOAT_WORD_ORDER__ = 1234 const __FLT128_DECIMAL_DIG__ = 36 const __FLT128_DENORM_MIN__ = 0 @@ -3294,21 +3189,7 @@ const __FLT_MIN_EXP__ = -125 const __FLT_MIN__ = 0 const __FLT_NORM_MAX__ = 0 const __FLT_RADIX__ = 2 -const __FP_LOGB0_IS_MIN = 1 -const __FP_LOGBNAN_IS_MIN = 1 -const __FP_LONG_MAX = 2147483647 -const __FSBLKCNT64_T_TYPE = 0 -const __FSBLKCNT_T_TYPE = "__SYSCALL_ULONG_TYPE" -const __FSFILCNT64_T_TYPE = 0 -const __FSFILCNT_T_TYPE = "__SYSCALL_ULONG_TYPE" -const __FSWORD_T_TYPE = 0 const __FUNCTION__ = 0 -const __F_GETOWN = 9 -const __F_GETOWN_EX = 16 -const __F_GETSIG = 11 -const __F_SETOWN = 8 -const __F_SETOWN_EX = 15 -const __F_SETSIG = 10 const __GCC_ASM_FLAG_OUTPUTS__ = 1 const __GCC_ATOMIC_BOOL_LOCK_FREE = 2 const __GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2 @@ -3330,10 +3211,6 @@ const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1 const __GCC_IEC_559 = 2 const __GCC_IEC_559_COMPLEX = 2 -const __GID_T_TYPE = "__U32_TYPE" -const __GLIBC_FLT_EVAL_METHOD = 2 -const __GLIBC_MINOR__ = 36 -const __GLIBC__ = 2 const __GNUC_EXECUTION_CHARSET_NAME = "UTF-8" const __GNUC_MINOR__ = 2 const __GNUC_PATCHLEVEL__ = 0 @@ -3341,33 +3218,8 @@ const __GNUC_STDC_INLINE__ = 1 const __GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-32LE" const __GNUC__ = 12 const __GXX_ABI_VERSION = 1017 -const __HAVE_DISTINCT_FLOAT128 = 1 -const __HAVE_DISTINCT_FLOAT128X = 0 -const __HAVE_DISTINCT_FLOAT16 = 0 -const __HAVE_DISTINCT_FLOAT32 = 0 -const __HAVE_DISTINCT_FLOAT32X = 0 -const __HAVE_DISTINCT_FLOAT64 = 0 -const __HAVE_DISTINCT_FLOAT64X = 0 -const __HAVE_FLOAT128 = 1 -const __HAVE_FLOAT128X = 0 -const __HAVE_FLOAT128_UNLIKE_LDBL = 1 -const __HAVE_FLOAT16 = 0 -const __HAVE_FLOAT32 = 1 -const __HAVE_FLOAT32X = 1 -const __HAVE_FLOAT64 = 1 -const __HAVE_FLOAT64X = 1 -const __HAVE_FLOAT64X_LONG_DOUBLE = 1 -const __HAVE_FLOATN_NOT_TYPEDEF = 1 -const __HAVE_GENERIC_SELECTION = 1 const __HAVE_SPECULATION_SAFE_VALUE = 1 -const __ID_T_TYPE = "__U32_TYPE" -const __ILP32_OFF32_CFLAGS = "-m32" -const __ILP32_OFF32_LDFLAGS = "-m32" -const __ILP32_OFFBIG_CFLAGS = "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -const __ILP32_OFFBIG_LDFLAGS = "-m32" const __ILP32__ = 1 -const __INO64_T_TYPE = 0 -const __INO_T_TYPE = "__SYSCALL_ULONG_TYPE" const __INT16_MAX__ = 32767 const __INT32_MAX__ = 2147483647 const __INT32_TYPE__ = 0 @@ -3399,8 +3251,6 @@ const __INT_LEAST8_MAX__ = 127 const __INT_LEAST8_WIDTH__ = 8 const __INT_MAX__ = 2147483647 const __INT_WIDTH__ = 32 -const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = 0 -const __KEY_T_TYPE = 0 const __LAHF_SAHF__ = 1 const __LDBL_DECIMAL_DIG__ = 17 const __LDBL_DENORM_MIN__ = 0 @@ -3418,52 +3268,25 @@ const __LDBL_MIN_10_EXP__ = -307 const __LDBL_MIN_EXP__ = -1021 const __LDBL_MIN__ = 0 const __LDBL_NORM_MAX__ = 0 -const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = 0 -const __LEAF = 0 const __LITTLE_ENDIAN = 1234 const __LONG_DOUBLE_64__ = 1 const __LONG_LONG_MAX__ = 9223372036854775807 const __LONG_LONG_WIDTH__ = 64 +const __LONG_MAX = 2147483647 const __LONG_MAX__ = 2147483647 const __LONG_WIDTH__ = 32 -const __LP64_OFF64_CFLAGS = "-m64" -const __LP64_OFF64_LDFLAGS = "-m64" -const __MATH_DECLARE_LDOUBLE = 1 -const __MODE_T_TYPE = "__U32_TYPE" -const __NLINK_T_TYPE = "__UWORD_TYPE" const __NO_INLINE__ = 1 -const __OFF64_T_TYPE = 0 -const __OFF_T_TYPE = "__SYSCALL_SLONG_TYPE" const __ORDER_BIG_ENDIAN__ = 4321 const __ORDER_LITTLE_ENDIAN__ = 1234 const __ORDER_PDP_ENDIAN__ = 3412 -const __O_CLOEXEC = 524288 -const __O_DIRECT = 16384 -const __O_DIRECTORY = 65536 -const __O_DSYNC = 4096 -const __O_LARGEFILE = 32768 -const __O_NOATIME = 262144 -const __O_NOFOLLOW = 131072 -const __O_PATH = 2097152 -const __O_TMPFILE = 4259840 const __PDP_ENDIAN = 3412 const __PIC__ = 2 -const __PID_T_TYPE = 0 const __PIE__ = 2 -const __POSIX2_THIS_VERSION = 200809 -const __POSIX_FADV_DONTNEED = 4 -const __POSIX_FADV_NOREUSE = 5 const __PRAGMA_REDEFINE_EXTNAME = 1 const __PRETTY_FUNCTION__ = 0 -const __PTHREAD_MUTEX_HAVE_PREV = 0 const __PTRDIFF_MAX__ = 2147483647 const __PTRDIFF_TYPE__ = 0 const __PTRDIFF_WIDTH__ = 32 -const __RLIM64_T_TYPE = 0 -const __RLIM_T_MATCHES_RLIM64_T = 0 -const __RLIM_T_TYPE = "__SYSCALL_ULONG_TYPE" -const __S32_TYPE = 0 -const __S64_TYPE = 0 const __SCHAR_MAX__ = 127 const __SCHAR_WIDTH__ = 8 const __SEG_FS = 1 @@ -3483,15 +3306,6 @@ const __SIZEOF_LONG_DOUBLE__ = 8 const __SIZEOF_LONG_LONG__ = 8 const __SIZEOF_LONG__ = 4 const __SIZEOF_POINTER__ = 4 -const __SIZEOF_PTHREAD_ATTR_T = 36 -const __SIZEOF_PTHREAD_BARRIERATTR_T = 4 -const __SIZEOF_PTHREAD_BARRIER_T = 20 -const __SIZEOF_PTHREAD_CONDATTR_T = 4 -const __SIZEOF_PTHREAD_COND_T = 48 -const __SIZEOF_PTHREAD_MUTEXATTR_T = 4 -const __SIZEOF_PTHREAD_MUTEX_T = 24 -const __SIZEOF_PTHREAD_RWLOCKATTR_T = 8 -const __SIZEOF_PTHREAD_RWLOCK_T = 32 const __SIZEOF_PTRDIFF_T__ = 4 const __SIZEOF_SHORT__ = 2 const __SIZEOF_SIZE_T__ = 4 @@ -3500,9 +3314,6 @@ const __SIZEOF_WINT_T__ = 4 const __SIZE_MAX__ = 4294967295 const __SIZE_WIDTH__ = 32 const __SQLITESESSION_H_ = 1 -const __SQUAD_TYPE = 0 -const __SSIZE_T_TYPE = 0 -const __STATFS_MATCHES_STATFS64 = 0 const __STDC_HOSTED__ = 1 const __STDC_IEC_559_COMPLEX__ = 1 const __STDC_IEC_559__ = 1 @@ -3513,31 +3324,6 @@ const __STDC_UTF_16__ = 1 const __STDC_UTF_32__ = 1 const __STDC_VERSION__ = 201710 const __STDC__ = 1 -const __SUSECONDS64_T_TYPE = 0 -const __SUSECONDS_T_TYPE = "__SYSCALL_SLONG_TYPE" -const __SWORD_TYPE = 0 -const __SYSCALL_SLONG_TYPE = "__SLONGWORD_TYPE" -const __SYSCALL_ULONG_TYPE = "__ULONGWORD_TYPE" -const __S_IEXEC = 64 -const __S_IFBLK = 24576 -const __S_IFCHR = 8192 -const __S_IFDIR = 16384 -const __S_IFIFO = 4096 -const __S_IFLNK = 40960 -const __S_IFMT = 61440 -const __S_IFREG = 32768 -const __S_IFSOCK = 49152 -const __S_IREAD = 256 -const __S_ISGID = 1024 -const __S_ISUID = 2048 -const __S_ISVTX = 512 -const __S_IWRITE = 128 -const __TIME64_T_TYPE = 0 -const __TIMER_T_TYPE = 0 -const __TIMESIZE = 32 -const __TIME_T_TYPE = "__SYSCALL_SLONG_TYPE" -const __U64_TYPE = 0 -const __UID_T_TYPE = "__U32_TYPE" const __UINT16_MAX__ = 65535 const __UINT32_MAX__ = 4294967295 const __UINT64_MAX__ = 18446744073709551615 @@ -3552,62 +3338,37 @@ const __UINT_LEAST16_MAX__ = 65535 const __UINT_LEAST32_MAX__ = 4294967295 const __UINT_LEAST64_MAX__ = 18446744073709551615 const __UINT_LEAST8_MAX__ = 255 -const __UQUAD_TYPE = 0 -const __USECONDS_T_TYPE = "__U32_TYPE" +const __USE_TIME_BITS64 = 1 const __VERSION__ = "12.2.0" -const __WALL = 1073741824 const __WCHAR_MAX__ = 2147483647 const __WCHAR_MIN__ = -2147483648 const __WCHAR_WIDTH__ = 32 -const __WCLONE = 2147483648 -const __WCOREFLAG = 128 const __WINT_MAX__ = 4294967295 const __WINT_MIN__ = 0 const __WINT_WIDTH__ = 32 -const __WNOTHREAD = 536870912 -const __WORDSIZE = 32 -const __WORDSIZE32_PTRDIFF_LONG = 0 -const __WORDSIZE32_SIZE_ULONG = 0 -const __WORDSIZE_TIME64_COMPAT32 = 0 -const __W_CONTINUED = 65535 -const ____FILE_defined = 1 -const _____fpos64_t_defined = 1 -const _____fpos_t_defined = 1 -const ____mbstate_t_defined = 1 -const __clock_t_defined = 1 -const __clockid_t_defined = 1 const __code_model_32__ = 1 -const __cookie_io_functions_t_defined = 1 -const __error_t_defined = 1 -const __glibc_c99_flexarr_available = 1 const __gnu_linux__ = 1 -const __have_pthread_attr_t = 1 const __i386 = 1 const __i386__ = 1 const __i686 = 1 const __i686__ = 1 -const __iovec_defined = 1 -const __itimerspec_defined = 1 -const __ldiv_t_defined = 1 +const __inline = 0 const __linux = 1 const __linux__ = 1 -const __lldiv_t_defined = 1 const __pentiumpro = 1 const __pentiumpro__ = 1 const __pic__ = 2 const __pie__ = 2 -const __ptr_t = 0 -const __sigset_t_defined = 1 -const __statx_defined = 1 -const __statx_timestamp_defined = 1 -const __struct_FILE_defined = 1 -const __struct_tm_defined = 1 -const __time_t_defined = 1 -const __timer_t_defined = 1 -const __timeval_defined = 1 +const __restrict = 0 +const __restrict_arr = 0 +const __tm_gmtoff = 0 +const __tm_zone = 0 const __unix = 1 const __unix__ = 1 +const alloca = 0 const bBatch = 0 +const blkcnt64_t = 0 +const creat64 = 0 const cume_distFinalizeFunc = 0 const errno = 0 const etBUFSIZE = 70 @@ -3629,9 +3390,23 @@ const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 +const fallocate64 = 0 const fdatasync = 0 +const fgetpos64 = 0 const first_valueInvFunc = 0 const first_valueValueFunc = 0 +const flock64 = 0 +const fopen64 = 0 +const fpos64_t = 0 +const freopen64 = 0 +const fsblkcnt64_t = 0 +const fseeko64 = 0 +const fsetpos64 = 0 +const fsfilcnt64_t = 0 +const fstat64 = 0 +const fstatat64 = 0 +const ftello64 = 0 +const ftruncate64 = 0 const fts5GetVarint = 0 const fts5YYDYNSTACK = 0 const fts5YYFREE = 0 @@ -3666,15 +3441,30 @@ const fts5YY_SHIFT_MIN = 0 const get4byte = 0 const getVarint = 0 const i386 = 1 +const ino64_t = 0 const linux = 1 -const math_errhandling = 3 +const lockf64 = 0 +const loff_t = 0 +const lseek64 = 0 +const lstat64 = 0 +const math_errhandling = 2 const mem0 = 0 +const mkostemp64 = 0 +const mkostemps64 = 0 +const mkstemp64 = 0 +const mkstemps64 = 0 +const mmap64 = 0 const noopFunc = 0 const nth_valueInvFunc = 0 const nth_valueValueFunc = 0 const ntileFinalizeFunc = 0 +const off64_t = 0 +const open64 = 0 +const openat64 = 0 const pcache1 = 0 const percent_rankFinalizeFunc = 0 +const posix_fadvise64 = 0 +const posix_fallocate64 = 0 const pread64 = 0 const put4byte = 0 const putVarint = 0 @@ -3688,6 +3478,8 @@ const sqlite3ParserCTX_PDECL = 0 const sqlite3ParserTOKENTYPE = 0 const sqlite3Parser_ENGINEALWAYSONSTACK = 1 const sqlite3StrNICmp = 0 +const stat64 = 0 +const static_assert = 0 const threadid = 0 const tkCREATE = 4 const tkEND = 7 @@ -3697,6 +3489,8 @@ const tkSEMI = 0 const tkTEMP = 5 const tkTRIGGER = 6 const tkWS = 1 +const tmpfile64 = 0 +const truncate64 = 0 const unix = 1 const vfsList = 0 const wsdAutoext = 0 @@ -3712,8 +3506,6 @@ type t__predefined_wchar_t = int32 type t__predefined_ptrdiff_t = int32 -type t__gnuc_va_list = uintptr - type Tva_list = uintptr type va_list = Tva_list @@ -6995,266 +6787,28 @@ type Tsize_t = uint32 type size_t = Tsize_t -type t__u_char = uint8 - -type t__u_short = uint16 - -type t__u_int = uint32 - -type t__u_long = uint32 - -type t__int8_t = int8 - -type t__uint8_t = uint8 - -type t__int16_t = int16 - -type t__uint16_t = uint16 - -type t__int32_t = int32 - -type t__uint32_t = uint32 - -type t__int64_t = int64 - -type t__uint64_t = uint64 - -type t__int_least8_t = int8 - -type t__uint_least8_t = uint8 - -type t__int_least16_t = int16 - -type t__uint_least16_t = uint16 - -type t__int_least32_t = int32 - -type t__uint_least32_t = uint32 - -type t__int_least64_t = int64 - -type t__uint_least64_t = uint64 - -type t__quad_t = int64 - -type t__u_quad_t = uint64 - -type t__intmax_t = int64 - -type t__uintmax_t = uint64 - -type t__dev_t = uint64 - -type t__uid_t = uint32 - -type t__gid_t = uint32 - -type t__ino_t = uint32 - -type t__ino64_t = uint64 - -type t__mode_t = uint32 - -type t__nlink_t = uint32 - -type t__off_t = int32 - -type t__off64_t = int64 - -type t__pid_t = int32 - -type t__fsid_t = struct { - F__val [2]int32 -} - -type t__clock_t = int32 - -type t__rlim_t = uint32 - -type t__rlim64_t = uint64 - -type t__id_t = uint32 - -type t__time_t = int32 - -type t__useconds_t = uint32 - -type t__suseconds_t = int32 - -type t__suseconds64_t = int64 - -type t__daddr_t = int32 - -type t__key_t = int32 - -type t__clockid_t = int32 - -type t__timer_t = uintptr - -type t__blksize_t = int32 - -type t__blkcnt_t = int32 - -type t__blkcnt64_t = int64 - -type t__fsblkcnt_t = uint32 - -type t__fsblkcnt64_t = uint64 - -type t__fsfilcnt_t = uint32 - -type t__fsfilcnt64_t = uint64 - -type t__fsword_t = int32 - -type t__ssize_t = int32 - -type t__syscall_slong_t = int32 - -type t__syscall_ulong_t = uint32 - -type t__loff_t = int64 - -type t__caddr_t = uintptr - -type t__intptr_t = int32 +type Tssize_t = int32 -type t__socklen_t = uint32 +type ssize_t = Tssize_t -type t__sig_atomic_t = int32 +type Toff_t = int64 -type t__time64_t = int64 +type off_t = Toff_t -type t__mbstate_t = struct { - F__count int32 - F__value struct { - F__wchb [0][4]int8 - F__wch uint32 - } -} +type t__isoc_va_list = uintptr -type t__fpos_t = struct { - F__pos t__off_t - F__state t__mbstate_t +type Tfpos_t = struct { + F__lldata [0]int64 + F__align [0]float64 + F__opaque [16]int8 } -type T_G_fpos_t = t__fpos_t - -type _G_fpos_t = T_G_fpos_t - -type t__fpos64_t = struct { - F__pos t__off64_t - F__state t__mbstate_t -} +type fpos_t = Tfpos_t -type T_G_fpos64_t = t__fpos64_t +type T_G_fpos64_t = Tfpos_t type _G_fpos64_t = T_G_fpos64_t -type T_IO_FILE = struct { - F_flags int32 - F_IO_read_ptr uintptr - F_IO_read_end uintptr - F_IO_read_base uintptr - F_IO_write_base uintptr - F_IO_write_ptr uintptr - F_IO_write_end uintptr - F_IO_buf_base uintptr - F_IO_buf_end uintptr - F_IO_save_base uintptr - F_IO_backup_base uintptr - F_IO_save_end uintptr - F_markers uintptr - F_chain uintptr - F_fileno int32 - F_flags2 int32 - F_old_offset t__off_t - F_cur_column uint16 - F_vtable_offset int8 - F_shortbuf [1]int8 - F_lock uintptr - F_offset t__off64_t - F_codecvt uintptr - F_wide_data uintptr - F_freeres_list uintptr - F_freeres_buf uintptr - F__pad5 Tsize_t - F_mode int32 - F_unused2 [40]int8 -} - -type _IO_FILE = T_IO_FILE - -type t__FILE = struct { - F_flags int32 - F_IO_read_ptr uintptr - F_IO_read_end uintptr - F_IO_read_base uintptr - F_IO_write_base uintptr - F_IO_write_ptr uintptr - F_IO_write_end uintptr - F_IO_buf_base uintptr - F_IO_buf_end uintptr - F_IO_save_base uintptr - F_IO_backup_base uintptr - F_IO_save_end uintptr - F_markers uintptr - F_chain uintptr - F_fileno int32 - F_flags2 int32 - F_old_offset t__off_t - F_cur_column uint16 - F_vtable_offset int8 - F_shortbuf [1]int8 - F_lock uintptr - F_offset t__off64_t - F_codecvt uintptr - F_wide_data uintptr - F_freeres_list uintptr - F_freeres_buf uintptr - F__pad5 Tsize_t - F_mode int32 - F_unused2 [40]int8 -} - -type TFILE = struct { - F_flags int32 - F_IO_read_ptr uintptr - F_IO_read_end uintptr - F_IO_read_base uintptr - F_IO_write_base uintptr - F_IO_write_ptr uintptr - F_IO_write_end uintptr - F_IO_buf_base uintptr - F_IO_buf_end uintptr - F_IO_save_base uintptr - F_IO_backup_base uintptr - F_IO_save_end uintptr - F_markers uintptr - F_chain uintptr - F_fileno int32 - F_flags2 int32 - F_old_offset t__off_t - F_cur_column uint16 - F_vtable_offset int8 - F_shortbuf [1]int8 - F_lock uintptr - F_offset t__off64_t - F_codecvt uintptr - F_wide_data uintptr - F_freeres_list uintptr - F_freeres_buf uintptr - F__pad5 Tsize_t - F_mode int32 - F_unused2 [40]int8 -} - -type FILE = TFILE - -type T_IO_lock_t = struct{} - -type _IO_lock_t = T_IO_lock_t - type Tcookie_io_functions_t = struct { Fread uintptr Fwrite uintptr @@ -7268,32 +6822,6 @@ type T_IO_cookie_io_functions_t = Tcookie_io_functions_t type _IO_cookie_io_functions_t = T_IO_cookie_io_functions_t -type Toff_t = int64 - -type off_t = Toff_t - -type Toff64_t = int64 - -type off64_t = Toff64_t - -type Tssize_t = int32 - -type ssize_t = Tssize_t - -type Tfpos_t = struct { - F__pos t__off64_t - F__state t__mbstate_t -} - -type fpos_t = Tfpos_t - -type Tfpos64_t = struct { - F__pos t__off64_t - F__state t__mbstate_t -} - -type fpos64_t = Tfpos64_t - type Twchar_t = int32 type wchar_t = Twchar_t @@ -7319,438 +6847,21 @@ type Tlldiv_t = struct { type lldiv_t = Tlldiv_t -type t__locale_struct = struct { - F__locales [13]uintptr - F__ctype_b uintptr - F__ctype_tolower uintptr - F__ctype_toupper uintptr - F__names [13]uintptr -} - -type t__locale_t = uintptr - type Tlocale_t = uintptr type locale_t = Tlocale_t -type Tu_char = uint8 - -type u_char = Tu_char - -type Tu_short = uint16 - -type u_short = Tu_short - -type Tu_int = uint32 - -type u_int = Tu_int - -type Tu_long = uint32 - -type u_long = Tu_long - -type Tquad_t = int64 - -type quad_t = Tquad_t - -type Tu_quad_t = uint64 - -type u_quad_t = Tu_quad_t - -type Tfsid_t = struct { - F__val [2]int32 -} - -type fsid_t = Tfsid_t - -type Tloff_t = int64 - -type loff_t = Tloff_t - -type Tino_t = uint64 - -type ino_t = Tino_t - -type Tino64_t = uint64 - -type ino64_t = Tino64_t - -type Tdev_t = uint64 - -type dev_t = Tdev_t - -type Tgid_t = uint32 - -type gid_t = Tgid_t - -type Tmode_t = uint32 - -type mode_t = Tmode_t - -type Tnlink_t = uint32 - -type nlink_t = Tnlink_t - -type Tuid_t = uint32 - -type uid_t = Tuid_t - -type Tpid_t = int32 - -type pid_t = Tpid_t - -type Tid_t = uint32 - -type id_t = Tid_t - -type Tdaddr_t = int32 - -type daddr_t = Tdaddr_t - -type Tcaddr_t = uintptr - -type caddr_t = Tcaddr_t - -type Tkey_t = int32 - -type key_t = Tkey_t - -type Tclock_t = int32 - -type clock_t = Tclock_t - -type Tclockid_t = int32 - -type clockid_t = Tclockid_t - -type Ttime_t = int32 - -type time_t = Ttime_t - -type Ttimer_t = uintptr - -type timer_t = Ttimer_t - -type Tuseconds_t = uint32 - -type useconds_t = Tuseconds_t - -type Tsuseconds_t = int32 - -type suseconds_t = Tsuseconds_t - -type Tulong = uint32 - -type ulong = Tulong - -type Tushort = uint16 - -type ushort = Tushort - -type Tuint = uint32 - -type uint = Tuint - -type Tint8_t = int8 - -type int8_t = Tint8_t - -type Tint16_t = int16 - -type int16_t = Tint16_t - -type Tint32_t = int32 - -type int32_t = Tint32_t - -type Tint64_t = int64 - -type int64_t = Tint64_t - -type Tu_int8_t = uint8 - -type u_int8_t = Tu_int8_t - -type Tu_int16_t = uint16 - -type u_int16_t = Tu_int16_t - -type Tu_int32_t = uint32 - -type u_int32_t = Tu_int32_t - -type Tu_int64_t = uint64 - -type u_int64_t = Tu_int64_t - -type Tregister_t = int32 - -type register_t = Tregister_t - -type t__sigset_t = struct { - F__val [32]uint32 -} - -type Tsigset_t = struct { - F__val [32]uint32 -} - -type sigset_t = Tsigset_t - -type Ttimeval = struct { - Ftv_sec t__time_t - Ftv_usec t__suseconds_t -} - -type timeval = Ttimeval - -type Ttimespec = struct { - Ftv_sec t__time_t - Ftv_nsec t__syscall_slong_t -} - -type timespec = Ttimespec - -type t__fd_mask = int32 - -type Tfd_set = struct { - Ffds_bits [32]t__fd_mask -} - -type fd_set = Tfd_set - -type Tfd_mask = int32 - -type fd_mask = Tfd_mask - -type Tblksize_t = int32 - -type blksize_t = Tblksize_t - -type Tblkcnt_t = int64 - -type blkcnt_t = Tblkcnt_t - -type Tfsblkcnt_t = uint64 - -type fsblkcnt_t = Tfsblkcnt_t - -type Tfsfilcnt_t = uint64 - -type fsfilcnt_t = Tfsfilcnt_t - -type Tblkcnt64_t = int64 - -type blkcnt64_t = Tblkcnt64_t - -type Tfsblkcnt64_t = uint64 - -type fsblkcnt64_t = Tfsblkcnt64_t - -type Tfsfilcnt64_t = uint64 - -type fsfilcnt64_t = Tfsfilcnt64_t - -type t__atomic_wide_counter = struct { - F__value32 [0]struct { - F__low uint32 - F__high uint32 - } - F__value64 uint64 -} - -type t__pthread_list_t = struct { - F__prev uintptr - F__next uintptr -} - -type t__pthread_internal_list = t__pthread_list_t - -type t__pthread_slist_t = struct { - F__next uintptr -} - -type t__pthread_internal_slist = t__pthread_slist_t - -type t__pthread_mutex_s = struct { - F__lock int32 - F__count uint32 - F__owner int32 - F__kind int32 - F__nusers uint32 - F__ccgo5_20 struct { - F__list [0]t__pthread_slist_t - F__elision_data struct { - F__espins int16 - F__eelision int16 - } - } -} - -type t__pthread_rwlock_arch_t = struct { - F__readers uint32 - F__writers uint32 - F__wrphase_futex uint32 - F__writers_futex uint32 - F__pad3 uint32 - F__pad4 uint32 - F__flags uint8 - F__shared uint8 - F__rwelision int8 - F__pad2 uint8 - F__cur_writer int32 -} - -type t__pthread_cond_s = struct { - F__wseq t__atomic_wide_counter - F__g1_start t__atomic_wide_counter - F__g_refs [2]uint32 - F__g_size [2]uint32 - F__g1_orig_size uint32 - F__wrefs uint32 - F__g_signals [2]uint32 -} - -type t__tss_t = uint32 - -type t__thrd_t = uint32 - -type t__once_flag = struct { - F__data int32 -} - -type Tpthread_t = uint32 - -type pthread_t = Tpthread_t - -type Tpthread_mutexattr_t = struct { - F__align [0]int32 - F__size [4]int8 -} - -type pthread_mutexattr_t = Tpthread_mutexattr_t - -type Tpthread_condattr_t = struct { - F__align [0]int32 - F__size [4]int8 -} - -type pthread_condattr_t = Tpthread_condattr_t - -type Tpthread_key_t = uint32 - -type pthread_key_t = Tpthread_key_t - -type Tpthread_once_t = int32 - -type pthread_once_t = Tpthread_once_t - -type Tpthread_attr_t1 = struct { - F__align [0]int32 - F__size [36]int8 -} - -type pthread_attr_t1 = Tpthread_attr_t1 - -type Tpthread_attr_t = struct { - F__align [0]int32 - F__size [36]int8 -} - -type pthread_attr_t = Tpthread_attr_t - -type Tpthread_mutex_t = struct { - F__size [0][24]int8 - F__align [0]int32 - F__data t__pthread_mutex_s -} - -type pthread_mutex_t = Tpthread_mutex_t - -type Tpthread_cond_t = struct { - F__size [0][48]int8 - F__align [0]int64 - F__data t__pthread_cond_s -} - -type pthread_cond_t = Tpthread_cond_t - -type Tpthread_rwlock_t = struct { - F__size [0][32]int8 - F__align [0]int32 - F__data t__pthread_rwlock_arch_t -} - -type pthread_rwlock_t = Tpthread_rwlock_t - -type Tpthread_rwlockattr_t = struct { - F__align [0]int32 - F__size [8]int8 -} - -type pthread_rwlockattr_t = Tpthread_rwlockattr_t - -type Tpthread_spinlock_t = int32 - -type pthread_spinlock_t = Tpthread_spinlock_t - -type Tpthread_barrier_t = struct { - F__align [0]int32 - F__size [20]int8 -} - -type pthread_barrier_t = Tpthread_barrier_t - -type Tpthread_barrierattr_t = struct { - F__align [0]int32 - F__size [4]int8 -} - -type pthread_barrierattr_t = Tpthread_barrierattr_t - -type Trandom_data = struct { - Ffptr uintptr - Frptr uintptr - Fstate uintptr - Frand_type int32 - Frand_deg int32 - Frand_sep int32 - Fend_ptr uintptr -} - -type random_data = Trandom_data - -type Tdrand48_data = struct { - F__x [3]uint16 - F__old_x [3]uint16 - F__c uint16 - F__init uint16 - F__a uint64 +type Tmax_align_t = struct { + F__ll int64 + F__ld float64 } -type drand48_data = Tdrand48_data - -type t__compar_fn_t = uintptr - -type Tcomparison_fn_t = uintptr - -type comparison_fn_t = Tcomparison_fn_t - -type t__compar_d_fn_t = uintptr +type max_align_t = Tmax_align_t type Tptrdiff_t = int32 type ptrdiff_t = Tptrdiff_t -type Tmax_align_t = struct { - F__ccgo_align [0]uint32 - F__max_align_ll int64 - F__max_align_ld float64 - F__max_align_f128 [2]uint64 -} - -type max_align_t = Tmax_align_t - /* ** Use a macro to replace memcpy() if compiled with SQLITE_INLINE_MEMCPY. ** This allows better measurements of where memcpy() is used when running @@ -11041,7 +10152,6 @@ type SrcList1 = TSrcList1 ** Value constraints (enforced via assert()): ** WHERE_USE_LIMIT == SF_FixedLimit */ -/* 0x2000 not currently used */ /* 0x8000 not currently used */ /* Allowed return values from sqlite3WhereIsDistinct() @@ -12097,7 +11207,7 @@ var _sqlite3azCompileOpt = [54]uintptr{ } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { - *(*int32)(unsafe.Pointer(pnOpt)) = int32(libc.Uint32FromInt64(216) / libc.Uint32FromInt64(4)) + *(*int32)(unsafe.Pointer(pnOpt)) = libc.Int32FromUint32(libc.Uint32FromInt64(216) / libc.Uint32FromInt64(4)) return uintptr(unsafe.Pointer(&_sqlite3azCompileOpt)) } @@ -13603,10 +12713,7 @@ var _statMutex = [10]int8{ // ** be holding the appropriate mutex. // */ func _sqlite3StatusValue(tls *libc.TLS, op int32) (r Tsqlite3_int64) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - return int64(*(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4))) + return libc.Int64FromUint32(*(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4))) } // C documentation @@ -13623,21 +12730,14 @@ func _sqlite3StatusValue(tls *libc.TLS, op int32) (r Tsqlite3_int64) { // ** mark is unchanged. N must be non-negative for StatusDown(). // */ func _sqlite3StatusUp(tls *libc.TLS, op int32, N int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4)) += uint32(N) + *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4)) += libc.Uint32FromInt32(N) if *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4)) > *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 40 + uintptr(op)*4)) { *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 40 + uintptr(op)*4)) = *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4)) } } func _sqlite3StatusDown(tls *libc.TLS, op int32, N int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4)) -= uint32(N) + *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4)) -= libc.Uint32FromInt32(N) } // C documentation @@ -13649,12 +12749,7 @@ func _sqlite3StatusDown(tls *libc.TLS, op int32, N int32) { func _sqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { var newValue Tsqlite3StatValueType _ = newValue - _ = libc.Int32FromInt32(0) - newValue = uint32(X) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + newValue = libc.Uint32FromInt32(X) if newValue > *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 40 + uintptr(op)*4)) { *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 40 + uintptr(op)*4)) = newValue } @@ -13668,7 +12763,7 @@ func _sqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) (r int32) { var pMutex, v1 uintptr _, _ = pMutex, v1 - if op < 0 || op >= int32(libc.Uint32FromInt64(40)/libc.Uint32FromInt64(4)) { + if op < 0 || op >= libc.Int32FromUint32(libc.Uint32FromInt64(40)/libc.Uint32FromInt64(4)) { return _sqlite3MisuseError(tls, int32(23961)) } if _statMutex[op] != 0 { @@ -13678,8 +12773,8 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin } pMutex = v1 Xsqlite3_mutex_enter(tls, pMutex) - *(*Tsqlite3_int64)(unsafe.Pointer(pCurrent)) = int64(*(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4))) - *(*Tsqlite3_int64)(unsafe.Pointer(pHighwater)) = int64(*(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 40 + uintptr(op)*4))) + *(*Tsqlite3_int64)(unsafe.Pointer(pCurrent)) = libc.Int64FromUint32(*(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4))) + *(*Tsqlite3_int64)(unsafe.Pointer(pHighwater)) = libc.Int64FromUint32(*(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 40 + uintptr(op)*4))) if resetFlag != 0 { *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 40 + uintptr(op)*4)) = *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*4)) } @@ -13734,9 +12829,9 @@ func _sqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) (r int nInit += _countLookasideSlots(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit) nFree += _countLookasideSlots(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree) if pHighwater != 0 { - *(*int32)(unsafe.Pointer(pHighwater)) = int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - nInit) + *(*int32)(unsafe.Pointer(pHighwater)) = libc.Int32FromUint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - nInit) } - return int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - (nInit + nFree)) + return libc.Int32FromUint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - (nInit + nFree)) } // C documentation @@ -13783,10 +12878,8 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p case int32(SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE): fallthrough case int32(SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL): - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pCurrent)) = 0 - *(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*Tu32)(unsafe.Pointer(db + 312 + 16 + uintptr(op-int32(SQLITE_DBSTATUS_LOOKASIDE_HIT))*4))) + *(*int32)(unsafe.Pointer(pHighwater)) = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(db + 312 + 16 + uintptr(op-int32(SQLITE_DBSTATUS_LOOKASIDE_HIT))*4))) if resetFlag != 0 { *(*Tu32)(unsafe.Pointer(db + 312 + 16 + uintptr(op-int32(SQLITE_DBSTATUS_LOOKASIDE_HIT))*4)) = uint32(0) } @@ -13835,7 +12928,6 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p *(*int32)(unsafe.Pointer(bp)) = 0 /* Used to accumulate return value */ _sqlite3BtreeEnterAll(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = bp - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart i1 = 0 for { @@ -13844,7 +12936,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*16))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + uint32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(16)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(16)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13892,7 +12984,6 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p case int32(SQLITE_DBSTATUS_STMT_USED): /* Used to iterate through VMs */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Used to accumulate return value */ (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = bp + 4 - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart pVdbe = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe for { @@ -13925,8 +13016,6 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p fallthrough case int32(SQLITE_DBSTATUS_CACHE_WRITE): *(*Tu64)(unsafe.Pointer(bp + 8)) = uint64(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) i2 = 0 for { if !(i2 < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -13944,7 +13033,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p *(*int32)(unsafe.Pointer(pHighwater)) = 0 /* IMP: R-42420-56072 */ /* IMP: R-54100-20147 */ /* IMP: R-29431-39229 */ - *(*int32)(unsafe.Pointer(pCurrent)) = int32(*(*Tu64)(unsafe.Pointer(bp + 8))) & int32(0x7fffffff) + *(*int32)(unsafe.Pointer(pCurrent)) = libc.Int32FromUint64(*(*Tu64)(unsafe.Pointer(bp + 8))) & int32(0x7fffffff) break /* Set *pCurrent to non-zero if there are unresolved deferred foreign ** key constraints. Set *pCurrent to zero if all foreign key constraints @@ -13961,41 +13050,33 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p return rc } -type Ttimex = struct { - Fmodes uint32 - Foffset t__syscall_slong_t - Ffreq t__syscall_slong_t - Fmaxerror t__syscall_slong_t - Festerror t__syscall_slong_t - Fstatus int32 - Fconstant t__syscall_slong_t - Fprecision t__syscall_slong_t - Ftolerance t__syscall_slong_t - Ftime Ttimeval - Ftick t__syscall_slong_t - Fppsfreq t__syscall_slong_t - Fjitter t__syscall_slong_t - Fshift int32 - Fstabil t__syscall_slong_t - Fjitcnt t__syscall_slong_t - Fcalcnt t__syscall_slong_t - Ferrcnt t__syscall_slong_t - Fstbcnt t__syscall_slong_t - Ftai int32 - F__ccgo84 uint32 - F__ccgo88 uint32 - F__ccgo92 uint32 - F__ccgo96 uint32 - F__ccgo100 uint32 - F__ccgo104 uint32 - F__ccgo108 uint32 - F__ccgo112 uint32 - F__ccgo116 uint32 - F__ccgo120 uint32 - F__ccgo124 uint32 -} - -type timex = Ttimex +type Ttime_t = int64 + +type time_t = Ttime_t + +type Ttimer_t = uintptr + +type timer_t = Ttimer_t + +type Tclockid_t = int32 + +type clockid_t = Tclockid_t + +type Tclock_t = int32 + +type clock_t = Tclock_t + +type Ttimespec = struct { + Ftv_sec Ttime_t + Ftv_nsec int32 + F__ccgo12 uint32 +} + +type timespec = Ttimespec + +type Tpid_t = int32 + +type pid_t = Tpid_t type Ttm = struct { Ftm_sec int32 @@ -14108,7 +13189,6 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in N = int8(int32(*(*int8)(unsafe.Pointer(zFormat))) - int32('0')) min = int8(int32(*(*int8)(unsafe.Pointer(zFormat + 1))) - int32('0')) val = 0 - _ = libc.Int32FromInt32(0) max = _aMx[int32(*(*int8)(unsafe.Pointer(zFormat + 2)))-int32('a')] nextC = *(*int8)(unsafe.Pointer(zFormat + 3)) val = 0 @@ -14118,13 +13198,13 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in if !(v1 != 0) { break } - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&libc.Int32FromInt32(0x04) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&libc.Int32FromInt32(0x04) != 0) { goto end_getDigits } val = val*int32(10) + int32(*(*int8)(unsafe.Pointer(zDate))) - int32('0') zDate++ } - if val < int32(min) || val > int32(max) || int32(nextC) != 0 && int32(nextC) != int32(*(*int8)(unsafe.Pointer(zDate))) { + if val < int32(min) || val > libc.Int32FromUint16(max) || int32(nextC) != 0 && int32(nextC) != int32(*(*int8)(unsafe.Pointer(zDate))) { goto end_getDigits } *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = val @@ -14176,7 +13256,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* nMn at bp+4 */ int32 _, _ = c, sgn sgn = 0 - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { zDate++ } (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 @@ -14206,7 +13286,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { goto zulu_time zulu_time: ; - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { zDate++ } return libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zDate))) != 0) @@ -14240,10 +13320,10 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { return int32(1) } zDate += uintptr(2) - if int32(*(*int8)(unsafe.Pointer(zDate))) == int32('.') && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate + 1)))])&int32(0x04) != 0 { + if int32(*(*int8)(unsafe.Pointer(zDate))) == int32('.') && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate + 1)))])&int32(0x04) != 0 { rScale = float64(1) zDate++ - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { ms = ms*float64(10) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ @@ -14334,9 +13414,6 @@ func _computeJD(tls *libc.TLS, p uintptr) { // ** date back to the end of the month. // */ func _computeFloor(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TDateTime)(unsafe.Pointer(p)).FD <= int32(28) { (*TDateTime)(unsafe.Pointer(p)).FnFloor = 0 } else { @@ -14388,7 +13465,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { return int32(1) } zDate += uintptr(10) - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 || int32('T') == int32(*(*Tu8)(unsafe.Pointer(zDate))) { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 || int32('T') == libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zDate))) { zDate++ } if _parseHhMmSs(tls, zDate, p) == 0 { @@ -14668,15 +13745,15 @@ func _osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) (r int32) { // ** Assuming the input DateTime is UTC, move it to its localtime equivalent. // */ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(96) - defer tls.Free(96) + bp := tls.Alloc(112) + defer tls.Free(112) var iYearDiff int32 - var _ /* sLocal at bp+4 */ Ttm + var _ /* sLocal at bp+8 */ Ttm var _ /* t at bp+0 */ Ttime_t - var _ /* x at bp+48 */ TDateTime + var _ /* x at bp+52 */ TDateTime _ = iYearDiff /* Initialize the contents of sLocal to avoid a compiler warning. */ - libc.Xmemset(tls, bp+4, 0, uint32(44)) + libc.Xmemset(tls, bp+8, 0, uint32(44)) _computeJD(tls, p) if (*TDateTime)(unsafe.Pointer(p)).FiJD < libc.Int64FromInt32(2108667600)*libc.Int64FromInt32(100000) || (*TDateTime)(unsafe.Pointer(p)).FiJD > libc.Int64FromInt32(2130141456)*libc.Int64FromInt32(100000) { /* EVIDENCE-OF: R-55269-29598 The localtime_r() C function normally only @@ -14684,27 +13761,27 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { ** SQLite attempts to map the year into an equivalent year within this ** range, do the calculation, then map the year back. */ - *(*TDateTime)(unsafe.Pointer(bp + 48)) = *(*TDateTime)(unsafe.Pointer(p)) - _computeYMD_HMS(tls, bp+48) - iYearDiff = int32(2000) + (*(*TDateTime)(unsafe.Pointer(bp + 48))).FY%int32(4) - (*(*TDateTime)(unsafe.Pointer(bp + 48))).FY - (*(*TDateTime)(unsafe.Pointer(bp + 48))).FY += iYearDiff - (*(*TDateTime)(unsafe.Pointer(bp + 48))).FvalidJD = 0 - _computeJD(tls, bp+48) - *(*Ttime_t)(unsafe.Pointer(bp)) = int32((*(*TDateTime)(unsafe.Pointer(bp + 48))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) + *(*TDateTime)(unsafe.Pointer(bp + 52)) = *(*TDateTime)(unsafe.Pointer(p)) + _computeYMD_HMS(tls, bp+52) + iYearDiff = int32(2000) + (*(*TDateTime)(unsafe.Pointer(bp + 52))).FY%int32(4) - (*(*TDateTime)(unsafe.Pointer(bp + 52))).FY + (*(*TDateTime)(unsafe.Pointer(bp + 52))).FY += iYearDiff + (*(*TDateTime)(unsafe.Pointer(bp + 52))).FvalidJD = 0 + _computeJD(tls, bp+52) + *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 52))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = int32((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) + *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) } - if _osLocaltime(tls, bp, bp+4) != 0 { + if _osLocaltime(tls, bp, bp+8) != 0 { Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1207, -int32(1)) return int32(SQLITE_ERROR) } - (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_year + int32(1900) - iYearDiff - (*TDateTime)(unsafe.Pointer(p)).FM = (*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_mon + int32(1) - (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_mday - (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_hour - (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_year + int32(1900) - iYearDiff + (*TDateTime)(unsafe.Pointer(p)).FM = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mon + int32(1) + (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday + (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour + (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -14843,7 +13920,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, var _ /* tx at bp+76 */ TDateTime _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = Z, cnt, day, i, iErr, iGuess, iOrigJD, rRounder, rc, x, y, z0, z2, v1, v10, v11, v13, v2, v3, v4, v6, v7, v8 rc = int32(1) - switch int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z)))]) { + switch libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))]) { case int32('a'): /* ** auto @@ -15083,7 +14160,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == int32(':') { break } - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n))))])&int32(0x01) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(n))))])&int32(0x01) != 0 { break } if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { @@ -15100,7 +14177,6 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, n++ } if _sqlite3AtoF(tls, z, bp, n, uint8(SQLITE_UTF8)) <= 0 { - _ = libc.Int32FromInt32(0) break } if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { @@ -15116,7 +14192,6 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } } else { - _ = libc.Int32FromInt32(0) if _getDigits(tls, z+1, __ccgo_ts+1337, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } @@ -15155,7 +14230,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + 11)))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1162, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 11)))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1162, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -15163,7 +14238,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, } } if int32(*(*int8)(unsafe.Pointer(z2 + uintptr(n)))) == int32(':') { - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z2)))])&libc.Int32FromInt32(0x04) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z2)))])&libc.Int32FromInt32(0x04) != 0) { z2++ } libc.Xmemset(tls, bp+76, 0, uint32(48)) @@ -15186,18 +14261,17 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, /* If control reaches this point, it means the transformation is ** one of the forms like "+NNN days". */ z += uintptr(n) - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z++ } n = _sqlite3Strlen30(tls, z) if n < int32(3) || n > int32(10) { break } - if int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n-int32(1)))))]) == int32('s') { + if libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(n-int32(1)))))]) == int32('s') { n-- } _computeJD(tls, p) - _ = libc.Int32FromInt32(0) if *(*float64)(unsafe.Pointer(bp)) < libc.Float64FromInt32(0) { v11 = -libc.Float64FromFloat64(0.5) } else { @@ -15207,13 +14281,12 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, (*TDateTime)(unsafe.Pointer(p)).FnFloor = 0 i = 0 for { - if !(i < int32(libc.Uint32FromInt64(96)/libc.Uint32FromInt64(16))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(96)/libc.Uint32FromInt64(16))) { break } - if int32(_aXformType[i].FnName) == n && Xsqlite3_strnicmp(tls, uintptr(unsafe.Pointer(&_aXformType))+uintptr(i)*16+1, z, n) == 0 && *(*float64)(unsafe.Pointer(bp)) > float64(-_aXformType[i].FrLimit) && *(*float64)(unsafe.Pointer(bp)) < float64(_aXformType[i].FrLimit) { + if libc.Int32FromUint8(_aXformType[i].FnName) == n && Xsqlite3_strnicmp(tls, uintptr(unsafe.Pointer(&_aXformType))+uintptr(i)*16+1, z, n) == 0 && *(*float64)(unsafe.Pointer(bp)) > float64(-_aXformType[i].FrLimit) && *(*float64)(unsafe.Pointer(bp)) < float64(_aXformType[i].FrLimit) { switch i { case int32(4): /* Special processing to add months */ - _ = libc.Int32FromInt32(0) _computeYMD_HMS(tls, p) *(*int32)(unsafe.Pointer(p + 12)) += int32(*(*float64)(unsafe.Pointer(bp))) if (*TDateTime)(unsafe.Pointer(p)).FM > 0 { @@ -15229,9 +14302,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, *(*float64)(unsafe.Pointer(bp)) -= float64(int32(*(*float64)(unsafe.Pointer(bp)))) case int32(5): /* Special processing to add years */ y = int32(*(*float64)(unsafe.Pointer(bp))) - _ = libc.Int32FromInt32(0) _computeYMD_HMS(tls, p) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(p + 8)) += y _computeFloor(tls, p) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -15309,7 +14380,6 @@ func _isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr if argc == int32(1) && (*TDateTime)(unsafe.Pointer(p)).FvalidYMD != 0 && (*TDateTime)(unsafe.Pointer(p)).FD > int32(28) { /* Make sure a YYYY-MM-DD is normalized. ** Example: 2023-02-31 -> 2023-03-03 */ - _ = libc.Int32FromInt32(0) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = 0 } return 0 @@ -15521,9 +14591,6 @@ func _daysAfterJan01(tls *libc.TLS, pDate uintptr) (r int32) { defer tls.Free(48) var _ /* jan01 at bp+0 */ TDateTime *(*TDateTime)(unsafe.Pointer(bp)) = *(*TDateTime)(unsafe.Pointer(pDate)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*(*TDateTime)(unsafe.Pointer(bp))).FvalidJD = 0 (*(*TDateTime)(unsafe.Pointer(bp))).FM = int32(1) (*(*TDateTime)(unsafe.Pointer(bp))).FD = int32(1) @@ -15542,7 +14609,6 @@ func _daysAfterJan01(tls *libc.TLS, pDate uintptr) (r int32) { // ** 0=Monday, 1=Tuesday, 2=Wednesday, ..., 6=Sunday. // */ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(43200000))/libc.Int64FromInt32(86400000)) % int32(7) } @@ -15557,7 +14623,6 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) } @@ -15632,7 +14697,7 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { goto _1 } if j < i { - Xsqlite3_str_append(tls, bp+48, zFmt+uintptr(j), int32(i-j)) + Xsqlite3_str_append(tls, bp+48, zFmt+uintptr(j), libc.Int32FromUint32(i-j)) } i++ j = i + uint32(1) @@ -15659,7 +14724,6 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('g'): *(*TDateTime)(unsafe.Pointer(bp + 72)) = *(*TDateTime)(unsafe.Pointer(bp)) - _ = libc.Int32FromInt32(0) /* Move y so that it is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 72))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 72))).FvalidYMD = 0 @@ -15746,7 +14810,6 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 120)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ - _ = libc.Int32FromInt32(0) (*(*TDateTime)(unsafe.Pointer(bp + 120))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 120))).FvalidYMD = 0 _computeYMD(tls, bp+120) @@ -15767,7 +14830,7 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { i++ } if j < i { - Xsqlite3_str_append(tls, bp+48, zFmt+uintptr(j), int32(i-j)) + Xsqlite3_str_append(tls, bp+48, zFmt+uintptr(j), libc.Int32FromUint32(i-j)) } _sqlite3ResultStrAccum(tls, context, bp+48) } @@ -15935,62 +14998,62 @@ func _ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uin // ** external linkage. // */ func _sqlite3RegisterDateTimeFunctions(tls *libc.TLS) { - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aDateTimeFuncs)), int32(libc.Uint32FromInt64(400)/libc.Uint32FromInt64(40))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aDateTimeFuncs)), libc.Int32FromUint32(libc.Uint32FromInt64(400)/libc.Uint32FromInt64(40))) } var _aDateTimeFuncs = [10]TFuncDef{ 0: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), FzName: __ccgo_ts + 1249, }, 1: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), FzName: __ccgo_ts + 1269, }, 2: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), FzName: __ccgo_ts + 1477, }, 3: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), FzName: __ccgo_ts + 1482, }, 4: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), FzName: __ccgo_ts + 1487, }, 5: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), FzName: __ccgo_ts + 1496, }, 6: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), FzName: __ccgo_ts + 1505, }, 7: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1514, }, 8: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1527, }, 9: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1545, }, } @@ -16106,12 +15169,10 @@ func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - _ = libc.Int32FromInt32(0) return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - _ = libc.Int32FromInt32(0) return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } @@ -16202,16 +15263,13 @@ func _sqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, f ** down into the VFS layer. Some SQLITE_OPEN_ flags (for example, ** SQLITE_OPEN_FULLMUTEX or SQLITE_OPEN_SHAREDCACHE) are blocked before ** reaching the VFS. */ - _ = libc.Int32FromInt32(0) rc = (*(*func(*libc.TLS, uintptr, Tsqlite3_filename, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen})))(tls, pVfs, zPath, pFile, flags&int32(0x1087f7f), pFlagsOut) - _ = libc.Int32FromInt32(0) return rc } func _sqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) (r int32) { var v1 int32 _ = v1 - _ = libc.Int32FromInt32(0) if (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxDelete != uintptr(0) { v1 = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxDelete})))(tls, pVfs, zPath, dirSync) } else { @@ -16230,8 +15288,7 @@ func _sqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut } func _sqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* tag-20210611-1 */ + /* tag-20210611-1 */ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxDlOpen})))(tls, pVfs, zPath) } @@ -16249,11 +15306,11 @@ func _sqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { func _sqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) (r int32) { if _sqlite3Config.FiPrngSeed != 0 { - libc.Xmemset(tls, zBufOut, 0, uint32(nByte)) + libc.Xmemset(tls, zBufOut, 0, libc.Uint32FromInt32(nByte)) if nByte > libc.Int32FromInt64(4) { nByte = int32(4) } - libc.Xmemcpy(tls, zBufOut, uintptr(unsafe.Pointer(&_sqlite3Config))+272, uint32(nByte)) + libc.Xmemcpy(tls, zBufOut, uintptr(unsafe.Pointer(&_sqlite3Config))+272, libc.Uint32FromInt32(nByte)) return SQLITE_OK } else { return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxRandomness})))(tls, pVfs, nByte, zBufOut) @@ -16301,7 +15358,7 @@ func _sqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uin var pFile uintptr var rc int32 _, _ = pFile, rc - pFile = _sqlite3MallocZero(tls, uint64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile)) + pFile = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile)) if pFile != 0 { rc = _sqlite3OsOpen(tls, pVfs, zFile, pFile, flags, pOutFlags) if rc != SQLITE_OK { @@ -16314,12 +15371,10 @@ func _sqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uin *(*uintptr)(unsafe.Pointer(ppFile)) = uintptr(0) rc = int32(SQLITE_NOMEM) } - _ = libc.Int32FromInt32(0) return rc } func _sqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { - _ = libc.Int32FromInt32(0) _sqlite3OsClose(tls, pFile) Xsqlite3_free(tls, pFile) } @@ -16395,7 +15450,6 @@ func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) (r uintptr) { func _vfsUnlink(tls *libc.TLS, pVfs uintptr) { var p uintptr _ = p - _ = libc.Int32FromInt32(0) if pVfs == uintptr(0) { /* No-op */ } else { @@ -16440,7 +15494,6 @@ func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) (r int32 (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FpNext = (*Tsqlite3_vfs)(unsafe.Pointer(_vfsList)).FpNext (*Tsqlite3_vfs)(unsafe.Pointer(_vfsList)).FpNext = pVfs } - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, mutex) return SQLITE_OK } @@ -16667,8 +15720,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { defer tls.Free(16) var p uintptr _ = p - _ = libc.Int32FromInt32(0) - p = libc.Xmalloc(tls, uint32(nByte+int32(8))) + p = libc.Xmalloc(tls, libc.Uint32FromInt32(nByte+int32(8))) if p != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 @@ -16692,7 +15744,6 @@ func _sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { var p uintptr _ = p p = pPrior - _ = libc.Int32FromInt32(0) p -= 8 libc.Xfree(tls, p) } @@ -16706,7 +15757,6 @@ func _sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { func _sqlite3MemSize(tls *libc.TLS, pPrior uintptr) (r int32) { var p uintptr _ = p - _ = libc.Int32FromInt32(0) p = pPrior p -= 8 return int32(*(*Tsqlite3_int64)(unsafe.Pointer(p))) @@ -16730,10 +15780,9 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) var p uintptr _ = p p = pPrior - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* EV: R-46199-30249 */ + /* EV: R-46199-30249 */ p -= 8 - p = libc.Xrealloc(tls, p, uint32(nByte+libc.Int32FromInt32(8))) + p = libc.Xrealloc(tls, p, libc.Uint32FromInt32(nByte+libc.Int32FromInt32(8))) if p != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 @@ -16971,7 +16020,6 @@ func _sqlite3MutexInit(tls *libc.TLS) (r int32) { (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc } - _ = libc.Int32FromInt32(0) rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexInit})))(tls) return rc } @@ -17004,7 +16052,6 @@ func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) (r uintptr) { if id > int32(SQLITE_MUTEX_RECURSIVE) && _sqlite3MutexInit(tls) != 0 { return uintptr(0) } - _ = libc.Int32FromInt32(0) return (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexAlloc})))(tls, id) } @@ -17012,8 +16059,6 @@ func _sqlite3MutexAlloc(tls *libc.TLS, id int32) (r uintptr) { if !(_sqlite3Config.FbCoreMutex != 0) { return uintptr(0) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexAlloc})))(tls, id) } @@ -17024,7 +16069,6 @@ func _sqlite3MutexAlloc(tls *libc.TLS, id int32) (r uintptr) { // */ func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { if p != 0 { - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexFree})))(tls, p) } } @@ -17037,7 +16081,6 @@ func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { // */ func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { if p != 0 { - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexEnter})))(tls, p) } } @@ -17053,7 +16096,6 @@ func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) (r int32) { _ = rc rc = SQLITE_OK if p != 0 { - _ = libc.Int32FromInt32(0) return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexTry})))(tls, p) } return rc @@ -17069,7 +16111,6 @@ func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) (r int32) { // */ func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) { if p != 0 { - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexLeave})))(tls, p) } } @@ -17484,8 +16525,6 @@ func _mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { var nUsed Tsqlite3_int64 var p uintptr _, _, _ = nFull, nUsed, p - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* In Firefox (circa 2017-02-08), xRoundup() is remapped to an internal ** implementation of malloc_good_size(), which must be called in debug ** mode and specifically when the DMD "Dark Matter Detector" is enabled @@ -17552,13 +16591,13 @@ func _sqlite3Malloc(tls *libc.TLS, n Tu64) (r uintptr) { } else { if _sqlite3Config.FbMemstat != 0 { Xsqlite3_mutex_enter(tls, _mem0.Fmutex) - _mallocWithAlarm(tls, int32(n), bp) + _mallocWithAlarm(tls, libc.Int32FromUint64(n), bp) Xsqlite3_mutex_leave(tls, _mem0.Fmutex) } else { - *(*uintptr)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxMalloc})))(tls, int32(n)) + *(*uintptr)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxMalloc})))(tls, libc.Int32FromUint64(n)) } } - _ = libc.Int32FromInt32(0) /* IMP: R-11148-40995 */ + /* IMP: R-11148-40995 */ return *(*uintptr)(unsafe.Pointer(bp)) } @@ -17578,7 +16617,7 @@ func Xsqlite3_malloc(tls *libc.TLS, n int32) (r uintptr) { if n <= 0 { v1 = uintptr(0) } else { - v1 = _sqlite3Malloc(tls, uint64(n)) + v1 = _sqlite3Malloc(tls, libc.Uint64FromInt32(n)) } return v1 } @@ -17606,7 +16645,6 @@ func _isLookaside(tls *libc.TLS, db uintptr, p uintptr) (r int32) { // ** sqlite3Malloc() or sqlite3_malloc(). // */ func _sqlite3MallocSize(tls *libc.TLS, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxSize})))(tls, p) } @@ -17614,7 +16652,7 @@ func _lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var v1 int32 _ = v1 if p < (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle { - v1 = int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) + v1 = libc.Int32FromUint16((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } else { v1 = int32(LOOKASIDE_SMALL) } @@ -17622,16 +16660,13 @@ func _lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) (r int32) { } func _sqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) if db != 0 { if uint32(p) < uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd) { if uint32(p) >= uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { - _ = libc.Int32FromInt32(0) return int32(LOOKASIDE_SMALL) } if uint32(p) >= uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { - _ = libc.Int32FromInt32(0) - return int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) + return libc.Int32FromUint16((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } } } @@ -17641,14 +16676,12 @@ func _sqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) (r int32) { func Xsqlite3_msize(tls *libc.TLS, p uintptr) (r Tsqlite3_uint64) { var v1 int32 _ = v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if p != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxSize})))(tls, p) } else { v1 = 0 } - return uint64(v1) + return libc.Uint64FromInt32(v1) } // C documentation @@ -17660,8 +16693,6 @@ func Xsqlite3_free(tls *libc.TLS, p uintptr) { if p == uintptr(0) { return } /* IMP: R-49053-54554 */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _sqlite3Config.FbMemstat != 0 { Xsqlite3_mutex_enter(tls, _mem0.Fmutex) _sqlite3StatusDown(tls, SQLITE_STATUS_MEMORY_USED, _sqlite3MallocSize(tls, p)) @@ -17693,20 +16724,16 @@ func _measureAllocationSize(tls *libc.TLS, db uintptr, p uintptr) { func _sqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { var pBuf, pBuf1 uintptr _, _ = pBuf, pBuf1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if db != 0 { if uint32(p) < uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { if uint32(p) >= uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { pBuf = p - _ = libc.Int32FromInt32(0) (*TLookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = pBuf return } if uint32(p) >= uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { pBuf1 = p - _ = libc.Int32FromInt32(0) (*TLookasideSlot)(unsafe.Pointer(pBuf1)).FpNext = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = pBuf1 return @@ -17717,29 +16744,21 @@ func _sqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { return } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) Xsqlite3_free(tls, p) } func _sqlite3DbNNFreeNN(tls *libc.TLS, db uintptr, p uintptr) { var pBuf, pBuf1 uintptr _, _ = pBuf, pBuf1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if uint32(p) < uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { if uint32(p) >= uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { pBuf = p - _ = libc.Int32FromInt32(0) (*TLookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = pBuf return } if uint32(p) >= uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { pBuf1 = p - _ = libc.Int32FromInt32(0) (*TLookasideSlot)(unsafe.Pointer(pBuf1)).FpNext = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = pBuf1 return @@ -17749,13 +16768,10 @@ func _sqlite3DbNNFreeNN(tls *libc.TLS, db uintptr, p uintptr) { _measureAllocationSize(tls, db, p) return } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) Xsqlite3_free(tls, p) } func _sqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { - _ = libc.Int32FromInt32(0) if p != 0 { _sqlite3DbFreeNN(tls, db, p) } @@ -17772,8 +16788,6 @@ func _sqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes Tu64) (r uintptr) { var pNew uintptr var v2 bool _, _, _, _, _, _, _ = nDiff, nNew, nOld, nUsed, pNew, v1, v2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pOld == uintptr(0) { return _sqlite3Malloc(tls, nBytes) /* IMP: R-04300-56712 */ } @@ -17789,13 +16803,13 @@ func _sqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes Tu64) (r uintptr) { /* IMPLEMENTATION-OF: R-46199-30249 SQLite guarantees that the second ** argument to xRealloc is always a value returned by a prior call to ** xRoundup. */ - nNew = (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(nBytes)) + nNew = (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, libc.Int32FromUint64(nBytes)) if nOld == nNew { pNew = pOld } else { if _sqlite3Config.FbMemstat != 0 { Xsqlite3_mutex_enter(tls, _mem0.Fmutex) - _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_MALLOC_SIZE), int32(nBytes)) + _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_MALLOC_SIZE), libc.Int32FromUint64(nBytes)) nDiff = nNew - nOld if v2 = nDiff > 0; v2 { v1 = _sqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED) @@ -17810,7 +16824,7 @@ func _sqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes Tu64) (r uintptr) { } pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRealloc})))(tls, pOld, nNew) if pNew == uintptr(0) && _mem0.FalarmThreshold > 0 { - _sqlite3MallocAlarm(tls, int32(nBytes)) + _sqlite3MallocAlarm(tls, libc.Int32FromUint64(nBytes)) pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRealloc})))(tls, pOld, nNew) } if pNew != 0 { @@ -17822,7 +16836,7 @@ func _sqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes Tu64) (r uintptr) { pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRealloc})))(tls, pOld, nNew) } } - _ = libc.Int32FromInt32(0) /* IMP: R-11148-40995 */ + /* IMP: R-11148-40995 */ return pNew } @@ -17839,7 +16853,7 @@ func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) (r uintptr) { if n < 0 { n = 0 } /* IMP: R-26507-47431 */ - return _sqlite3Realloc(tls, pOld, uint64(n)) + return _sqlite3Realloc(tls, pOld, libc.Uint64FromInt32(n)) } func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Tsqlite3_uint64) (r uintptr) { @@ -17888,7 +16902,6 @@ func _sqlite3DbMallocZero(tls *libc.TLS, db uintptr, n Tu64) (r uintptr) { func _dbMallocRawFinish(tls *libc.TLS, db uintptr, n Tu64) (r uintptr) { var p uintptr _ = p - _ = libc.Int32FromInt32(0) p = _sqlite3Malloc(tls, n) if !(p != 0) { _sqlite3OomFault(tls, db) @@ -17933,9 +16946,6 @@ func _sqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n Tu64) (r uintptr) { func _sqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n Tu64) (r uintptr) { var pBuf, v1, v2, v3, v4 uintptr _, _, _, _, _ = pBuf, v1, v2, v3, v4 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if n > uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz) { if !((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0) { *(*Tu32)(unsafe.Pointer(db + 312 + 16 + 1*4))++ @@ -17990,11 +17000,9 @@ func _sqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n Tu64) (r uintptr) { // ** resize fails, set the mallocFailed flag in the connection object. // */ func _sqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n Tu64) (r uintptr) { - _ = libc.Int32FromInt32(0) if p == uintptr(0) { return _sqlite3DbMallocRawNN(tls, db, n) } - _ = libc.Int32FromInt32(0) if uint32(p) < uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { if uint32(p) >= uint32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { if n <= uint64(LOOKASIDE_SMALL) { @@ -18015,18 +17023,14 @@ func _dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n Tu64) (r uintptr) var pNew uintptr _ = pNew pNew = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { if _isLookaside(tls, db, p) != 0 { pNew = _sqlite3DbMallocRawNN(tls, db, n) if pNew != 0 { - libc.Xmemcpy(tls, pNew, p, uint32(_lookasideMallocSize(tls, db, p))) + libc.Xmemcpy(tls, pNew, p, libc.Uint32FromInt32(_lookasideMallocSize(tls, db, p))) _sqlite3DbFree(tls, db, p) } } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pNew = _sqlite3Realloc(tls, p, n) if !(pNew != 0) { _sqlite3OomFault(tls, db) @@ -18079,9 +17083,6 @@ func _sqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) (r uintptr) { func _sqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n Tu64) (r uintptr) { var zNew, v1 uintptr _, _ = zNew, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if z != 0 { v1 = _sqlite3DbMallocRawNN(tls, db, n+uint64(1)) } else { @@ -18105,14 +17106,14 @@ func _sqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n Tu64) (r uintptr) func _sqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) (r uintptr) { var n int32 _ = n - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart)))])&int32(0x01) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zStart)))])&int32(0x01) != 0 { zStart++ } n = int32(zEnd) - int32(zStart) - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart + uintptr(n-int32(1)))))])&int32(0x01) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zStart + uintptr(n-int32(1)))))])&int32(0x01) != 0 { n-- } - return _sqlite3DbStrNDup(tls, db, zStart, uint64(n)) + return _sqlite3DbStrNDup(tls, db, zStart, libc.Uint64FromInt32(n)) } // C documentation @@ -18146,7 +17147,7 @@ func _sqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { var pParse uintptr _ = pParse - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).FbBenignMalloc) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FbBenignMalloc) == 0 { (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed = uint8(1) if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > 0 { libc.AtomicStoreNInt32(db+304, libc.Int32FromInt32(1), libc.Int32FromInt32(__ATOMIC_RELAXED)) @@ -18188,14 +17189,13 @@ func _sqlite3OomClear(tls *libc.TLS, db uintptr) { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0 { (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed = uint8(0) libc.AtomicStoreNInt32(db+304, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable-- if (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 { v1 = 0 } else { - v1 = int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) + v1 = libc.Int32FromUint16((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(v1) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = libc.Uint16FromInt32(v1) } } @@ -18232,8 +17232,6 @@ func _sqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) (r int32) { ** Otherwise the read (and possible write) of db->mallocFailed ** is unsafe, as is the call to sqlite3Error(). */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || rc != 0 { return _apiHandleError(tls, db, rc) } @@ -18433,13 +17431,12 @@ var _fmtinfo = [23]Tet_info{ // ** Set the StrAccum object to an error mode. // */ func _sqlite3StrAccumSetError(tls *libc.TLS, p uintptr, eError Tu8) { - _ = libc.Int32FromInt32(0) (*TStrAccum)(unsafe.Pointer(p)).FaccError = eError if (*TStrAccum)(unsafe.Pointer(p)).FmxAlloc != 0 { Xsqlite3_str_reset(tls, p) } - if int32(eError) == int32(SQLITE_TOOBIG) { - _sqlite3ErrorToParser(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, int32(eError)) + if libc.Int32FromUint8(eError) == int32(SQLITE_TOOBIG) { + _sqlite3ErrorToParser(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, libc.Int32FromUint8(eError)) } } @@ -18504,11 +17501,11 @@ func _printfTempBuf(tls *libc.TLS, pAccum uintptr, n Tsqlite3_int64) (r uintptr) if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError != 0 { return uintptr(0) } - if n > int64((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc) && n > int64((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc) { + if n > libc.Int64FromUint32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc) && n > libc.Int64FromUint32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc) { _sqlite3StrAccumSetError(tls, pAccum, uint8(SQLITE_TOOBIG)) return uintptr(0) } - z = _sqlite3DbMallocRaw(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, uint64(n)) + z = _sqlite3DbMallocRaw(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, libc.Uint64FromInt64(n)) if z == uintptr(0) { _sqlite3StrAccumSetError(tls, pAccum, uint8(SQLITE_NOMEM)) } @@ -18552,9 +17549,8 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ - _ = libc.Int32FromInt32(0) bufpt = uintptr(0) - if int32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&int32(SQLITE_PRINTF_SQLFUNC) != 0 { + if libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&int32(SQLITE_PRINTF_SQLFUNC) != 0 { pArgList = libc.VaUintptr(&ap) bArgList = uint8(1) } else { @@ -18647,7 +17643,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li case int32('8'): fallthrough case int32('9'): - wx = uint32(c - int32('0')) + wx = libc.Uint32FromInt32(c - int32('0')) for { fmt++ v17 = fmt @@ -18656,9 +17652,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if !(v16 >= int32('0') && c <= int32('9')) { break } - wx = wx*uint32(10) + uint32(c) - uint32('0') + wx = wx*uint32(10) + libc.Uint32FromInt32(c) - uint32('0') } - width = int32(wx & uint32(0x7fffffff)) + width = libc.Int32FromUint32(wx & uint32(0x7fffffff)) if c != int32('.') && c != int32('l') { done = uint8(1) } else { @@ -18711,12 +17707,12 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { px = uint32(0) for c >= int32('0') && c <= int32('9') { - px = px*uint32(10) + uint32(c) - uint32('0') + px = px*uint32(10) + libc.Uint32FromInt32(c) - uint32('0') fmt++ v24 = fmt c = int32(*(*int8)(unsafe.Pointer(v24))) } - precision = int32(px & uint32(0x7fffffff)) + precision = libc.Int32FromUint32(px & uint32(0x7fffffff)) } if c == int32('l') { fmt-- @@ -18743,7 +17739,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li xtype = uint8(etINVALID) idx = 0 for { - if !(idx < int32(libc.Uint32FromInt64(138)/libc.Uint32FromInt64(6))) { + if !(idx < libc.Int32FromUint32(libc.Uint32FromInt64(138)/libc.Uint32FromInt64(6))) { break } if c == int32(_fmtinfo[idx].Ffmttype) { @@ -18773,9 +17769,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** xtype The class of the conversion. ** infop Pointer to the appropriate info struct. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - switch int32(xtype) { + switch libc.Int32FromUint8(xtype) { case int32(etPOINTER): goto _26 case etRADIX: @@ -18824,12 +17818,12 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li cThousand = uint8(0) _29: ; - if int32((*Tet_info)(unsafe.Pointer(infop)).Fflags)&int32(FLAG_SIGNED) != 0 { + if libc.Int32FromUint8((*Tet_info)(unsafe.Pointer(infop)).Fflags)&int32(FLAG_SIGNED) != 0 { if bArgList != 0 { v = _getIntArg(tls, pArgList) } else { if flag_long != 0 { - if int32(flag_long) == int32(2) { + if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { v = int64(libc.VaInt32(&ap)) @@ -18839,19 +17833,19 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } if v < 0 { - longvalue = uint64(^v) + longvalue = libc.Uint64FromInt64(^v) longvalue++ prefix = int8('-') } else { - longvalue = uint64(v) - prefix = int8(flag_prefix) + longvalue = libc.Uint64FromInt64(v) + prefix = libc.Int8FromUint8(flag_prefix) } } else { if bArgList != 0 { - longvalue = uint64(_getIntArg(tls, pArgList)) + longvalue = libc.Uint64FromInt64(_getIntArg(tls, pArgList)) } else { if flag_long != 0 { - if int32(flag_long) == int32(2) { + if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -18872,21 +17866,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li nOut = int32(SQLITE_PRINT_BUF_SIZE) zOut = bp } else { - n = uint64(precision) + uint64(10) + n = libc.Uint64FromInt32(precision) + uint64(10) if cThousand != 0 { - n += uint64(precision / int32(3)) + n += libc.Uint64FromInt32(precision / int32(3)) } - v45 = _printfTempBuf(tls, pAccum, int64(n)) + v45 = _printfTempBuf(tls, pAccum, libc.Int64FromUint64(n)) zExtra = v45 zOut = v45 if zOut == uintptr(0) { return } - nOut = int32(n) + nOut = libc.Int32FromUint64(n) } bufpt = zOut + uintptr(nOut-int32(1)) - if int32(xtype) == int32(etORDINAL) { - x = int32(longvalue % libc.Uint64FromInt32(10)) + if libc.Int32FromUint8(xtype) == int32(etORDINAL) { + x = libc.Int32FromUint64(longvalue % libc.Uint64FromInt32(10)) if x >= int32(4) || longvalue/uint64(10)%uint64(10) == uint64(1) { x = 0 } @@ -18926,7 +17920,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if ix == 0 { idx++ v51 = idx - *(*int8)(unsafe.Pointer(bufpt + uintptr(v51))) = int8(cThousand) + *(*int8)(unsafe.Pointer(bufpt + uintptr(v51))) = libc.Int8FromUint8(cThousand) nn-- ix = int32(3) } @@ -18977,10 +17971,10 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if precision > int32(SQLITE_FP_PRECISION_LIMIT) { precision = int32(SQLITE_FP_PRECISION_LIMIT) } - if int32(xtype) == int32(etFLOAT) { + if libc.Int32FromUint8(xtype) == int32(etFLOAT) { iRound = -precision } else { - if int32(xtype) == int32(etGENERIC) { + if libc.Int32FromUint8(xtype) == int32(etGENERIC) { if precision == 0 { precision = int32(1) } @@ -19017,7 +18011,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li /* no-op */ } else { if flag_prefix != 0 { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(flag_prefix) + (*(*[70]int8)(unsafe.Pointer(bp)))[0] = libc.Int8FromUint8(flag_prefix) } else { bufpt++ } @@ -19030,15 +18024,14 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { prefix = int8('-') } else { - prefix = int8(flag_prefix) + prefix = libc.Int8FromUint8(flag_prefix) } exp = (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP - int32(1) /* ** If the field type is etGENERIC, then convert to either etEXP ** or etFLOAT, as appropriate. */ - if int32(xtype) == int32(etGENERIC) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(xtype) == int32(etGENERIC) { precision-- flag_rtz = libc.BoolUint8(!(flag_alternateform != 0)) if exp < -int32(4) || exp > precision { @@ -19050,7 +18043,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { flag_rtz = flag_altform2 } - if int32(xtype) == int32(etEXP) { + if libc.Int32FromUint8(xtype) == int32(etEXP) { e2 = 0 } else { e2 = (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP - int32(1) @@ -19080,7 +18073,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { v60 = 0 } - flag_dp = uint8(v60 | int32(flag_alternateform) | int32(flag_altform2)) + flag_dp = libc.Uint8FromInt32(v60 | libc.Int32FromUint8(flag_alternateform) | libc.Int32FromUint8(flag_altform2)) /* The sign in front of the number */ if prefix != 0 { v61 = bufpt @@ -19166,7 +18159,6 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v75 = bufpt *(*int8)(unsafe.Pointer(v75)) = 0 } - _ = libc.Int32FromInt32(0) if int32(*(*int8)(unsafe.Pointer(bufpt + uintptr(-libc.Int32FromInt32(1))))) == int32('.') { if flag_altform2 != 0 { v76 = bufpt @@ -19180,7 +18172,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } /* Add the "eNNN" suffix */ - if int32(xtype) == int32(etEXP) { + if libc.Int32FromUint8(xtype) == int32(etEXP) { exp = (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP - int32(1) v78 = bufpt bufpt++ @@ -19246,7 +18238,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _33: ; if !(bArgList != 0) { - *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = int32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar) + *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = libc.Int32FromUint32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar) } v87 = libc.Int32FromInt32(0) width = v87 @@ -19284,24 +18276,24 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { ch = libc.VaUint32(&ap) if ch < uint32(0x00080) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(ch & uint32(0xff)) + (*(*[70]int8)(unsafe.Pointer(bp)))[0] = libc.Int8FromUint32(ch & uint32(0xff)) length = int32(1) } else { if ch < uint32(0x00800) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + int32(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + int32(uint8(ch&libc.Uint32FromInt32(0x3f)))) + (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) length = int32(2) } else { if ch < uint32(0x10000) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + int32(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + int32(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + int32(uint8(ch&libc.Uint32FromInt32(0x3f)))) + (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) length = int32(3) } else { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + int32(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + int32(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + int32(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + int32(uint8(ch&libc.Uint32FromInt32(0x3f)))) + (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) length = int32(4) } } @@ -19321,13 +18313,13 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li nPrior = int64(precision - int32(1)) } nCopyBytes = int64(length) * nPrior - if nCopyBytes+int64((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar) >= int64((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc) { + if nCopyBytes+libc.Int64FromUint32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar) >= libc.Int64FromUint32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc) { _sqlite3StrAccumEnlarge(tls, pAccum, nCopyBytes) } if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError != 0 { break } - Xsqlite3_str_append(tls, pAccum, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FzText+uintptr(int64((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar)-nCopyBytes), int32(nCopyBytes)) + Xsqlite3_str_append(tls, pAccum, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FzText+uintptr(libc.Int64FromUint32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar)-nCopyBytes), int32(nCopyBytes)) precision = int32(int64(precision) - nPrior) nPrior *= int64(2) } @@ -19348,15 +18340,14 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if bufpt == uintptr(0) { bufpt = __ccgo_ts + 1662 } else { - if int32(xtype) == int32(etDYNSTRING) { - if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && int32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { + if libc.Int32FromUint8(xtype) == int32(etDYNSTRING) { + if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { /* Special optimization for sqlite3_mprintf("%z..."): ** Extend an existing memory allocation rather than creating ** a new one. */ - _ = libc.Int32FromInt32(0) (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FzText = bufpt - (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc = uint32(_sqlite3DbMallocSize(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, bufpt)) - (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar = uint32(int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt))) + (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc = libc.Uint32FromInt32(_sqlite3DbMallocSize(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, bufpt)) + (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar = libc.Uint32FromInt32(int32(0x7fffffff) & libc.Int32FromUint32(libc.Xstrlen(tls, bufpt))) p92 = pAccum + 21 *(*Tu8)(unsafe.Pointer(p92)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p92))) | libc.Int32FromInt32(SQLITE_PRINTF_MALLOCED)) length = 0 @@ -19378,8 +18369,8 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } v94 = z z++ - if int32(*(*uint8)(unsafe.Pointer(v94))) >= int32(0xc0) { - for int32(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v94))) >= int32(0xc0) { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { z++ } } @@ -19398,7 +18389,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } } else { - length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) + length = int32(0x7fffffff) & libc.Int32FromUint32(libc.Xstrlen(tls, bufpt)) } goto adjust_width_for_utf8 adjust_width_for_utf8: @@ -19421,7 +18412,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if int32(xtype) == int32(etSQLESCAPE3) { + if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { v97 = int32('"') } else { v97 = int32('\'') @@ -19434,7 +18425,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } isnull = libc.BoolInt32(escarg == uintptr(0)) if isnull != 0 { - if int32(xtype) == int32(etSQLESCAPE2) { + if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { v98 = __ccgo_ts + 1663 } else { v98 = __ccgo_ts + 1668 @@ -19472,7 +18463,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && int32(xtype) == int32(etSQLESCAPE2)) + needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -19521,22 +18512,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto adjust_width_for_utf8 _41: ; - if int32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&int32(SQLITE_PRINTF_INTERNAL) == 0 { + if libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&int32(SQLITE_PRINTF_INTERNAL) == 0 { return } if flag_alternateform != 0 { /* %#T means an Expr pointer that uses Expr.u.zToken */ pExpr = libc.VaUintptr(&ap) - if pExpr != 0 && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)) { + if pExpr != 0 && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pExpr + 8))) _sqlite3RecordErrorOffsetOfExpr(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, pExpr) } } else { /* %T means a Token pointer */ pToken = libc.VaUintptr(&ap) - _ = libc.Int32FromInt32(0) if pToken != 0 && (*TToken)(unsafe.Pointer(pToken)).Fn != 0 { - Xsqlite3_str_append(tls, pAccum, (*TToken)(unsafe.Pointer(pToken)).Fz, int32((*TToken)(unsafe.Pointer(pToken)).Fn)) + Xsqlite3_str_append(tls, pAccum, (*TToken)(unsafe.Pointer(pToken)).Fz, libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn)) _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } @@ -19546,11 +18536,10 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _44 _42: ; - if int32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&int32(SQLITE_PRINTF_INTERNAL) == 0 { + if libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&int32(SQLITE_PRINTF_INTERNAL) == 0 { return } pItem = libc.VaUintptr(&ap) - _ = libc.Int32FromInt32(0) if (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 && !(flag_altform2 != 0) { Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias) } else { @@ -19565,12 +18554,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias) } else { pSel = (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect - _ = libc.Int32FromInt32(0) /* Because of tag-20240424-1 */ + /* Because of tag-20240424-1 */ if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1677, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - _ = libc.Int32FromInt32(0) Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1687, libc.VaList(bp+120, *(*Tu32)(unsafe.Pointer(pItem + 60)))) } else { Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1708, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) @@ -19585,7 +18573,6 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _44 _43: ; - _ = libc.Int32FromInt32(0) return _44: ; /* End switch over the format type */ @@ -19635,7 +18622,6 @@ var _zOrd = [9]int8{'t', 'h', 's', 't', 'n', 'd', 'r', 'd'} func _sqlite3RecordErrorByteOffset(tls *libc.TLS, db uintptr, z uintptr) { var pParse, zEnd, zText uintptr _, _, _ = pParse, zEnd, zText - _ = libc.Int32FromInt32(0) if db == uintptr(0) { return } @@ -19663,7 +18649,7 @@ func _sqlite3RecordErrorByteOffset(tls *libc.TLS, db uintptr, z uintptr) { // ** as the error offset. // */ func _sqlite3RecordErrorOffsetOfExpr(tls *libc.TLS, db uintptr, pExpr uintptr) { - for pExpr != 0 && ((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) || *(*int32)(unsafe.Pointer(pExpr + 36)) <= 0) { + for pExpr != 0 && ((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) || *(*int32)(unsafe.Pointer(pExpr + 36)) <= 0) { pExpr = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft } if pExpr == uintptr(0) { @@ -19685,32 +18671,32 @@ func _sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N Ti64) (r int32) { var szNew Ti64 var zNew, zOld, v1, p2 uintptr _, _, _, _, _ = szNew, zNew, zOld, v1, p2 - _ = libc.Int32FromInt32(0) /* Only called if really needed */ + /* Only called if really needed */ if (*TStrAccum)(unsafe.Pointer(p)).FaccError != 0 { return 0 } if (*TStrAccum)(unsafe.Pointer(p)).FmxAlloc == uint32(0) { _sqlite3StrAccumSetError(tls, p, uint8(SQLITE_TOOBIG)) - return int32((*TStrAccum)(unsafe.Pointer(p)).FnAlloc - (*TStrAccum)(unsafe.Pointer(p)).FnChar - uint32(1)) + return libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnAlloc - (*TStrAccum)(unsafe.Pointer(p)).FnChar - uint32(1)) } else { - if int32((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { + if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { v1 = (*TStrAccum)(unsafe.Pointer(p)).FzText } else { v1 = uintptr(0) } zOld = v1 - szNew = int64((*TStrAccum)(unsafe.Pointer(p)).FnChar) + N + int64(1) - if szNew+int64((*TStrAccum)(unsafe.Pointer(p)).FnChar) <= int64((*TStrAccum)(unsafe.Pointer(p)).FmxAlloc) { + szNew = libc.Int64FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar) + N + int64(1) + if szNew+libc.Int64FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar) <= libc.Int64FromUint32((*TStrAccum)(unsafe.Pointer(p)).FmxAlloc) { /* Force exponential buffer size growth as long as it does not overflow, ** to avoid having to call this routine too often */ - szNew += int64((*TStrAccum)(unsafe.Pointer(p)).FnChar) + szNew += libc.Int64FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar) } - if szNew > int64((*TStrAccum)(unsafe.Pointer(p)).FmxAlloc) { + if szNew > libc.Int64FromUint32((*TStrAccum)(unsafe.Pointer(p)).FmxAlloc) { Xsqlite3_str_reset(tls, p) _sqlite3StrAccumSetError(tls, p, uint8(SQLITE_TOOBIG)) return 0 } else { - (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = uint32(int32(szNew)) + (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = libc.Uint32FromInt32(int32(szNew)) } if (*TStrAccum)(unsafe.Pointer(p)).Fdb != 0 { zNew = _sqlite3DbRealloc(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, zOld, uint64((*TStrAccum)(unsafe.Pointer(p)).FnAlloc)) @@ -19718,12 +18704,11 @@ func _sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N Ti64) (r int32) { zNew = _sqlite3Realloc(tls, zOld, uint64((*TStrAccum)(unsafe.Pointer(p)).FnAlloc)) } if zNew != 0 { - _ = libc.Int32FromInt32(0) - if !(int32((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&libc.Int32FromInt32(SQLITE_PRINTF_MALLOCED) != libc.Int32FromInt32(0)) && (*TStrAccum)(unsafe.Pointer(p)).FnChar > uint32(0) { + if !(libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&libc.Int32FromInt32(SQLITE_PRINTF_MALLOCED) != libc.Int32FromInt32(0)) && (*TStrAccum)(unsafe.Pointer(p)).FnChar > uint32(0) { libc.Xmemcpy(tls, zNew, (*TStrAccum)(unsafe.Pointer(p)).FzText, (*TStrAccum)(unsafe.Pointer(p)).FnChar) } (*TStrAccum)(unsafe.Pointer(p)).FzText = zNew - (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = uint32(_sqlite3DbMallocSize(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, zNew)) + (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = libc.Uint32FromInt32(_sqlite3DbMallocSize(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, zNew)) p2 = p + 21 *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(SQLITE_PRINTF_MALLOCED)) } else { @@ -19732,7 +18717,6 @@ func _sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N Ti64) (r int32) { return 0 } } - _ = libc.Int32FromInt32(0) return int32(N) } @@ -19747,7 +18731,7 @@ func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { var v4 Tu32 var v5 uintptr _, _, _, _, _ = v1, v2, v3, v4, v5 - if v2 = int64((*Tsqlite3_str)(unsafe.Pointer(p)).FnChar)+int64(N) >= int64((*Tsqlite3_str)(unsafe.Pointer(p)).FnAlloc); v2 { + if v2 = libc.Int64FromUint32((*Tsqlite3_str)(unsafe.Pointer(p)).FnChar)+int64(N) >= libc.Int64FromUint32((*Tsqlite3_str)(unsafe.Pointer(p)).FnAlloc); v2 { v1 = _sqlite3StrAccumEnlarge(tls, p, int64(N)) N = v1 } @@ -19780,8 +18764,8 @@ func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { func _enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { N = _sqlite3StrAccumEnlarge(tls, p, int64(N)) if N > 0 { - libc.Xmemcpy(tls, (*TStrAccum)(unsafe.Pointer(p)).FzText+uintptr((*TStrAccum)(unsafe.Pointer(p)).FnChar), z, uint32(N)) - *(*Tu32)(unsafe.Pointer(p + 16)) += uint32(N) + libc.Xmemcpy(tls, (*TStrAccum)(unsafe.Pointer(p)).FzText+uintptr((*TStrAccum)(unsafe.Pointer(p)).FnChar), z, libc.Uint32FromInt32(N)) + *(*Tu32)(unsafe.Pointer(p + 16)) += libc.Uint32FromInt32(N) } } @@ -19792,17 +18776,12 @@ func _enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { // ** size of the memory allocation for StrAccum if necessary. // */ func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*Tsqlite3_str)(unsafe.Pointer(p)).FnChar+uint32(N) >= (*Tsqlite3_str)(unsafe.Pointer(p)).FnAlloc { + if (*Tsqlite3_str)(unsafe.Pointer(p)).FnChar+libc.Uint32FromInt32(N) >= (*Tsqlite3_str)(unsafe.Pointer(p)).FnAlloc { _enlargeAndAppend(tls, p, z, N) } else { if N != 0 { - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(p + 16)) += uint32(N) - libc.Xmemcpy(tls, (*Tsqlite3_str)(unsafe.Pointer(p)).FzText+uintptr((*Tsqlite3_str)(unsafe.Pointer(p)).FnChar-uint32(N)), z, uint32(N)) + *(*Tu32)(unsafe.Pointer(p + 16)) += libc.Uint32FromInt32(N) + libc.Xmemcpy(tls, (*Tsqlite3_str)(unsafe.Pointer(p)).FzText+uintptr((*Tsqlite3_str)(unsafe.Pointer(p)).FnChar-libc.Uint32FromInt32(N)), z, libc.Uint32FromInt32(N)) } } } @@ -19826,7 +18805,6 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - _ = libc.Int32FromInt32(0) zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, (*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1)) @@ -19842,7 +18820,7 @@ func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { func _sqlite3StrAccumFinish(tls *libc.TLS, p uintptr) (r uintptr) { if (*TStrAccum)(unsafe.Pointer(p)).FzText != 0 { *(*int8)(unsafe.Pointer((*TStrAccum)(unsafe.Pointer(p)).FzText + uintptr((*TStrAccum)(unsafe.Pointer(p)).FnChar))) = 0 - if (*TStrAccum)(unsafe.Pointer(p)).FmxAlloc > uint32(0) && !(int32((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&libc.Int32FromInt32(SQLITE_PRINTF_MALLOCED) != libc.Int32FromInt32(0)) { + if (*TStrAccum)(unsafe.Pointer(p)).FmxAlloc > uint32(0) && !(libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&libc.Int32FromInt32(SQLITE_PRINTF_MALLOCED) != libc.Int32FromInt32(0)) { return _strAccumFinishRealloc(tls, p) } } @@ -19857,11 +18835,11 @@ func _sqlite3StrAccumFinish(tls *libc.TLS, p uintptr) (r uintptr) { // */ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if (*TStrAccum)(unsafe.Pointer(p)).FaccError != 0 { - Xsqlite3_result_error_code(tls, pCtx, int32((*TStrAccum)(unsafe.Pointer(p)).FaccError)) + Xsqlite3_result_error_code(tls, pCtx, libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FaccError)) Xsqlite3_str_reset(tls, p) } else { - if int32((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { - Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, int32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) + if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { + Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1662, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) @@ -19904,7 +18882,7 @@ func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) (r int32) { var v1 int32 _ = v1 if p != 0 { - v1 = int32((*Tsqlite3_str)(unsafe.Pointer(p)).FaccError) + v1 = libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(p)).FaccError) } else { v1 = int32(SQLITE_NOMEM) } @@ -19922,7 +18900,7 @@ func Xsqlite3_str_length(tls *libc.TLS, p uintptr) (r int32) { } else { v1 = uint32(0) } - return int32(v1) + return libc.Int32FromUint32(v1) } // C documentation @@ -19944,7 +18922,7 @@ func Xsqlite3_str_value(tls *libc.TLS, p uintptr) (r uintptr) { func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { var p1 uintptr _ = p1 - if int32((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { + if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { _sqlite3DbFree(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, (*TStrAccum)(unsafe.Pointer(p)).FzText) p1 = p + 21 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(SQLITE_PRINTF_MALLOCED)) @@ -19973,8 +18951,8 @@ func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { func _sqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { (*TStrAccum)(unsafe.Pointer(p)).FzText = zBase (*TStrAccum)(unsafe.Pointer(p)).Fdb = db - (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = uint32(n) - (*TStrAccum)(unsafe.Pointer(p)).FmxAlloc = uint32(mx) + (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = libc.Uint32FromInt32(n) + (*TStrAccum)(unsafe.Pointer(p)).FmxAlloc = libc.Uint32FromInt32(mx) (*TStrAccum)(unsafe.Pointer(p)).FnChar = uint32(0) (*TStrAccum)(unsafe.Pointer(p)).FaccError = uint8(0) (*TStrAccum)(unsafe.Pointer(p)).FprintfFlags = uint8(0) @@ -20014,12 +18992,11 @@ func _sqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Tva_list) ( var _ /* acc at bp+72 */ TStrAccum var _ /* zBase at bp+0 */ [70]int8 _ = z - _ = libc.Int32FromInt32(0) _sqlite3StrAccumInit(tls, bp+72, db, bp, int32(70), *(*int32)(unsafe.Pointer(db + 116))) (*(*TStrAccum)(unsafe.Pointer(bp + 72))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) Xsqlite3_str_vappendf(tls, bp+72, zFormat, ap) z = _sqlite3StrAccumFinish(tls, bp+72) - if int32((*(*TStrAccum)(unsafe.Pointer(bp + 72))).FaccError) == int32(SQLITE_NOMEM) { + if libc.Int32FromUint8((*(*TStrAccum)(unsafe.Pointer(bp + 72))).FaccError) == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } return z @@ -20197,7 +19174,6 @@ func _sqlite3RCStrRef(tls *libc.TLS, z uintptr) (r uintptr) { var p uintptr _ = p p = z - _ = libc.Int32FromInt32(0) p -= 8 (*TRCStr)(unsafe.Pointer(p)).FnRCRef++ return z @@ -20213,9 +19189,7 @@ func _sqlite3RCStrUnref(tls *libc.TLS, z uintptr) { var p uintptr _ = p p = z - _ = libc.Int32FromInt32(0) p -= 8 - _ = libc.Int32FromInt32(0) if (*TRCStr)(unsafe.Pointer(p)).FnRCRef >= uint64(2) { (*TRCStr)(unsafe.Pointer(p)).FnRCRef-- } else { @@ -20255,9 +19229,7 @@ func _sqlite3RCStrResize(tls *libc.TLS, z uintptr, N Tu64) (r uintptr) { var p, pNew uintptr _, _ = p, pNew p = z - _ = libc.Int32FromInt32(0) p -= 8 - _ = libc.Int32FromInt32(0) pNew = Xsqlite3_realloc64(tls, p, N+uint64(8)+uint64(1)) if pNew == uintptr(0) { Xsqlite3_free(tls, p) @@ -20540,17 +19512,16 @@ func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { *(*Tu32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Prng)) + 12*4)) = uint32(0) _sqlite3Prng.Fn = uint8(0) } - _ = libc.Int32FromInt32(0) for int32(1) != 0 { - if N <= int32(_sqlite3Prng.Fn) { - libc.Xmemcpy(tls, zBuf, uintptr(unsafe.Pointer(&_sqlite3Prng))+64+uintptr(int32(_sqlite3Prng.Fn)-N), uint32(N)) + if N <= libc.Int32FromUint8(_sqlite3Prng.Fn) { + libc.Xmemcpy(tls, zBuf, uintptr(unsafe.Pointer(&_sqlite3Prng))+64+uintptr(libc.Int32FromUint8(_sqlite3Prng.Fn)-N), libc.Uint32FromInt32(N)) p1 = uintptr(unsafe.Pointer(&_sqlite3Prng)) + 128 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) - N) break } - if int32(_sqlite3Prng.Fn) > 0 { + if libc.Int32FromUint8(_sqlite3Prng.Fn) > 0 { libc.Xmemcpy(tls, zBuf, uintptr(unsafe.Pointer(&_sqlite3Prng))+64, uint32(_sqlite3Prng.Fn)) - N -= int32(_sqlite3Prng.Fn) + N -= libc.Int32FromUint8(_sqlite3Prng.Fn) zBuf += uintptr(_sqlite3Prng.Fn) } *(*Tu32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Prng)) + 12*4))++ @@ -20647,8 +19618,6 @@ type SQLiteThread1 = TSQLiteThread1 func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { var p uintptr _ = p - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) p = _sqlite3Malloc(tls, uint64(12)) if p == uintptr(0) { @@ -20669,7 +19638,6 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui // // /* Get the results of the thread */ func _sqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) (r int32) { - _ = libc.Int32FromInt32(0) if p == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -20833,11 +19801,11 @@ func _sqlite3Utf8Read(tls *libc.TLS, pz uintptr) (r Tu32) { c = uint32(*(*uint8)(unsafe.Pointer(v1))) if c >= uint32(0xc0) { c = uint32(_sqlite3Utf8Trans1[c-uint32(0xc0)]) - for int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pz)))))&int32(0xc0) == int32(0x80) { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pz)))))&int32(0xc0) == int32(0x80) { v4 = pz v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ - c = c<<int32(6) + uint32(libc.Int32FromInt32(0x3f)&int32(*(*uint8)(unsafe.Pointer(v3)))) + c = c<<int32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3)))) } if c < uint32(0x80) || c&uint32(0xFFFFF800) == uint32(0xD800) || c&uint32(0xFFFFFFFE) == uint32(0xFFFE) { c = uint32(0xFFFD) @@ -20865,15 +19833,14 @@ func _sqlite3Utf8ReadLimited(tls *libc.TLS, z uintptr, n int32, piOut uintptr) ( var i int32 _, _ = c, i i = int32(1) - _ = libc.Int32FromInt32(0) c = uint32(*(*Tu8)(unsafe.Pointer(z))) if c >= uint32(0xc0) { c = uint32(_sqlite3Utf8Trans1[c-uint32(0xc0)]) if n > int32(4) { n = int32(4) } - for i < n && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(i))))&int32(0xc0) == int32(0x80) { - c = c<<libc.Int32FromInt32(6) + uint32(libc.Int32FromInt32(0x3f)&int32(*(*Tu8)(unsafe.Pointer(z + uintptr(i))))) + for i < n && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(i))))&int32(0xc0) == int32(0x80) { + c = c<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(i))))) i++ } } @@ -20901,19 +19868,13 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in var temp Tu8 var z, zIn, zOut, zTerm, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v5, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, c2, c21, len1, rc, temp, z, zIn, zOut, zTerm, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v5, v6, v7, v8, v9 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the translation is between UTF-16 little and big endian, then ** all that is required is to swap the byte order. This case is handled ** differently from the others. */ - if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) && int32(desiredEnc) != int32(SQLITE_UTF8) { + if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) && libc.Int32FromUint8(desiredEnc) != int32(SQLITE_UTF8) { rc = _sqlite3VdbeMemMakeWriteable(tls, pMem) if rc != SQLITE_OK { - _ = libc.Int32FromInt32(0) return int32(SQLITE_NOMEM) } zIn = (*TMem)(unsafe.Pointer(pMem)).Fz @@ -20930,7 +19891,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in goto translate_out } /* Set len to the maximum number of bytes required in the output buffer. */ - if int32(desiredEnc) == int32(SQLITE_UTF8) { + if libc.Int32FromUint8(desiredEnc) == int32(SQLITE_UTF8) { /* When converting from UTF-16, the maximum growth results from ** translating a 2-byte character to a 4-byte UTF-8 character. ** A single byte is required for the output string @@ -20954,13 +19915,13 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in */ zIn = (*TMem)(unsafe.Pointer(pMem)).Fz zTerm = zIn + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn) - zOut = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(len1)) + zOut = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(len1)) if !(zOut != 0) { return int32(SQLITE_NOMEM) } z = zOut - if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) == int32(SQLITE_UTF8) { - if int32(desiredEnc) == int32(SQLITE_UTF16LE) { + if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) == int32(SQLITE_UTF8) { + if libc.Int32FromUint8(desiredEnc) == int32(SQLITE_UTF16LE) { /* UTF-8 -> UTF-16 Little-endian */ for zIn < zTerm { v2 = zIn @@ -20968,10 +19929,10 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in c = uint32(*(*uint8)(unsafe.Pointer(v2))) if c >= uint32(0xc0) { c = uint32(_sqlite3Utf8Trans1[c-uint32(0xc0)]) - for zIn != zTerm && int32(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { + for zIn != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { v3 = zIn zIn++ - c = c<<int32(6) + uint32(libc.Int32FromInt32(0x3f)&int32(*(*uint8)(unsafe.Pointer(v3)))) + c = c<<int32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3)))) } if c < uint32(0x80) || c&uint32(0xFFFFF800) == uint32(0xD800) || c&uint32(0xFFFFFFFE) == uint32(0xFFFE) { c = uint32(0xFFFD) @@ -21000,7 +19961,6 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in } } } else { - _ = libc.Int32FromInt32(0) /* UTF-8 -> UTF-16 Big-endian */ for zIn < zTerm { v10 = zIn @@ -21008,10 +19968,10 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in c = uint32(*(*uint8)(unsafe.Pointer(v10))) if c >= uint32(0xc0) { c = uint32(_sqlite3Utf8Trans1[c-uint32(0xc0)]) - for zIn != zTerm && int32(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { + for zIn != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { v11 = zIn zIn++ - c = c<<int32(6) + uint32(libc.Int32FromInt32(0x3f)&int32(*(*uint8)(unsafe.Pointer(v11)))) + c = c<<int32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v11)))) } if c < uint32(0x80) || c&uint32(0xFFFFF800) == uint32(0xD800) || c&uint32(0xFFFFFFFE) == uint32(0xFFFE) { c = uint32(0xFFFD) @@ -21045,8 +20005,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in z++ *(*uint8)(unsafe.Pointer(v18)) = uint8(0) } else { - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) == int32(SQLITE_UTF16LE) { + if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) == int32(SQLITE_UTF16LE) { /* UTF-16 Little-endian -> UTF-8 */ for zIn < zTerm { v19 = zIn @@ -21054,16 +20013,16 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in c = uint32(*(*uint8)(unsafe.Pointer(v19))) v20 = zIn zIn++ - c += uint32(int32(*(*uint8)(unsafe.Pointer(v20))) << int32(8)) + c += libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v20))) << int32(8)) if c >= uint32(0xd800) && c < uint32(0xe000) { if zIn < zTerm { v21 = zIn zIn++ - c2 = int32(*(*uint8)(unsafe.Pointer(v21))) + c2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v21))) v22 = zIn zIn++ - c2 += int32(*(*uint8)(unsafe.Pointer(v22))) << int32(8) - c = uint32(c2&libc.Int32FromInt32(0x03FF)) + c&uint32(0x003F)<<int32(10) + (c&uint32(0x03C0)+uint32(0x0040))<<int32(10) + c2 += libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v22))) << int32(8) + c = libc.Uint32FromInt32(c2&libc.Int32FromInt32(0x03FF)) + c&uint32(0x003F)<<int32(10) + (c&uint32(0x03C0)+uint32(0x0040))<<int32(10) } } if c < uint32(0x00080) { @@ -21074,34 +20033,34 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in if c < uint32(0x00800) { v24 = z z++ - *(*uint8)(unsafe.Pointer(v24)) = uint8(int32(0xC0) + int32(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) + *(*uint8)(unsafe.Pointer(v24)) = libc.Uint8FromInt32(int32(0xC0) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) v25 = z z++ - *(*uint8)(unsafe.Pointer(v25)) = uint8(int32(0x80) + int32(uint8(c&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c&libc.Uint32FromInt32(0x3F)))) } else { if c < uint32(0x10000) { v26 = z z++ - *(*uint8)(unsafe.Pointer(v26)) = uint8(int32(0xE0) + int32(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) + *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(0xE0) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v27 = z z++ - *(*uint8)(unsafe.Pointer(v27)) = uint8(int32(0x80) + int32(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v27)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v28 = z z++ - *(*uint8)(unsafe.Pointer(v28)) = uint8(int32(0x80) + int32(uint8(c&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v28)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c&libc.Uint32FromInt32(0x3F)))) } else { v29 = z z++ - *(*uint8)(unsafe.Pointer(v29)) = uint8(int32(0xF0) + int32(uint8(c>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(v29)) = libc.Uint8FromInt32(int32(0xF0) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) v30 = z z++ - *(*uint8)(unsafe.Pointer(v30)) = uint8(int32(0x80) + int32(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v30)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) v31 = z z++ - *(*uint8)(unsafe.Pointer(v31)) = uint8(int32(0x80) + int32(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v31)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v32 = z z++ - *(*uint8)(unsafe.Pointer(v32)) = uint8(int32(0x80) + int32(uint8(c&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c&libc.Uint32FromInt32(0x3F)))) } } } @@ -21111,7 +20070,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in for zIn < zTerm { v33 = zIn zIn++ - c = uint32(int32(*(*uint8)(unsafe.Pointer(v33))) << int32(8)) + c = libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v33))) << int32(8)) v34 = zIn zIn++ c += uint32(*(*uint8)(unsafe.Pointer(v34))) @@ -21119,11 +20078,11 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in if zIn < zTerm { v35 = zIn zIn++ - c21 = int32(*(*uint8)(unsafe.Pointer(v35))) << int32(8) + c21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v35))) << int32(8) v36 = zIn zIn++ - c21 += int32(*(*uint8)(unsafe.Pointer(v36))) - c = uint32(c21&libc.Int32FromInt32(0x03FF)) + c&uint32(0x003F)<<int32(10) + (c&uint32(0x03C0)+uint32(0x0040))<<int32(10) + c21 += libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v36))) + c = libc.Uint32FromInt32(c21&libc.Int32FromInt32(0x03FF)) + c&uint32(0x003F)<<int32(10) + (c&uint32(0x03C0)+uint32(0x0040))<<int32(10) } } if c < uint32(0x00080) { @@ -21134,34 +20093,34 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in if c < uint32(0x00800) { v38 = z z++ - *(*uint8)(unsafe.Pointer(v38)) = uint8(int32(0xC0) + int32(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) + *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(0xC0) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) v39 = z z++ - *(*uint8)(unsafe.Pointer(v39)) = uint8(int32(0x80) + int32(uint8(c&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v39)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c&libc.Uint32FromInt32(0x3F)))) } else { if c < uint32(0x10000) { v40 = z z++ - *(*uint8)(unsafe.Pointer(v40)) = uint8(int32(0xE0) + int32(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) + *(*uint8)(unsafe.Pointer(v40)) = libc.Uint8FromInt32(int32(0xE0) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v41 = z z++ - *(*uint8)(unsafe.Pointer(v41)) = uint8(int32(0x80) + int32(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v42 = z z++ - *(*uint8)(unsafe.Pointer(v42)) = uint8(int32(0x80) + int32(uint8(c&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v42)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c&libc.Uint32FromInt32(0x3F)))) } else { v43 = z z++ - *(*uint8)(unsafe.Pointer(v43)) = uint8(int32(0xF0) + int32(uint8(c>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(0xF0) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) v44 = z z++ - *(*uint8)(unsafe.Pointer(v44)) = uint8(int32(0x80) + int32(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v44)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) v45 = z z++ - *(*uint8)(unsafe.Pointer(v45)) = uint8(int32(0x80) + int32(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v45)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v46 = z z++ - *(*uint8)(unsafe.Pointer(v46)) = uint8(int32(0x80) + int32(uint8(c&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v46)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c&libc.Uint32FromInt32(0x3F)))) } } } @@ -21170,8 +20129,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fn = int32(z) - int32(zOut) } *(*uint8)(unsafe.Pointer(z)) = uint8(0) - _ = libc.Int32FromInt32(0) - c = uint32(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Term) | int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_AffMask)|libc.Int32FromInt32(MEM_Subtype))) + c = libc.Uint32FromInt32(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Term) | libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_AffMask)|libc.Int32FromInt32(MEM_Subtype))) _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(c) (*TMem)(unsafe.Pointer(pMem)).Fenc = desiredEnc @@ -21203,14 +20161,13 @@ func _sqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) (r int32) { _, _, _, _, _ = b1, b2, bom, rc, p1 rc = SQLITE_OK bom = uint8(0) - _ = libc.Int32FromInt32(0) if (*TMem)(unsafe.Pointer(pMem)).Fn > int32(1) { b1 = *(*Tu8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz)) b2 = *(*Tu8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + libc.UintptrFromInt32(1))) - if int32(b1) == int32(0xFE) && int32(b2) == int32(0xFF) { + if libc.Int32FromUint8(b1) == int32(0xFE) && libc.Int32FromUint8(b2) == int32(0xFF) { bom = uint8(SQLITE_UTF16BE) } - if int32(b1) == int32(0xFF) && int32(b2) == int32(0xFE) { + if libc.Int32FromUint8(b1) == int32(0xFF) && libc.Int32FromUint8(b2) == int32(0xFE) { bom = uint8(SQLITE_UTF16LE) } } @@ -21218,7 +20175,7 @@ func _sqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) (r int32) { rc = _sqlite3VdbeMemMakeWriteable(tls, pMem) if rc == SQLITE_OK { *(*int32)(unsafe.Pointer(pMem + 12)) -= int32(2) - libc.Xmemmove(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, (*TMem)(unsafe.Pointer(pMem)).Fz+2, uint32((*TMem)(unsafe.Pointer(pMem)).Fn)) + libc.Xmemmove(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, (*TMem)(unsafe.Pointer(pMem)).Fz+2, libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn)) *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = int8('\000') *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn+int32(1)))) = int8('\000') p1 = pMem + 16 @@ -21249,12 +20206,11 @@ func _sqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) (r1 int32) { } else { zTerm = uintptr(-libc.Int32FromInt32(1)) } - _ = libc.Int32FromInt32(0) - for int32(*(*Tu8)(unsafe.Pointer(z))) != 0 && z < zTerm { + for libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z))) != 0 && z < zTerm { v1 = z z++ - if int32(*(*Tu8)(unsafe.Pointer(v1))) >= int32(0xc0) { - for int32(*(*Tu8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1))) >= int32(0xc0) { + for libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { z++ } } @@ -21288,9 +20244,6 @@ func _sqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc Tu8 _sqlite3VdbeMemRelease(tls, bp) (*(*TMem)(unsafe.Pointer(bp))).Fz = uintptr(0) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return (*(*TMem)(unsafe.Pointer(bp))).Fz } @@ -21311,9 +20264,9 @@ func _sqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) (r int32) { z++ } for n < nChar { - c = int32(*(*uint8)(unsafe.Pointer(z))) + c = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) z += uintptr(2) - if c >= int32(0xd8) && c < int32(0xdc) && int32(*(*uint8)(unsafe.Pointer(z))) >= int32(0xdc) && int32(*(*uint8)(unsafe.Pointer(z))) < int32(0xe0) { + if c >= int32(0xd8) && c < int32(0xdc) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32(0xdc) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) < int32(0xe0) { z += uintptr(2) } n++ @@ -21329,53 +20282,6 @@ type Tdouble_t = float64 type double_t = Tdouble_t -const _FP_INT_UPWARD = 0 -const _FP_INT_DOWNWARD = 1 -const _FP_INT_TOWARDZERO = 2 -const _FP_INT_TONEARESTFROMZERO = 3 -const _FP_INT_TONEAREST = 4 -const _FP_NAN = 0 -const _FP_INFINITE = 1 -const _FP_ZERO = 2 -const _FP_SUBNORMAL = 3 -const _FP_NORMAL = 4 - -/* Return nonzero value if X is canonical. In IEEE interchange binary - formats, all values are canonical, but the argument must still be - converted to its semantic type for any exceptions arising from the - conversion, before being discarded; in extended precision, there - are encodings that are not consistently handled as corresponding to - any particular value of the type, and we return 0 for those. */ - -/* Return nonzero value if X is a signaling NaN. */ - -/* Return nonzero value if X is subnormal. */ - -/* Return nonzero value if X is zero. */ - -/* X/Open wants another strange constant. */ - -/* Some useful constants. */ - -/* GNU extension to provide float constants with similar names. */ - -/* The above constants are not adequate for computation using `long double's. - Therefore we provide as an extension constants with similar names as a - GNU extension. Provide enough digits for the 128-bit IEEE quad. */ - -/* ISO C99 defines some macros to compare number while taking care for - unordered numbers. Many FPUs provide special instructions to support - these operations. Generic support in GCC for these as builtins went - in 2.97, but not all cpus added their patterns until 3.1. Therefore - we enable the builtins from 3.1 onwards and use a generic implementation - othwerwise. */ - -/* An expression whose type has the widest of the evaluation formats - of X and Y (which are of floating-point types). */ - -/* Return X == Y but raising "invalid" and setting errno if X or Y is - a NaN. */ - // C documentation // // /* @@ -21461,7 +20367,7 @@ func _sqlite3Strlen30(tls *libc.TLS, z uintptr) (r int32) { if z == uintptr(0) { return 0 } - return int32(0x3fffffff) & int32(libc.Xstrlen(tls, z)) + return int32(0x3fffffff) & libc.Int32FromUint32(libc.Xstrlen(tls, z)) } // C documentation @@ -21474,11 +20380,10 @@ func _sqlite3Strlen30(tls *libc.TLS, z uintptr) (r int32) { // ** the column name if and only if the COLFLAG_HASTYPE flag is set. // */ func _sqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) (r uintptr) { - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { return (*TColumn)(unsafe.Pointer(pCol)).FzCnName + uintptr(libc.Xstrlen(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + uintptr(1) } else { if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4)) != 0 { - _ = libc.Int32FromInt32(0) return _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4))-int32(1)] } else { return zDflt @@ -21509,7 +20414,6 @@ func _sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { // ** that would be appropriate. // */ func _sqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = err_code if err_code != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FpErr != 0 { _sqlite3ErrorFinish(tls, db, err_code) @@ -21525,7 +20429,6 @@ func _sqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { // ** and error message. // */ func _sqlite3ErrorClear(tls *libc.TLS, db uintptr) { - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_OK (*Tsqlite3)(unsafe.Pointer(db)).FerrByteOffset = -int32(1) if (*Tsqlite3)(unsafe.Pointer(db)).FpErr != 0 { @@ -21568,7 +20471,6 @@ func _sqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uin var z, v1 uintptr var v2 bool _, _, _, _ = ap, z, v1, v2 - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = err_code _sqlite3SystemError(tls, db, err_code) if zFormat == uintptr(0) { @@ -21636,8 +20538,6 @@ func _sqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr var db, zMsg uintptr _, _, _ = ap, db, zMsg db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FerrByteOffset = -int32(2) ap = va zMsg = _sqlite3VMPrintf(tls, db, zFormat, ap) @@ -21710,7 +20610,7 @@ func _sqlite3Dequote(tls *libc.TLS, z uintptr) { return } quote = *(*int8)(unsafe.Pointer(z)) - if !(int32(_sqlite3CtypeMap[uint8(quote)])&libc.Int32FromInt32(0x80) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(quote)])&libc.Int32FromInt32(0x80) != 0) { return } if int32(quote) == int32('[') { @@ -21719,7 +20619,6 @@ func _sqlite3Dequote(tls *libc.TLS, z uintptr) { i = int32(1) j = libc.Int32FromInt32(0) for { - _ = libc.Int32FromInt32(0) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32(quote) { if int32(*(*int8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == int32(quote) { v2 = j @@ -21745,14 +20644,12 @@ func _sqlite3Dequote(tls *libc.TLS, z uintptr) { func _sqlite3DequoteExpr(tls *libc.TLS, p uintptr) { var v1 int32 _ = v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8))))) == int32('"') { v1 = libc.Int32FromInt32(EP_Quoted) | libc.Int32FromInt32(EP_DblQuoted) } else { v1 = int32(EP_Quoted) } - *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(v1) + *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(v1) _sqlite3Dequote(tls, *(*uintptr)(unsafe.Pointer(p + 8))) } @@ -21770,12 +20667,10 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { var pIn, pOut, v1, v3 uintptr var _ /* iValue at bp+0 */ int32 _, _, _, _, _ = bHex, pIn, pOut, v1, v3 - _ = libc.Int32FromInt32(0) if p != 0 { pIn = *(*uintptr)(unsafe.Pointer(p + 8)) pOut = *(*uintptr)(unsafe.Pointer(p + 8)) bHex = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(pIn))) == int32('0') && (int32(*(*int8)(unsafe.Pointer(pIn + 1))) == int32('x') || int32(*(*int8)(unsafe.Pointer(pIn + 1))) == int32('X'))) - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(p)).Fop = uint8(TK_INTEGER) for { if int32(*(*int8)(unsafe.Pointer(pIn))) != int32('_') { @@ -21786,7 +20681,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { (*TExpr)(unsafe.Pointer(p)).Fop = uint8(TK_FLOAT) } } else { - if bHex == 0 && (!(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { + if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1722, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } @@ -21805,7 +20700,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { /* tag-20240227-a: If after dequoting, the number is an integer that ** fits in 32 bits, then it must be converted into EP_IntValue. Other ** parts of the code expect this. See also tag-20240227-b. */ - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_INTEGER) && _sqlite3GetInt32(tls, *(*uintptr)(unsafe.Pointer(p + 8)), bp) != 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_INTEGER) && _sqlite3GetInt32(tls, *(*uintptr)(unsafe.Pointer(p + 8)), bp) != 0 { *(*int32)(unsafe.Pointer(p + 8)) = *(*int32)(unsafe.Pointer(bp)) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(EP_IntValue) } @@ -21831,7 +20726,7 @@ func _sqlite3DequoteToken(tls *libc.TLS, p uintptr) { if (*TToken)(unsafe.Pointer(p)).Fn < uint32(2) { return } - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(p)).Fz)))])&libc.Int32FromInt32(0x80) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(p)).Fz)))])&libc.Int32FromInt32(0x80) != 0) { return } i = uint32(1) @@ -21839,7 +20734,7 @@ func _sqlite3DequoteToken(tls *libc.TLS, p uintptr) { if !(i < (*TToken)(unsafe.Pointer(p)).Fn-uint32(1)) { break } - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(p)).Fz + uintptr(i))))])&int32(0x80) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(p)).Fz + uintptr(i))))])&int32(0x80) != 0 { return } goto _1 @@ -21858,7 +20753,7 @@ func _sqlite3DequoteToken(tls *libc.TLS, p uintptr) { // */ func _sqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { (*TToken)(unsafe.Pointer(p)).Fz = z - (*TToken)(unsafe.Pointer(p)).Fn = uint32(_sqlite3Strlen30(tls, z)) + (*TToken)(unsafe.Pointer(p)).Fn = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) } /* Convenient short-hand */ @@ -21900,14 +20795,14 @@ func _sqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) (r int32) { a = zLeft b = zRight for { - c = int32(*(*uint8)(unsafe.Pointer(a))) - x = int32(*(*uint8)(unsafe.Pointer(b))) + c = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a))) + x = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(b))) if c == x { if c == 0 { break } } else { - c = int32(_sqlite3UpperToLower[c]) - int32(_sqlite3UpperToLower[x]) + c = libc.Int32FromUint8(_sqlite3UpperToLower[c]) - libc.Int32FromUint8(_sqlite3UpperToLower[x]) if c != 0 { break } @@ -21941,7 +20836,7 @@ func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) (r for { v2 = N N-- - if !(v2 > 0 && int32(*(*uint8)(unsafe.Pointer(a))) != 0 && int32(_sqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) == int32(_sqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))])) { + if !(v2 > 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a))) != 0 && libc.Int32FromUint8(_sqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) == libc.Int32FromUint8(_sqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))])) { break } a++ @@ -21950,7 +20845,7 @@ func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) (r if N < 0 { v3 = 0 } else { - v3 = int32(_sqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) - int32(_sqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))]) + v3 = libc.Int32FromUint8(_sqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) - libc.Int32FromUint8(_sqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))]) } return v3 } @@ -21968,7 +20863,7 @@ func _sqlite3StrIHash(tls *libc.TLS, z uintptr) (r Tu8) { return uint8(0) } for *(*int8)(unsafe.Pointer(z)) != 0 { - h = Tu8(int32(h) + int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z)))])) + h = Tu8(int32(h) + libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])) z++ } return h @@ -22050,27 +20945,25 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T var _ /* rr at bp+0 */ [2]float64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = d, e, eType, eValid, esign, i, incr, nDigit, r, s, s2, sign, zEnd, v2, v3, v4 /* sign * significand * (10 ^ (esign * exponent)) */ - sign = int32(1) /* sign of significand */ - s = uint64(0) /* significand */ - d = 0 /* adjust exponent for shifting decimal point */ - esign = int32(1) /* sign of exponent */ - e = 0 /* exponent */ - eValid = int32(1) /* True exponent is either not used or is well-formed */ - nDigit = 0 /* Number of digits processed */ - eType = int32(1) /* 1: pure integer, 2+: fractional -1 or less: bad UTF16 */ - _ = libc.Int32FromInt32(0) + sign = int32(1) /* sign of significand */ + s = uint64(0) /* significand */ + d = 0 /* adjust exponent for shifting decimal point */ + esign = int32(1) /* sign of exponent */ + e = 0 /* exponent */ + eValid = int32(1) /* True exponent is either not used or is well-formed */ + nDigit = 0 /* Number of digits processed */ + eType = int32(1) /* 1: pure integer, 2+: fractional -1 or less: bad UTF16 */ *(*float64)(unsafe.Pointer(pResult)) = float64(0) /* Default return value, in case of an error */ if length == 0 { return 0 } - if int32(enc) == int32(SQLITE_UTF8) { + if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { incr = int32(1) zEnd = z + uintptr(length) } else { incr = int32(2) length &= ^libc.Int32FromInt32(1) - _ = libc.Int32FromInt32(0) - i = int32(3) - int32(enc) + i = int32(3) - libc.Int32FromUint8(enc) for { if !(i < length && int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) { break @@ -22084,10 +20977,10 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T eType = -int32(100) } zEnd = z + uintptr(i^int32(1)) - z += uintptr(int32(enc) & libc.Int32FromInt32(1)) + z += uintptr(libc.Int32FromUint8(enc) & libc.Int32FromInt32(1)) } /* skip leading spaces */ - for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { + for z < zEnd && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z += uintptr(incr) } if z >= zEnd { @@ -22103,14 +20996,14 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T } } /* copy max significant digits to significand */ - for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { - s = s*uint64(10) + uint64(int32(*(*int8)(unsafe.Pointer(z)))-libc.Int32FromUint8('0')) + for z < zEnd && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { + s = s*uint64(10) + libc.Uint64FromInt32(int32(*(*int8)(unsafe.Pointer(z)))-libc.Int32FromUint8('0')) z += uintptr(incr) nDigit++ if s >= (libc.Uint64FromUint32(0xffffffff)|libc.Uint64FromUint32(0xffffffff)<<libc.Int32FromInt32(32)-libc.Uint64FromInt32(9))/libc.Uint64FromInt32(10) { /* skip non-significant significand digits ** (increase exponent by d to shift decimal left) */ - for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { + for z < zEnd && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { z += uintptr(incr) d++ } @@ -22125,9 +21018,9 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T eType++ /* copy digits from after decimal to significand ** (decrease exponent by d to shift decimal right) */ - for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { + for z < zEnd && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { if s < (libc.Uint64FromUint32(0xffffffff)|libc.Uint64FromUint32(0xffffffff)<<libc.Int32FromInt32(32)-libc.Uint64FromInt32(9))/libc.Uint64FromInt32(10) { - s = s*uint64(10) + uint64(int32(*(*int8)(unsafe.Pointer(z)))-libc.Int32FromUint8('0')) + s = s*uint64(10) + libc.Uint64FromInt32(int32(*(*int8)(unsafe.Pointer(z)))-libc.Int32FromUint8('0')) d-- nDigit++ } @@ -22158,7 +21051,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T } } /* copy digits to exponent */ - for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { + for z < zEnd && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { if e < int32(10000) { v2 = e*int32(10) + (int32(*(*int8)(unsafe.Pointer(z))) - int32('0')) } else { @@ -22170,7 +21063,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T } } /* skip trailing spaces */ - for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { + for z < zEnd && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z += uintptr(incr) } goto do_atof_calc @@ -22229,7 +21122,6 @@ do_atof_calc: r = r * libc.Float64FromFloat64(0.1) } } - _ = libc.Int32FromInt32(0) if r > +libc.Float64FromFloat64(1.7976931348623157081452742373e+308) { *(*float64)(unsafe.Pointer(pResult)) = float64(+libc.X__builtin_inff(tls)) } else { @@ -22280,7 +21172,6 @@ do_atof_calc: if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } - _ = libc.Int32FromInt32(0) goto atof_return atof_return: ; @@ -22319,16 +21210,16 @@ func _sqlite3Int64ToText(tls *libc.TLS, v Ti64, zOut uintptr) (r int32) { if v == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) { v1 = libc.Uint64FromInt32(1) << libc.Int32FromInt32(63) } else { - v1 = uint64(-v) + v1 = libc.Uint64FromInt64(-v) } x = v1 } else { - x = uint64(v) + x = libc.Uint64FromInt64(v) } - i = int32(libc.Uint32FromInt64(22) - libc.Uint32FromInt32(2)) + i = libc.Int32FromUint32(libc.Uint32FromInt64(22) - libc.Uint32FromInt32(2)) (*(*[22]int8)(unsafe.Pointer(bp)))[libc.Uint32FromInt64(22)-libc.Uint32FromInt32(1)] = 0 for int32(1) != 0 { - (*(*[22]int8)(unsafe.Pointer(bp)))[i] = int8(x%uint64(10) + uint64('0')) + (*(*[22]int8)(unsafe.Pointer(bp)))[i] = libc.Int8FromUint64(x%uint64(10) + uint64('0')) x = x / uint64(10) if x == uint64(0) { break @@ -22340,8 +21231,8 @@ func _sqlite3Int64ToText(tls *libc.TLS, v Ti64, zOut uintptr) (r int32) { v2 = i (*(*[22]int8)(unsafe.Pointer(bp)))[v2] = int8('-') } - libc.Xmemcpy(tls, zOut, bp+uintptr(i), uint32(22)-uint32(i)) - return int32(libc.Uint32FromInt64(22) - libc.Uint32FromInt32(1) - uint32(i)) + libc.Xmemcpy(tls, zOut, bp+uintptr(i), uint32(22)-libc.Uint32FromInt32(i)) + return libc.Int32FromUint32(libc.Uint32FromInt64(22) - libc.Uint32FromInt32(1) - libc.Uint32FromInt32(i)) } // C documentation @@ -22414,14 +21305,12 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc c = 0 nonNum = 0 zEnd = zNum + uintptr(length) - _ = libc.Int32FromInt32(0) - if int32(enc) == int32(SQLITE_UTF8) { + if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { incr = int32(1) } else { incr = int32(2) length &= ^libc.Int32FromInt32(1) - _ = libc.Int32FromInt32(0) - i = int32(3) - int32(enc) + i = int32(3) - libc.Int32FromUint8(enc) for { if !(i < length && int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) == 0) { break @@ -22433,9 +21322,9 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc } nonNum = libc.BoolInt32(i < length) zEnd = zNum + uintptr(i^int32(1)) - zNum += uintptr(int32(enc) & libc.Int32FromInt32(1)) + zNum += uintptr(libc.Int32FromUint8(enc) & libc.Int32FromInt32(1)) } - for zNum < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum)))])&int32(0x01) != 0 { + for zNum < zEnd && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zNum)))])&int32(0x01) != 0 { zNum += uintptr(incr) } if zNum < zEnd { @@ -22461,13 +21350,13 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc if !(v4 && v3 >= int32('0') && c <= int32('9')) { break } - u = u*uint64(10) + uint64(c) - uint64('0') + u = u*uint64(10) + libc.Uint64FromInt32(c) - uint64('0') goto _2 _2: ; i += incr } - if u > uint64(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) { + if u > libc.Uint64FromInt64(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) { /* This test and assignment is needed only to suppress UB warnings ** from clang and -fsanitize=undefined. This test and assignment make ** the code a little larger and slower, and no harm comes from omitting @@ -22480,9 +21369,9 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc *(*Ti64)(unsafe.Pointer(pNum)) = v5 } else { if neg != 0 { - *(*Ti64)(unsafe.Pointer(pNum)) = -int64(u) + *(*Ti64)(unsafe.Pointer(pNum)) = -libc.Int64FromUint64(u) } else { - *(*Ti64)(unsafe.Pointer(pNum)) = int64(u) + *(*Ti64)(unsafe.Pointer(pNum)) = libc.Int64FromUint64(u) } } rc = 0 @@ -22495,7 +21384,7 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc if zNum+uintptr(i) < zEnd { /* Extra bytes at the end */ jj = i for cond := true; cond; cond = zNum+uintptr(jj) < zEnd { - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum + uintptr(jj))))])&libc.Int32FromInt32(0x01) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zNum + uintptr(jj))))])&libc.Int32FromInt32(0x01) != 0) { rc = int32(1) /* Extra non-space text after the integer */ break } @@ -22506,7 +21395,6 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc } if i < int32(19)*incr { /* Less than 19 digits, so we know that it fits in 64 bits */ - _ = libc.Int32FromInt32(0) return rc } else { /* zNum is a 19-digit numbers. Compare it against 9223372036854775808. */ @@ -22518,7 +21406,6 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc c = v6 if c < 0 { /* zNum is less than 9223372036854775808 so it fits */ - _ = libc.Int32FromInt32(0) return rc } else { if neg != 0 { @@ -22533,7 +21420,6 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc } else { /* zNum is exactly 9223372036854775808. Fits if negative. The ** special case 2 overflow if positive */ - _ = libc.Int32FromInt32(0) if neg != 0 { v8 = rc } else { @@ -22580,7 +21466,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } k = i for { - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(k))))])&int32(0x08) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(k))))])&int32(0x08) != 0) { break } *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))*uint64(16) + uint64(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(k)))))) @@ -22598,7 +21484,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = int32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1766)) + n = libc.Int32FromUint32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1766)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22636,7 +21522,7 @@ func _sqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) (r int32) { if int32(*(*int8)(unsafe.Pointer(zNum))) == int32('+') { zNum++ } else { - if int32(*(*int8)(unsafe.Pointer(zNum))) == int32('0') && (int32(*(*int8)(unsafe.Pointer(zNum + 1))) == int32('x') || int32(*(*int8)(unsafe.Pointer(zNum + 1))) == int32('X')) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum + 2)))])&int32(0x08) != 0 { + if int32(*(*int8)(unsafe.Pointer(zNum))) == int32('0') && (int32(*(*int8)(unsafe.Pointer(zNum + 1))) == int32('x') || int32(*(*int8)(unsafe.Pointer(zNum + 1))) == int32('X')) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zNum + 2)))])&int32(0x08) != 0 { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) zNum += uintptr(2) for int32(*(*int8)(unsafe.Pointer(zNum))) == int32('0') { @@ -22644,7 +21530,7 @@ func _sqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) (r int32) { } i = 0 for { - if !(i < int32(8) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))])&int32(0x08) != 0) { + if !(i < int32(8) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))])&int32(0x08) != 0) { break } *(*Tu32)(unsafe.Pointer(bp)) = *(*Tu32)(unsafe.Pointer(bp))*uint32(16) + uint32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))))) @@ -22653,7 +21539,7 @@ func _sqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) (r int32) { ; i++ } - if *(*Tu32)(unsafe.Pointer(bp))&uint32(0x80000000) == uint32(0) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))])&int32(0x08) == 0 { + if *(*Tu32)(unsafe.Pointer(bp))&uint32(0x80000000) == uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))])&int32(0x08) == 0 { libc.Xmemcpy(tls, pValue, bp, uint32(4)) return int32(1) } else { @@ -22662,7 +21548,7 @@ func _sqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) (r int32) { } } } - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum)))])&libc.Int32FromInt32(0x04) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zNum)))])&libc.Int32FromInt32(0x04) != 0) { return 0 } for int32(*(*int8)(unsafe.Pointer(zNum))) == int32('0') { @@ -22763,7 +21649,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } libc.Xmemcpy(tls, bp+8, bp, uint32(8)) - e = int32(*(*Tu64)(unsafe.Pointer(bp + 8)) >> int32(52)) + e = libc.Int32FromUint64(*(*Tu64)(unsafe.Pointer(bp + 8)) >> int32(52)) if e&int32(0x7ff) == int32(0x7ff) { (*TFpDecode)(unsafe.Pointer(p)).FisSpecial = int8(int32(1) + libc.BoolInt32(*(*Tu64)(unsafe.Pointer(bp + 8)) != uint64(0x7ff0000000000000))) (*TFpDecode)(unsafe.Pointer(p)).Fn = 0 @@ -22841,18 +21727,14 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun *(*Tu64)(unsafe.Pointer(bp + 8)) = v1 } /* Extract significant digits. */ - i = int32(libc.Uint32FromInt64(24) - libc.Uint32FromInt32(1)) - _ = libc.Int32FromInt32(0) + i = libc.Int32FromUint32(libc.Uint32FromInt64(24) - libc.Uint32FromInt32(1)) for *(*Tu64)(unsafe.Pointer(bp + 8)) != 0 { v2 = i i-- - *(*int8)(unsafe.Pointer(p + 16 + uintptr(v2))) = int8(*(*Tu64)(unsafe.Pointer(bp + 8))%uint64(10) + uint64('0')) + *(*int8)(unsafe.Pointer(p + 16 + uintptr(v2))) = libc.Int8FromUint64(*(*Tu64)(unsafe.Pointer(bp + 8))%uint64(10) + uint64('0')) *(*Tu64)(unsafe.Pointer(bp + 8)) /= uint64(10) } - _ = libc.Int32FromInt32(0) - (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(libc.Uint32FromInt64(24) - libc.Uint32FromInt32(1) - uint32(i)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + (*TFpDecode)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32(libc.Uint32FromInt64(24) - libc.Uint32FromInt32(1) - libc.Uint32FromInt32(i)) (*TFpDecode)(unsafe.Pointer(p)).FiDP = (*TFpDecode)(unsafe.Pointer(p)).Fn + exp if iRound <= 0 { iRound = (*TFpDecode)(unsafe.Pointer(p)).FiDP - iRound @@ -22893,7 +21775,6 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 16 + uintptr(i+int32(1)) - _ = libc.Int32FromInt32(0) for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } @@ -22914,10 +21795,10 @@ func _sqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) (r int32) { v = uint64(0) i = 0 for { - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&int32(0x04) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&int32(0x04) != 0) { break } - v = v*uint64(10) + uint64(*(*int8)(unsafe.Pointer(z + uintptr(i)))) - uint64('0') + v = v*uint64(10) + libc.Uint64FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i)))) - uint64('0') if v > uint64(4294967296) { *(*Tu32)(unsafe.Pointer(pI)) = uint32(0) return 0 @@ -22999,7 +21880,6 @@ func _putVarint64(tls *libc.TLS, p uintptr, v Tu64) (r int32) { } p3 = bp *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & libc.Int32FromInt32(0x7f)) - _ = libc.Int32FromInt32(0) i = 0 j = n - libc.Int32FromInt32(1) for { @@ -23053,12 +21933,10 @@ func _sqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { return uint8(1) } if int32(*(*int8)(unsafe.Pointer(p + 1))) >= 0 { - *(*Tu64)(unsafe.Pointer(v)) = uint64(uint32(int32(*(*uint8)(unsafe.Pointer(p)))&libc.Int32FromInt32(0x7f))<<libc.Int32FromInt32(7) | uint32(*(*uint8)(unsafe.Pointer(p + 1)))) + *(*Tu64)(unsafe.Pointer(v)) = uint64(libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))&libc.Int32FromInt32(0x7f))<<libc.Int32FromInt32(7) | uint32(*(*uint8)(unsafe.Pointer(p + 1)))) return uint8(2) } /* Verify that constants are precomputed correctly */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) a = uint32(*(*uint8)(unsafe.Pointer(p))) << int32(14) b = uint32(*(*uint8)(unsafe.Pointer(p + 1))) p += uintptr(2) @@ -23196,20 +22074,18 @@ func _sqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { _ = n /* Assume that the single-byte case has already been handled by ** the getVarint32() macro */ - _ = libc.Int32FromInt32(0) - if int32(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0x80) == 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0x80) == 0 { /* This is the two-byte case */ - *(*Tu32)(unsafe.Pointer(v)) = uint32(int32(*(*uint8)(unsafe.Pointer(p)))&int32(0x7f)<<int32(7) | int32(*(*uint8)(unsafe.Pointer(p + 1)))) + *(*Tu32)(unsafe.Pointer(v)) = libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))&int32(0x7f)<<int32(7) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))) return uint8(2) } - if int32(*(*uint8)(unsafe.Pointer(p + 2)))&int32(0x80) == 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))&int32(0x80) == 0 { /* This is the three-byte case */ - *(*Tu32)(unsafe.Pointer(v)) = uint32(int32(*(*uint8)(unsafe.Pointer(p)))&int32(0x7f)<<int32(14) | int32(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0x7f)<<int32(7) | int32(*(*uint8)(unsafe.Pointer(p + 2)))) + *(*Tu32)(unsafe.Pointer(v)) = libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))&int32(0x7f)<<int32(14) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0x7f)<<int32(7) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))) return uint8(3) } /* four or more bytes */ n = _sqlite3GetVarint(tls, p, bp) - _ = libc.Int32FromInt32(0) if *(*Tu64)(unsafe.Pointer(bp))&(libc.Uint64FromInt32(1)<<libc.Int32FromInt32(32)-libc.Uint64FromInt32(1)) != *(*Tu64)(unsafe.Pointer(bp)) { *(*Tu32)(unsafe.Pointer(v)) = uint32(0xffffffff) } else { @@ -23233,7 +22109,6 @@ func _sqlite3VarintLen(tls *libc.TLS, v Tu64) (r int32) { if !(v != uint64(0)) { break } - _ = libc.Int32FromInt32(0) goto _1 _1: ; @@ -23271,9 +22146,8 @@ func _sqlite3Put4byte(tls *libc.TLS, p uintptr, v Tu32) { // ** character: 0..9a..fA..F // */ func _sqlite3HexToInt(tls *libc.TLS, h int32) (r Tu8) { - _ = libc.Int32FromInt32(0) h += int32(9) * (int32(1) & (h >> int32(6))) - return uint8(h & libc.Int32FromInt32(0xf)) + return libc.Uint8FromInt32(h & libc.Int32FromInt32(0xf)) } // C documentation @@ -23288,7 +22162,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr var i int32 var zBlob uintptr _, _ = i, zBlob - zBlob = _sqlite3DbMallocRawNN(tls, db, uint64(n/int32(2)+int32(1))) + zBlob = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(n/int32(2)+int32(1))) n-- if zBlob != 0 { i = 0 @@ -23296,7 +22170,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr if !(i < n) { break } - *(*int8)(unsafe.Pointer(zBlob + uintptr(i/int32(2)))) = int8(int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))))<<int32(4) | int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(i+int32(1)))))))) + *(*int8)(unsafe.Pointer(zBlob + uintptr(i/int32(2)))) = int8(libc.Int32FromUint8(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))))<<int32(4) | libc.Int32FromUint8(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(i+int32(1)))))))) goto _1 _1: ; @@ -23344,7 +22218,7 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState - if int32(eOpenState) != int32(SQLITE_STATE_OPEN) { + if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { _logBadConnection(tls, __ccgo_ts+1829) } @@ -23359,7 +22233,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState - if int32(eOpenState) != int32(SQLITE_STATE_SICK) && int32(eOpenState) != int32(SQLITE_STATE_OPEN) && int32(eOpenState) != int32(SQLITE_STATE_BUSY) { + if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { _logBadConnection(tls, __ccgo_ts+1838) return 0 } else { @@ -23420,7 +22294,7 @@ func _sqlite3LogEstAdd(tls *libc.TLS, a TLogEst, b TLogEst) (r TLogEst) { if int32(a) > int32(b)+int32(31) { return int16(int32(a) + int32(1)) } - return int16(int32(a) + int32(_x[int32(a)-int32(b)])) + return int16(int32(a) + libc.Int32FromUint8(_x[int32(a)-int32(b)])) } else { if int32(b) > int32(a)+int32(49) { return b @@ -23428,7 +22302,7 @@ func _sqlite3LogEstAdd(tls *libc.TLS, a TLogEst, b TLogEst) (r TLogEst) { if int32(b) > int32(a)+int32(31) { return int16(int32(b) + int32(1)) } - return int16(int32(b) + int32(_x[int32(b)-int32(a)])) + return int16(int32(b) + libc.Int32FromUint8(_x[int32(b)-int32(a)])) } return r } @@ -23490,7 +22364,7 @@ func _sqlite3LogEst(tls *libc.TLS, x Tu64) (r TLogEst) { } else { i = int32(60) - libc.X__builtin_clzll(tls, x) y = TLogEst(int32(y) + i*libc.Int32FromInt32(10)) - x >>= uint64(i) + x >>= libc.Uint64FromInt32(i) } return int16(int32(_a[x&uint64(7)]) + int32(y) - int32(10)) } @@ -23518,7 +22392,6 @@ func _sqlite3LogEstFromDouble(tls *libc.TLS, _x float64) (r TLogEst) { var e TLogEst var _ /* a at bp+8 */ Tu64 _ = e - _ = libc.Int32FromInt32(0) if *(*float64)(unsafe.Pointer(bp)) <= libc.Float64FromInt32(1) { return 0 } @@ -23526,7 +22399,7 @@ func _sqlite3LogEstFromDouble(tls *libc.TLS, _x float64) (r TLogEst) { return _sqlite3LogEst(tls, uint64(*(*float64)(unsafe.Pointer(bp)))) } libc.Xmemcpy(tls, bp+8, bp, uint32(8)) - e = int16(*(*Tu64)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(52) - uint64(1022)) + e = libc.Int16FromUint64(*(*Tu64)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(52) - uint64(1022)) return int16(int32(e) * int32(10)) } @@ -23539,7 +22412,7 @@ func _sqlite3LogEstToInt(tls *libc.TLS, x TLogEst) (r Tu64) { var n Tu64 var v1 uint64 _, _ = n, v1 - n = uint64(int32(x) % int32(10)) + n = libc.Uint64FromInt32(int32(x) % int32(10)) x = TLogEst(int32(x) / libc.Int32FromInt32(10)) if n >= uint64(5) { n -= uint64(2) @@ -23549,7 +22422,7 @@ func _sqlite3LogEstToInt(tls *libc.TLS, x TLogEst) (r Tu64) { } } if int32(x) > int32(60) { - return uint64(libc.Int64FromUint32(0xffffffff) | libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) + return libc.Uint64FromInt64(libc.Int64FromUint32(0xffffffff) | libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) } if int32(x) >= int32(3) { v1 = (n + uint64(8)) << (int32(x) - int32(3)) @@ -23604,7 +22477,7 @@ func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nNa var v1 int64 _, _, _, _, _, _ = i, nAlloc, nInt, pOut, z, v1 /* Index in pIn[] where zName is stored */ nInt = nName/int32(4) + int32(3) - _ = libc.Int32FromInt32(0) /* Verify ok to add new elements */ + /* Verify ok to add new elements */ if pIn == uintptr(0) || *(*TVList)(unsafe.Pointer(pIn + 1*4))+nInt > *(*TVList)(unsafe.Pointer(pIn)) { if pIn != 0 { v1 = int64(2) * int64(*(*TVList)(unsafe.Pointer(pIn))) @@ -23613,7 +22486,7 @@ func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nNa } /* Enlarge the allocation */ nAlloc = v1 + int64(nInt) - pOut = _sqlite3DbRealloc(tls, db, pIn, uint64(nAlloc*int64(4))) + pOut = _sqlite3DbRealloc(tls, db, pIn, libc.Uint64FromInt64(nAlloc*int64(4))) if pOut == uintptr(0) { return pIn } @@ -23628,8 +22501,7 @@ func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nNa *(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4)) = nInt z = pIn + uintptr(i+int32(2))*4 *(*TVList)(unsafe.Pointer(pIn + 1*4)) = i + nInt - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, z, zName, uint32(nName)) + libc.Xmemcpy(tls, z, zName, libc.Uint32FromInt32(nName)) *(*int8)(unsafe.Pointer(z + uintptr(nName))) = 0 return pIn } @@ -23675,7 +22547,7 @@ func _sqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int i = int32(2) for cond := true; cond; cond = i < mx { z = pIn + uintptr(i+int32(2))*4 - if libc.Xstrncmp(tls, z, zName, uint32(nName)) == 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(nName)))) == 0 { + if libc.Xstrncmp(tls, z, zName, libc.Uint32FromInt32(nName)) == 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(nName)))) == 0 { return *(*TVList)(unsafe.Pointer(pIn + uintptr(i)*4)) } i += *(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4)) @@ -23714,7 +22586,6 @@ func _sqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int // ** "pNew" is a pointer to the hash table that is to be initialized. // */ func _sqlite3HashInit(tls *libc.TLS, pNew uintptr) { - _ = libc.Int32FromInt32(0) (*THash)(unsafe.Pointer(pNew)).Ffirst = uintptr(0) (*THash)(unsafe.Pointer(pNew)).Fcount = uint32(0) (*THash)(unsafe.Pointer(pNew)).Fhtsize = uint32(0) @@ -23730,7 +22601,6 @@ func _sqlite3HashInit(tls *libc.TLS, pNew uintptr) { func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { var elem, next_elem uintptr _, _ = elem, next_elem /* For looping over all elements of the table */ - _ = libc.Int32FromInt32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst (*THash)(unsafe.Pointer(pH)).Ffirst = uintptr(0) Xsqlite3_free(tls, (*THash)(unsafe.Pointer(pH)).Fht) @@ -23758,9 +22628,9 @@ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { for { v2 = z z++ - v1 = uint8(*(*int8)(unsafe.Pointer(v2))) + v1 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v2))) c = v1 - if !(int32(v1) != 0) { + if !(libc.Int32FromUint8(v1) != 0) { break } /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). @@ -23845,7 +22715,7 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { } Xsqlite3_free(tls, (*THash)(unsafe.Pointer(pH)).Fht) (*THash)(unsafe.Pointer(pH)).Fht = new_ht - v1 = uint32(_sqlite3MallocSize(tls, new_ht)) / libc.Uint32FromInt64(8) + v1 = libc.Uint32FromInt32(_sqlite3MallocSize(tls, new_ht)) / libc.Uint32FromInt64(8) new_size = v1 (*THash)(unsafe.Pointer(pH)).Fhtsize = v1 libc.Xmemset(tls, new_ht, 0, new_size*uint32(8)) @@ -23891,7 +22761,6 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - _ = libc.Int32FromInt32(0) if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } @@ -23924,14 +22793,11 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } - _ = libc.Int32FromInt32(0) (*T_ht)(unsafe.Pointer(pEntry)).Fcount-- } Xsqlite3_free(tls, elem) (*THash)(unsafe.Pointer(pH)).Fcount-- if (*THash)(unsafe.Pointer(pH)).Fcount == uint32(0) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3HashClear(tls, pH) } } @@ -23943,8 +22809,6 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) // ** found, or NULL if there is no match. // */ func _sqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return (*THashElem)(unsafe.Pointer(_findElementWithHash(tls, pH, pKey, uintptr(0)))).Fdata } @@ -23970,8 +22834,6 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( var elem, new_elem, old_data, v1 uintptr var _ /* h at bp+0 */ uint32 _, _, _, _ = elem, new_elem, old_data, v1 /* New element added to the pH */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) elem = _findElementWithHash(tls, pH, pKey, bp) if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata @@ -23995,7 +22857,6 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( (*THash)(unsafe.Pointer(pH)).Fcount++ if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - _ = libc.Int32FromInt32(0) *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize } } @@ -24211,102 +23072,333 @@ var _azName = [190]uintptr{ 189: __ccgo_ts + 3447, } +type Tregister_t = int32 + +type register_t = Tregister_t + +type Tsuseconds_t = int64 + +type suseconds_t = Tsuseconds_t + +type Tint8_t = int8 + +type int8_t = Tint8_t + +type Tint16_t = int16 + +type int16_t = Tint16_t + +type Tint32_t = int32 + +type int32_t = Tint32_t + +type Tint64_t = int64 + +type int64_t = Tint64_t + +type Tu_int64_t = uint64 + +type u_int64_t = Tu_int64_t + +type Tmode_t = uint32 + +type mode_t = Tmode_t + +type Tnlink_t = uint32 + +type nlink_t = Tnlink_t + +type Tino_t = uint64 + +type ino_t = Tino_t + +type Tdev_t = uint64 + +type dev_t = Tdev_t + +type Tblksize_t = int32 + +type blksize_t = Tblksize_t + +type Tblkcnt_t = int64 + +type blkcnt_t = Tblkcnt_t + +type Tfsblkcnt_t = uint64 + +type fsblkcnt_t = Tfsblkcnt_t + +type Tfsfilcnt_t = uint64 + +type fsfilcnt_t = Tfsfilcnt_t + +type Tid_t = uint32 + +type id_t = Tid_t + +type Tuid_t = uint32 + +type uid_t = Tuid_t + +type Tgid_t = uint32 + +type gid_t = Tgid_t + +type Tkey_t = int32 + +type key_t = Tkey_t + +type Tuseconds_t = uint32 + +type useconds_t = Tuseconds_t + +type Tpthread_t = uintptr + +type pthread_t = Tpthread_t + +type Tpthread_once_t = int32 + +type pthread_once_t = Tpthread_once_t + +type Tpthread_key_t = uint32 + +type pthread_key_t = Tpthread_key_t + +type Tpthread_spinlock_t = int32 + +type pthread_spinlock_t = Tpthread_spinlock_t + +type Tpthread_mutexattr_t = struct { + F__attr uint32 +} + +type pthread_mutexattr_t = Tpthread_mutexattr_t + +type Tpthread_condattr_t = struct { + F__attr uint32 +} + +type pthread_condattr_t = Tpthread_condattr_t + +type Tpthread_barrierattr_t = struct { + F__attr uint32 +} + +type pthread_barrierattr_t = Tpthread_barrierattr_t + +type Tpthread_rwlockattr_t = struct { + F__attr [2]uint32 +} + +type pthread_rwlockattr_t = Tpthread_rwlockattr_t + +type Tpthread_attr_t = struct { + F__u struct { + F__vi [0][9]int32 + F__s [0][9]uint32 + F__i [9]int32 + } +} + +type pthread_attr_t = Tpthread_attr_t + +type Tpthread_mutex_t = struct { + F__u struct { + F__vi [0][6]int32 + F__p [0][6]uintptr + F__i [6]int32 + } + F__ccgo_room int32 +} + +type pthread_mutex_t = Tpthread_mutex_t + +type Tpthread_cond_t = struct { + F__u struct { + F__vi [0][12]int32 + F__p [0][12]uintptr + F__i [12]int32 + } +} + +type pthread_cond_t = Tpthread_cond_t + +type Tpthread_rwlock_t = struct { + F__u struct { + F__vi [0][8]int32 + F__p [0][8]uintptr + F__i [8]int32 + } +} + +type pthread_rwlock_t = Tpthread_rwlock_t + +type Tpthread_barrier_t = struct { + F__u struct { + F__vi [0][5]int32 + F__p [0][5]uintptr + F__i [5]int32 + } +} + +type pthread_barrier_t = Tpthread_barrier_t + +type Tu_int8_t = uint8 + +type u_int8_t = Tu_int8_t + +type Tu_int16_t = uint16 + +type u_int16_t = Tu_int16_t + +type Tu_int32_t = uint32 + +type u_int32_t = Tu_int32_t + +type Tcaddr_t = uintptr + +type caddr_t = Tcaddr_t + +type Tu_char = uint8 + +type u_char = Tu_char + +type Tu_short = uint16 + +type u_short = Tu_short + +type Tushort = uint16 + +type ushort = Tushort + +type Tu_int = uint32 + +type u_int = Tu_int + +type Tuint = uint32 + +type uint = Tuint + +type Tu_long = uint32 + +type u_long = Tu_long + +type Tulong = uint32 + +type ulong = Tulong + +type Tquad_t = int64 + +type quad_t = Tquad_t + +type Tu_quad_t = uint64 + +type u_quad_t = Tu_quad_t + +type Tuint16_t = uint16 + +type uint16_t = Tuint16_t + +type Tuint32_t = uint32 + +type uint32_t = Tuint32_t + +type Tuint64_t = uint64 + +type uint64_t = Tuint64_t + +type Ttimeval = struct { + Ftv_sec Ttime_t + Ftv_usec Tsuseconds_t +} + +type timeval = Ttimeval + +type Tsigset_t = struct { + F__bits [32]uint32 +} + +type sigset_t = Tsigset_t + +type t__sigset_t = Tsigset_t + +type Tfd_mask = uint32 + +type fd_mask = Tfd_mask + +type Tfd_set = struct { + Ffds_bits [32]uint32 +} + +type fd_set = Tfd_set + type Tstat = struct { - Fst_dev t__dev_t - F__pad1 uint16 - F__st_ino t__ino_t - Fst_mode t__mode_t - Fst_nlink t__nlink_t - Fst_uid t__uid_t - Fst_gid t__gid_t - Fst_rdev t__dev_t - F__pad2 uint16 - Fst_size t__off64_t - Fst_blksize t__blksize_t - Fst_blocks t__blkcnt64_t - Fst_atim Ttimespec - Fst_mtim Ttimespec - Fst_ctim Ttimespec - Fst_ino t__ino64_t + Fst_dev Tdev_t + F__st_dev_padding int32 + F__st_ino_truncated int32 + Fst_mode Tmode_t + Fst_nlink Tnlink_t + Fst_uid Tuid_t + Fst_gid Tgid_t + Fst_rdev Tdev_t + F__st_rdev_padding int32 + Fst_size Toff_t + Fst_blksize Tblksize_t + Fst_blocks Tblkcnt_t + F__st_atim32 struct { + Ftv_sec int32 + Ftv_nsec int32 + } + F__st_mtim32 struct { + Ftv_sec int32 + Ftv_nsec int32 + } + F__st_ctim32 struct { + Ftv_sec int32 + Ftv_nsec int32 + } + Fst_ino Tino_t + Fst_atim Ttimespec + Fst_mtim Ttimespec + Fst_ctim Ttimespec } type stat = Tstat -type Tstat64 = struct { - Fst_dev t__dev_t - F__pad1 uint32 - F__st_ino t__ino_t - Fst_mode t__mode_t - Fst_nlink t__nlink_t - Fst_uid t__uid_t - Fst_gid t__gid_t - Fst_rdev t__dev_t - F__pad2 uint32 - Fst_size t__off64_t - Fst_blksize t__blksize_t - Fst_blocks t__blkcnt64_t - Fst_atim Ttimespec - Fst_mtim Ttimespec - Fst_ctim Ttimespec - Fst_ino t__ino64_t -} - -type stat64 = Tstat64 - type Tstatx_timestamp = struct { - Ftv_sec t__int64_t - Ftv_nsec t__uint32_t - F__statx_timestamp_pad1 [1]t__int32_t + Ftv_sec Tint64_t + Ftv_nsec Tuint32_t + F__pad Tuint32_t } type statx_timestamp = Tstatx_timestamp type Tstatx = struct { - Fstx_mask t__uint32_t - Fstx_blksize t__uint32_t - Fstx_attributes t__uint64_t - Fstx_nlink t__uint32_t - Fstx_uid t__uint32_t - Fstx_gid t__uint32_t - Fstx_mode t__uint16_t - F__statx_pad1 [1]t__uint16_t - Fstx_ino t__uint64_t - Fstx_size t__uint64_t - Fstx_blocks t__uint64_t - Fstx_attributes_mask t__uint64_t + Fstx_mask Tuint32_t + Fstx_blksize Tuint32_t + Fstx_attributes Tuint64_t + Fstx_nlink Tuint32_t + Fstx_uid Tuint32_t + Fstx_gid Tuint32_t + Fstx_mode Tuint16_t + F__pad0 [1]Tuint16_t + Fstx_ino Tuint64_t + Fstx_size Tuint64_t + Fstx_blocks Tuint64_t + Fstx_attributes_mask Tuint64_t Fstx_atime Tstatx_timestamp Fstx_btime Tstatx_timestamp Fstx_ctime Tstatx_timestamp Fstx_mtime Tstatx_timestamp - Fstx_rdev_major t__uint32_t - Fstx_rdev_minor t__uint32_t - Fstx_dev_major t__uint32_t - Fstx_dev_minor t__uint32_t - F__statx_pad2 [14]t__uint64_t + Fstx_rdev_major Tuint32_t + Fstx_rdev_minor Tuint32_t + Fstx_dev_major Tuint32_t + Fstx_dev_minor Tuint32_t + F__pad1 [14]Tuint64_t } type statx = Tstatx -type Tflock = struct { - Fl_type int16 - Fl_whence int16 - Fl_start t__off64_t - Fl_len t__off64_t - Fl_pid t__pid_t -} - -type flock = Tflock - -type Tflock64 = struct { - Fl_type int16 - Fl_whence int16 - Fl_start t__off64_t - Fl_len t__off64_t - Fl_pid t__pid_t -} - -type flock64 = Tflock64 - type Tiovec = struct { Fiov_base uintptr Fiov_len Tsize_t @@ -24314,19 +23406,15 @@ type Tiovec = struct { type iovec = Tiovec -type ___pid_type = int32 - -const _F_OWNER_TID = 0 -const _F_OWNER_PID = 1 -const _F_OWNER_PGRP = 2 -const _F_OWNER_GID = 2 - -type Tf_owner_ex = struct { - Ftype1 ___pid_type - Fpid t__pid_t +type Tflock = struct { + Fl_type int16 + Fl_whence int16 + Fl_start Toff_t + Fl_len Toff_t + Fl_pid Tpid_t } -type f_owner_ex = Tf_owner_ex +type flock = Tflock type Tfile_handle = struct { Fhandle_bytes uint32 @@ -24335,6 +23423,13 @@ type Tfile_handle = struct { type file_handle = Tfile_handle +type Tf_owner_ex = struct { + Ftype1 int32 + Fpid Tpid_t +} + +type f_owner_ex = Tf_owner_ex + type Twinsize = struct { Fws_row uint16 Fws_col uint16 @@ -24344,341 +23439,10 @@ type Twinsize = struct { type winsize = Twinsize -type Ttermio = struct { - Fc_iflag uint16 - Fc_oflag uint16 - Fc_cflag uint16 - Fc_lflag uint16 - Fc_line uint8 - Fc_cc [8]uint8 -} - -type termio = Ttermio - type Tintptr_t = int32 type intptr_t = Tintptr_t -type Tsocklen_t = uint32 - -type socklen_t = Tsocklen_t - -const __PC_LINK_MAX = 0 -const __PC_MAX_CANON = 1 -const __PC_MAX_INPUT = 2 -const __PC_NAME_MAX = 3 -const __PC_PATH_MAX = 4 -const __PC_PIPE_BUF = 5 -const __PC_CHOWN_RESTRICTED = 6 -const __PC_NO_TRUNC = 7 -const __PC_VDISABLE = 8 -const __PC_SYNC_IO = 9 -const __PC_ASYNC_IO = 10 -const __PC_PRIO_IO = 11 -const __PC_SOCK_MAXBUF = 12 -const __PC_FILESIZEBITS = 13 -const __PC_REC_INCR_XFER_SIZE = 14 -const __PC_REC_MAX_XFER_SIZE = 15 -const __PC_REC_MIN_XFER_SIZE = 16 -const __PC_REC_XFER_ALIGN = 17 -const __PC_ALLOC_SIZE_MIN = 18 -const __PC_SYMLINK_MAX = 19 -const __PC_2_SYMLINKS = 20 -const __SC_ARG_MAX = 0 -const __SC_CHILD_MAX = 1 -const __SC_CLK_TCK = 2 -const __SC_NGROUPS_MAX = 3 -const __SC_OPEN_MAX = 4 -const __SC_STREAM_MAX = 5 -const __SC_TZNAME_MAX = 6 -const __SC_JOB_CONTROL = 7 -const __SC_SAVED_IDS = 8 -const __SC_REALTIME_SIGNALS = 9 -const __SC_PRIORITY_SCHEDULING = 10 -const __SC_TIMERS = 11 -const __SC_ASYNCHRONOUS_IO = 12 -const __SC_PRIORITIZED_IO = 13 -const __SC_SYNCHRONIZED_IO = 14 -const __SC_FSYNC = 15 -const __SC_MAPPED_FILES = 16 -const __SC_MEMLOCK = 17 -const __SC_MEMLOCK_RANGE = 18 -const __SC_MEMORY_PROTECTION = 19 -const __SC_MESSAGE_PASSING = 20 -const __SC_SEMAPHORES = 21 -const __SC_SHARED_MEMORY_OBJECTS = 22 -const __SC_AIO_LISTIO_MAX = 23 -const __SC_AIO_MAX = 24 -const __SC_AIO_PRIO_DELTA_MAX = 25 -const __SC_DELAYTIMER_MAX = 26 -const __SC_MQ_OPEN_MAX = 27 -const __SC_MQ_PRIO_MAX = 28 -const __SC_VERSION = 29 -const __SC_PAGESIZE = 30 -const __SC_RTSIG_MAX = 31 -const __SC_SEM_NSEMS_MAX = 32 -const __SC_SEM_VALUE_MAX = 33 -const __SC_SIGQUEUE_MAX = 34 -const __SC_TIMER_MAX = 35 -const __SC_BC_BASE_MAX = 36 -const __SC_BC_DIM_MAX = 37 -const __SC_BC_SCALE_MAX = 38 -const __SC_BC_STRING_MAX = 39 -const __SC_COLL_WEIGHTS_MAX = 40 -const __SC_EQUIV_CLASS_MAX = 41 -const __SC_EXPR_NEST_MAX = 42 -const __SC_LINE_MAX = 43 -const __SC_RE_DUP_MAX = 44 -const __SC_CHARCLASS_NAME_MAX = 45 -const __SC_2_VERSION = 46 -const __SC_2_C_BIND = 47 -const __SC_2_C_DEV = 48 -const __SC_2_FORT_DEV = 49 -const __SC_2_FORT_RUN = 50 -const __SC_2_SW_DEV = 51 -const __SC_2_LOCALEDEF = 52 -const __SC_PII = 53 -const __SC_PII_XTI = 54 -const __SC_PII_SOCKET = 55 -const __SC_PII_INTERNET = 56 -const __SC_PII_OSI = 57 -const __SC_POLL = 58 -const __SC_SELECT = 59 -const __SC_UIO_MAXIOV = 60 -const __SC_IOV_MAX = 60 -const __SC_PII_INTERNET_STREAM = 61 -const __SC_PII_INTERNET_DGRAM = 62 -const __SC_PII_OSI_COTS = 63 -const __SC_PII_OSI_CLTS = 64 -const __SC_PII_OSI_M = 65 -const __SC_T_IOV_MAX = 66 -const __SC_THREADS = 67 -const __SC_THREAD_SAFE_FUNCTIONS = 68 -const __SC_GETGR_R_SIZE_MAX = 69 -const __SC_GETPW_R_SIZE_MAX = 70 -const __SC_LOGIN_NAME_MAX = 71 -const __SC_TTY_NAME_MAX = 72 -const __SC_THREAD_DESTRUCTOR_ITERATIONS = 73 -const __SC_THREAD_KEYS_MAX = 74 -const __SC_THREAD_STACK_MIN = 75 -const __SC_THREAD_THREADS_MAX = 76 -const __SC_THREAD_ATTR_STACKADDR = 77 -const __SC_THREAD_ATTR_STACKSIZE = 78 -const __SC_THREAD_PRIORITY_SCHEDULING = 79 -const __SC_THREAD_PRIO_INHERIT = 80 -const __SC_THREAD_PRIO_PROTECT = 81 -const __SC_THREAD_PROCESS_SHARED = 82 -const __SC_NPROCESSORS_CONF = 83 -const __SC_NPROCESSORS_ONLN = 84 -const __SC_PHYS_PAGES = 85 -const __SC_AVPHYS_PAGES = 86 -const __SC_ATEXIT_MAX = 87 -const __SC_PASS_MAX = 88 -const __SC_XOPEN_VERSION = 89 -const __SC_XOPEN_XCU_VERSION = 90 -const __SC_XOPEN_UNIX = 91 -const __SC_XOPEN_CRYPT = 92 -const __SC_XOPEN_ENH_I18N = 93 -const __SC_XOPEN_SHM = 94 -const __SC_2_CHAR_TERM = 95 -const __SC_2_C_VERSION = 96 -const __SC_2_UPE = 97 -const __SC_XOPEN_XPG2 = 98 -const __SC_XOPEN_XPG3 = 99 -const __SC_XOPEN_XPG4 = 100 -const __SC_CHAR_BIT = 101 -const __SC_CHAR_MAX = 102 -const __SC_CHAR_MIN = 103 -const __SC_INT_MAX = 104 -const __SC_INT_MIN = 105 -const __SC_LONG_BIT = 106 -const __SC_WORD_BIT = 107 -const __SC_MB_LEN_MAX = 108 -const __SC_NZERO = 109 -const __SC_SSIZE_MAX = 110 -const __SC_SCHAR_MAX = 111 -const __SC_SCHAR_MIN = 112 -const __SC_SHRT_MAX = 113 -const __SC_SHRT_MIN = 114 -const __SC_UCHAR_MAX = 115 -const __SC_UINT_MAX = 116 -const __SC_ULONG_MAX = 117 -const __SC_USHRT_MAX = 118 -const __SC_NL_ARGMAX = 119 -const __SC_NL_LANGMAX = 120 -const __SC_NL_MSGMAX = 121 -const __SC_NL_NMAX = 122 -const __SC_NL_SETMAX = 123 -const __SC_NL_TEXTMAX = 124 -const __SC_XBS5_ILP32_OFF32 = 125 -const __SC_XBS5_ILP32_OFFBIG = 126 -const __SC_XBS5_LP64_OFF64 = 127 -const __SC_XBS5_LPBIG_OFFBIG = 128 -const __SC_XOPEN_LEGACY = 129 -const __SC_XOPEN_REALTIME = 130 -const __SC_XOPEN_REALTIME_THREADS = 131 -const __SC_ADVISORY_INFO = 132 -const __SC_BARRIERS = 133 -const __SC_BASE = 134 -const __SC_C_LANG_SUPPORT = 135 -const __SC_C_LANG_SUPPORT_R = 136 -const __SC_CLOCK_SELECTION = 137 -const __SC_CPUTIME = 138 -const __SC_THREAD_CPUTIME = 139 -const __SC_DEVICE_IO = 140 -const __SC_DEVICE_SPECIFIC = 141 -const __SC_DEVICE_SPECIFIC_R = 142 -const __SC_FD_MGMT = 143 -const __SC_FIFO = 144 -const __SC_PIPE = 145 -const __SC_FILE_ATTRIBUTES = 146 -const __SC_FILE_LOCKING = 147 -const __SC_FILE_SYSTEM = 148 -const __SC_MONOTONIC_CLOCK = 149 -const __SC_MULTI_PROCESS = 150 -const __SC_SINGLE_PROCESS = 151 -const __SC_NETWORKING = 152 -const __SC_READER_WRITER_LOCKS = 153 -const __SC_SPIN_LOCKS = 154 -const __SC_REGEXP = 155 -const __SC_REGEX_VERSION = 156 -const __SC_SHELL = 157 -const __SC_SIGNALS = 158 -const __SC_SPAWN = 159 -const __SC_SPORADIC_SERVER = 160 -const __SC_THREAD_SPORADIC_SERVER = 161 -const __SC_SYSTEM_DATABASE = 162 -const __SC_SYSTEM_DATABASE_R = 163 -const __SC_TIMEOUTS = 164 -const __SC_TYPED_MEMORY_OBJECTS = 165 -const __SC_USER_GROUPS = 166 -const __SC_USER_GROUPS_R = 167 -const __SC_2_PBS = 168 -const __SC_2_PBS_ACCOUNTING = 169 -const __SC_2_PBS_LOCATE = 170 -const __SC_2_PBS_MESSAGE = 171 -const __SC_2_PBS_TRACK = 172 -const __SC_SYMLOOP_MAX = 173 -const __SC_STREAMS = 174 -const __SC_2_PBS_CHECKPOINT = 175 -const __SC_V6_ILP32_OFF32 = 176 -const __SC_V6_ILP32_OFFBIG = 177 -const __SC_V6_LP64_OFF64 = 178 -const __SC_V6_LPBIG_OFFBIG = 179 -const __SC_HOST_NAME_MAX = 180 -const __SC_TRACE = 181 -const __SC_TRACE_EVENT_FILTER = 182 -const __SC_TRACE_INHERIT = 183 -const __SC_TRACE_LOG = 184 -const __SC_LEVEL1_ICACHE_SIZE = 185 -const __SC_LEVEL1_ICACHE_ASSOC = 186 -const __SC_LEVEL1_ICACHE_LINESIZE = 187 -const __SC_LEVEL1_DCACHE_SIZE = 188 -const __SC_LEVEL1_DCACHE_ASSOC = 189 -const __SC_LEVEL1_DCACHE_LINESIZE = 190 -const __SC_LEVEL2_CACHE_SIZE = 191 -const __SC_LEVEL2_CACHE_ASSOC = 192 -const __SC_LEVEL2_CACHE_LINESIZE = 193 -const __SC_LEVEL3_CACHE_SIZE = 194 -const __SC_LEVEL3_CACHE_ASSOC = 195 -const __SC_LEVEL3_CACHE_LINESIZE = 196 -const __SC_LEVEL4_CACHE_SIZE = 197 -const __SC_LEVEL4_CACHE_ASSOC = 198 -const __SC_LEVEL4_CACHE_LINESIZE = 199 -const __SC_IPV6 = 235 -const __SC_RAW_SOCKETS = 236 -const __SC_V7_ILP32_OFF32 = 237 -const __SC_V7_ILP32_OFFBIG = 238 -const __SC_V7_LP64_OFF64 = 239 -const __SC_V7_LPBIG_OFFBIG = 240 -const __SC_SS_REPL_MAX = 241 -const __SC_TRACE_EVENT_NAME_MAX = 242 -const __SC_TRACE_NAME_MAX = 243 -const __SC_TRACE_SYS_MAX = 244 -const __SC_TRACE_USER_EVENT_MAX = 245 -const __SC_XOPEN_STREAMS = 246 -const __SC_THREAD_ROBUST_PRIO_INHERIT = 247 -const __SC_THREAD_ROBUST_PRIO_PROTECT = 248 -const __SC_MINSIGSTKSZ = 249 -const __SC_SIGSTKSZ = 250 -const __CS_PATH = 0 -const __CS_V6_WIDTH_RESTRICTED_ENVS = 1 -const __CS_GNU_LIBC_VERSION = 2 -const __CS_GNU_LIBPTHREAD_VERSION = 3 -const __CS_V5_WIDTH_RESTRICTED_ENVS = 4 -const __CS_V7_WIDTH_RESTRICTED_ENVS = 5 -const __CS_LFS_CFLAGS = 1000 -const __CS_LFS_LDFLAGS = 1001 -const __CS_LFS_LIBS = 1002 -const __CS_LFS_LINTFLAGS = 1003 -const __CS_LFS64_CFLAGS = 1004 -const __CS_LFS64_LDFLAGS = 1005 -const __CS_LFS64_LIBS = 1006 -const __CS_LFS64_LINTFLAGS = 1007 -const __CS_XBS5_ILP32_OFF32_CFLAGS = 1100 -const __CS_XBS5_ILP32_OFF32_LDFLAGS = 1101 -const __CS_XBS5_ILP32_OFF32_LIBS = 1102 -const __CS_XBS5_ILP32_OFF32_LINTFLAGS = 1103 -const __CS_XBS5_ILP32_OFFBIG_CFLAGS = 1104 -const __CS_XBS5_ILP32_OFFBIG_LDFLAGS = 1105 -const __CS_XBS5_ILP32_OFFBIG_LIBS = 1106 -const __CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107 -const __CS_XBS5_LP64_OFF64_CFLAGS = 1108 -const __CS_XBS5_LP64_OFF64_LDFLAGS = 1109 -const __CS_XBS5_LP64_OFF64_LIBS = 1110 -const __CS_XBS5_LP64_OFF64_LINTFLAGS = 1111 -const __CS_XBS5_LPBIG_OFFBIG_CFLAGS = 1112 -const __CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 1113 -const __CS_XBS5_LPBIG_OFFBIG_LIBS = 1114 -const __CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115 -const __CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116 -const __CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117 -const __CS_POSIX_V6_ILP32_OFF32_LIBS = 1118 -const __CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119 -const __CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120 -const __CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121 -const __CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122 -const __CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123 -const __CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124 -const __CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125 -const __CS_POSIX_V6_LP64_OFF64_LIBS = 1126 -const __CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127 -const __CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128 -const __CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129 -const __CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130 -const __CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131 -const __CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132 -const __CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133 -const __CS_POSIX_V7_ILP32_OFF32_LIBS = 1134 -const __CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135 -const __CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136 -const __CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137 -const __CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138 -const __CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139 -const __CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140 -const __CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141 -const __CS_POSIX_V7_LP64_OFF64_LIBS = 1142 -const __CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143 -const __CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144 -const __CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145 -const __CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146 -const __CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147 -const __CS_V6_ENV = 1148 -const __CS_V7_ENV = 1149 - -type Ttimezone = struct { - Ftz_minuteswest int32 - Ftz_dsttime int32 -} - -type timezone = Ttimezone - -type ___itimer_which = int32 - -const _ITIMER_REAL = 0 -const _ITIMER_VIRTUAL = 1 -const _ITIMER_PROF = 2 - type Titimerval = struct { Fit_interval Ttimeval Fit_value Ttimeval @@ -24686,11 +23450,12 @@ type Titimerval = struct { type itimerval = Titimerval -type t__itimer_which_t = int32 - -type Terror_t = int32 +type Ttimezone = struct { + Ftz_minuteswest int32 + Ftz_dsttime int32 +} -type error_t = Terror_t +type timezone = Ttimezone /* ** Try to determine if gethostuuid() is available based on standard @@ -25193,7 +23958,7 @@ func _unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) (r uintptr) { if zName != 0 { i = 0 for { - if !(i < int32(libc.Uint32FromInt64(348)/libc.Uint32FromInt64(12))-libc.Int32FromInt32(1)) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(348)/libc.Uint32FromInt64(12))-libc.Int32FromInt32(1)) { break } if libc.Xstrcmp(tls, zName, _aSyscall[i].FzName) == 0 { @@ -25207,7 +23972,7 @@ func _unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) (r uintptr) { } i++ for { - if !(i < int32(libc.Uint32FromInt64(348)/libc.Uint32FromInt64(12))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(348)/libc.Uint32FromInt64(12))) { break } if _aSyscall[i].FpCurrent != uintptr(0) { @@ -25247,8 +24012,8 @@ func _unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) (r uintptr) { // ** recover the hot journals. // */ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { - bp := tls.Alloc(128) - defer tls.Free(128) + bp := tls.Alloc(176) + defer tls.Free(176) var fd int32 var m2 Tmode_t var v1 uint32 @@ -25261,7 +24026,7 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { } m2 = v1 for int32(1) != 0 { - fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, z, f|int32(__O_CLOEXEC), int32(m2)) + fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, z, f|int32(O_CLOEXEC), libc.Int32FromUint32(m2)) if fd < 0 { if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(EINTR) { continue @@ -25275,9 +24040,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3667, libc.VaList(bp+104, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3667, libc.VaList(bp+152, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3710, O_RDONLY, int32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3710, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -25321,12 +24086,11 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { var _unixBigLock = uintptr(0) func _unixEnterMutex(tls *libc.TLS) { - _ = libc.Int32FromInt32(0) /* Not a recursive mutex */ + /* Not a recursive mutex */ Xsqlite3_mutex_enter(tls, _unixBigLock) } func _unixLeaveMutex(tls *libc.TLS) { - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, _unixBigLock) } @@ -25361,7 +24125,6 @@ func _robust_ftruncate(tls *libc.TLS, h int32, sz Tsqlite3_int64) (r int32) { // ** should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately. // */ func _sqliteErrorFromPosixError(tls *libc.TLS, posixError int32, sqliteIOErr int32) (r int32) { - _ = libc.Int32FromInt32(0) switch posixError { case int32(EACCES): fallthrough @@ -25650,7 +24413,6 @@ func _closePendingFds(tls *libc.TLS, pFile uintptr) { var p, pInode, pNext uintptr _, _, _ = p, pInode, pNext pInode = (*TunixFile)(unsafe.Pointer(pFile)).FpInode - _ = libc.Int32FromInt32(0) p = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpUnused for { if !(p != 0) { @@ -25679,24 +24441,18 @@ func _releaseInodeInfo(tls *libc.TLS, pFile uintptr) { var pInode uintptr _ = pInode pInode = (*TunixFile)(unsafe.Pointer(pFile)).FpInode - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pInode != 0 { (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnRef-- if (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnRef == 0 { - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) _closePendingFds(tls, pFile) Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) if (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpPrev != 0 { - _ = libc.Int32FromInt32(0) (*TunixInodeInfo)(unsafe.Pointer((*TunixInodeInfo)(unsafe.Pointer(pInode)).FpPrev)).FpNext = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpNext } else { - _ = libc.Int32FromInt32(0) _inodeList = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpNext } if (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpNext != 0 { - _ = libc.Int32FromInt32(0) (*TunixInodeInfo)(unsafe.Pointer((*TunixInodeInfo)(unsafe.Pointer(pInode)).FpNext)).FpPrev = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpPrev } Xsqlite3_mutex_free(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -25717,15 +24473,14 @@ func _releaseInodeInfo(tls *libc.TLS, pFile uintptr) { // ** Return an appropriate error code. // */ func _findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) (r int32) { - bp := tls.Alloc(112) - defer tls.Free(112) + bp := tls.Alloc(160) + defer tls.Free(160) var fd, rc int32 var pInode uintptr var _ /* fileId at bp+0 */ TunixFileId var _ /* statbuf at bp+16 */ Tstat _, _, _ = fd, pInode, rc /* Low-level file information */ pInode = uintptr(0) /* Candidate unixInodeInfo object */ - _ = libc.Int32FromInt32(0) /* Get low-level information about the file that we can used to ** create a unique name for the file. */ @@ -25738,7 +24493,6 @@ func _findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) (r int32) { libc.Xmemset(tls, bp, 0, uint32(16)) (*(*TunixFileId)(unsafe.Pointer(bp))).Fdev = (*(*Tstat)(unsafe.Pointer(bp + 16))).Fst_dev (*(*TunixFileId)(unsafe.Pointer(bp))).Fino = (*(*Tstat)(unsafe.Pointer(bp + 16))).Fst_ino - _ = libc.Int32FromInt32(0) pInode = _inodeList for pInode != 0 && libc.Xmemcmp(tls, bp, pInode, uint32(16)) != 0 { pInode = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpNext @@ -25758,7 +24512,6 @@ func _findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) (r int32) { } } (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnRef = int32(1) - _ = libc.Int32FromInt32(0) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpNext = _inodeList (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpPrev = uintptr(0) if _inodeList != 0 { @@ -25778,8 +24531,8 @@ func _findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) (r int32) { // ** Return TRUE if pFile has been renamed or unlinked since it was first opened. // */ func _fileHasMoved(tls *libc.TLS, pFile uintptr) (r int32) { - bp := tls.Alloc(96) - defer tls.Free(96) + bp := tls.Alloc(144) + defer tls.Free(144) var _ /* buf at bp+0 */ Tstat return libc.BoolInt32((*TunixFile)(unsafe.Pointer(pFile)).FpInode != uintptr(0) && ((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(4)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, bp) != 0 || (*(*Tstat)(unsafe.Pointer(bp))).Fst_ino != (*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpInode)).FfileId.Fino)) } @@ -25796,30 +24549,30 @@ func _fileHasMoved(tls *libc.TLS, pFile uintptr) (r int32) { // ** Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right. // */ func _verifyDbFile(tls *libc.TLS, pFile uintptr) { - bp := tls.Alloc(112) - defer tls.Free(112) + bp := tls.Alloc(160) + defer tls.Free(160) var rc int32 var _ /* buf at bp+0 */ Tstat _ = rc /* These verifications occurs for the main database only */ - if int32((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&int32(UNIXFILE_NOLOCK) != 0 { + if libc.Int32FromUint16((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&int32(UNIXFILE_NOLOCK) != 0 { return } rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(5)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, bp) if rc != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3751, libc.VaList(bp+104, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3751, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if (*(*Tstat)(unsafe.Pointer(bp))).Fst_nlink == uint32(0) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3775, libc.VaList(bp+104, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3775, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if (*(*Tstat)(unsafe.Pointer(bp))).Fst_nlink > uint32(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3804, libc.VaList(bp+104, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3804, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3831, libc.VaList(bp+104, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3831, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25842,21 +24595,19 @@ func _unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32 rc = SQLITE_OK reserved = 0 pFile = id - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpInode)).FpLockMutex) /* Check if a thread in this process holds such a lock */ - if int32((*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock) > int32(SHARED_LOCK) { + if libc.Int32FromUint8((*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock) > int32(SHARED_LOCK) { reserved = int32(1) } /* Otherwise see if some other process holds it. */ if !(reserved != 0) && !((*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpInode)).FbProcessLock != 0) { - (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = SEEK_SET + (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(_sqlite3PendingByte + libc.Int32FromInt32(1)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(1) (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(F_WRLCK) - if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(F_GETLK64), libc.VaList(bp+32, bp)) != 0 { + if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(F_GETLK), libc.VaList(bp+32, bp)) != 0 { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(14)<<libc.Int32FromInt32(8) _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) } else { @@ -25913,16 +24664,13 @@ func _unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) (r int32) { var _ /* lock at bp+0 */ Tflock _, _ = pInode, rc pInode = (*TunixFile)(unsafe.Pointer(pFile)).FpInode - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&(libc.Int32FromInt32(UNIXFILE_EXCL)|libc.Int32FromInt32(UNIXFILE_RDONLY)) == int32(UNIXFILE_EXCL) { - if int32((*TunixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { - _ = libc.Int32FromInt32(0) - (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = SEEK_SET + if libc.Int32FromUint16((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&(libc.Int32FromInt32(UNIXFILE_EXCL)|libc.Int32FromInt32(UNIXFILE_RDONLY)) == int32(UNIXFILE_EXCL) { + if libc.Int32FromUint8((*TunixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { + (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(_sqlite3PendingByte + libc.Int32FromInt32(2)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(SHARED_SIZE) (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(F_WRLCK) - rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(F_SETLK64), libc.VaList(bp+32, bp)) + rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(F_SETLK), libc.VaList(bp+32, bp)) if rc < 0 { return rc } @@ -25932,7 +24680,7 @@ func _unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) (r int32) { rc = 0 } } else { - rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(F_SETLK64), libc.VaList(bp+32, pLock)) + rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(F_SETLK), libc.VaList(bp+32, pLock)) } return rc } @@ -26013,12 +24761,11 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { rc = SQLITE_OK pFile = id tErrno = 0 - _ = libc.Int32FromInt32(0) /* If there is already a lock of this type or more restrictive on the ** unixFile, do nothing. Don't use the end_lock: exit path, as ** unixEnterMutex() hasn't been called yet. */ - if int32((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) >= eFileLock { + if libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) >= eFileLock { return SQLITE_OK } /* Make sure the locking sequence is correct. @@ -26026,9 +24773,6 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { ** (2) SQLite never explicitly requests a pending lock. ** (3) A shared lock is always held when a reserve lock is requested. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* This mutex is needed because pFile->pInode is shared across threads */ pInode = (*TunixFile)(unsafe.Pointer(pFile)).FpInode @@ -26036,7 +24780,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { /* If some thread using this PID has a lock via a different unixFile* ** handle that precludes the requested lock, return BUSY. */ - if int32((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) != int32((*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) && (int32((*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) >= int32(PENDING_LOCK) || eFileLock > int32(SHARED_LOCK)) { + if libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) != libc.Int32FromUint8((*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) && (libc.Int32FromUint8((*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) >= int32(PENDING_LOCK) || eFileLock > int32(SHARED_LOCK)) { rc = int32(SQLITE_BUSY) goto end_lock } @@ -26044,10 +24788,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { ** has a SHARED or RESERVED lock, then increment reference counts and ** return SQLITE_OK. */ - if eFileLock == int32(SHARED_LOCK) && (int32((*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) == int32(SHARED_LOCK) || int32((*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) == int32(RESERVED_LOCK)) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if eFileLock == int32(SHARED_LOCK) && (libc.Int32FromUint8((*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) == int32(SHARED_LOCK) || libc.Int32FromUint8((*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) == int32(RESERVED_LOCK)) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnShared++ (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ @@ -26058,8 +24799,8 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { ** be released. */ (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(1) - (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = SEEK_SET - if eFileLock == int32(SHARED_LOCK) || eFileLock == int32(EXCLUSIVE_LOCK) && int32((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) == int32(RESERVED_LOCK) { + (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 + if eFileLock == int32(SHARED_LOCK) || eFileLock == int32(EXCLUSIVE_LOCK) && libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) == int32(RESERVED_LOCK) { if eFileLock == int32(SHARED_LOCK) { v1 = F_RDLCK } else { @@ -26085,9 +24826,6 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { ** operating system calls for the specified lock. */ if eFileLock == int32(SHARED_LOCK) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Now get the read-lock */ (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(_sqlite3PendingByte + libc.Int32FromInt32(2)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(SHARED_SIZE) @@ -26124,9 +24862,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { ** assumed that there is a SHARED or greater lock on the file ** already. */ - _ = libc.Int32FromInt32(0) (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(F_WRLCK) - _ = libc.Int32FromInt32(0) if eFileLock == int32(RESERVED_LOCK) { (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(_sqlite3PendingByte + libc.Int32FromInt32(1)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(1) @@ -26144,8 +24880,8 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { } } if rc == SQLITE_OK { - (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) - (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) + (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = libc.Uint8FromInt32(eFileLock) + (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = libc.Uint8FromInt32(eFileLock) } goto end_lock end_lock: @@ -26165,7 +24901,6 @@ func _setPendingFd(tls *libc.TLS, pFile uintptr) { _, _ = p, pInode pInode = (*TunixFile)(unsafe.Pointer(pFile)).FpInode p = (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused - _ = libc.Int32FromInt32(0) (*TUnixUnusedFd)(unsafe.Pointer(p)).FpNext = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpUnused (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpUnused = p (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) @@ -26192,21 +24927,17 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in defer tls.Free(32) var pFile, pInode uintptr var rc int32 - var v1 t__off64_t + var v1 Toff_t var _ /* lock at bp+0 */ Tflock _, _, _, _ = pFile, pInode, rc, v1 pFile = id rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) <= eFileLock { + if libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) <= eFileLock { return SQLITE_OK } pInode = (*TunixFile)(unsafe.Pointer(pFile)).FpInode Xsqlite3_mutex_enter(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) - _ = libc.Int32FromInt32(0) - if int32((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) > int32(SHARED_LOCK) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) > int32(SHARED_LOCK) { /* downgrading to a shared lock on NFS involves clearing the write lock ** before establishing the readlock - to avoid a race condition we downgrade ** the lock in 2 blocks, so that part of the range will be covered by a @@ -26218,9 +24949,8 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in */ if eFileLock == int32(SHARED_LOCK) { _ = handleNFSUnlock - _ = libc.Int32FromInt32(0) (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = F_RDLCK - (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = SEEK_SET + (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(_sqlite3PendingByte + libc.Int32FromInt32(2)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(SHARED_SIZE) if _unixFileLock(tls, pFile, bp) != 0 { @@ -26236,10 +24966,9 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in } } (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(F_UNLCK) - (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = SEEK_SET + (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(_sqlite3PendingByte) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(2) - _ = libc.Int32FromInt32(0) if _unixFileLock(tls, pFile, bp) == 0 { (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(SHARED_LOCK) } else { @@ -26256,7 +24985,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnShared-- if (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnShared == 0 { (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(F_UNLCK) - (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = SEEK_SET + (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 v1 = libc.Int64FromInt32(0) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = v1 (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = v1 @@ -26274,7 +25003,6 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in ** was deferred because of outstanding locks. */ (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnLock-- - _ = libc.Int32FromInt32(0) if (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnLock == 0 { _closePendingFds(tls, pFile) } @@ -26284,7 +25012,7 @@ end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) if rc == SQLITE_OK { - (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) + (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = libc.Uint8FromInt32(eFileLock) } return rc } @@ -26299,7 +25027,6 @@ end_unlock: // ** the requested locking level, this routine is a no-op. // */ func _unixUnlock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { - _ = libc.Int32FromInt32(0) return _posixUnlock(tls, id, eFileLock, 0) } @@ -26341,15 +25068,12 @@ func _unixClose(tls *libc.TLS, id uintptr) (r int32) { rc = SQLITE_OK pFile = id pInode = (*TunixFile)(unsafe.Pointer(pFile)).FpInode - _ = libc.Int32FromInt32(0) _verifyDbFile(tls, pFile) _unixUnlock(tls, id, NO_LOCK) - _ = libc.Int32FromInt32(0) _unixEnterMutex(tls) /* unixFile.pInode is always valid here. Otherwise, a different close ** routine (e.g. nolockClose()) would be called instead. */ - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) if (*TunixInodeInfo)(unsafe.Pointer(pInode)).FnLock != 0 { /* If there are outstanding locks, do not actually close the file just @@ -26361,7 +25085,6 @@ func _unixClose(tls *libc.TLS, id uintptr) (r int32) { } Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) _releaseInodeInfo(tls, pFile) - _ = libc.Int32FromInt32(0) rc = _closeUnixFile(tls, id) _unixLeaveMutex(tls) return rc @@ -26463,7 +25186,6 @@ func _dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r in rc = SQLITE_OK reserved = 0 pFile = id - _ = libc.Int32FromInt32(0) reserved = libc.BoolInt32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext, 0) == 0) *(*int32)(unsafe.Pointer(pResOut)) = reserved return rc @@ -26508,8 +25230,8 @@ func _dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { /* If we have any lock, then the lock file already exists. All we have ** to do is adjust our internal record of the lock level. */ - if int32((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) > NO_LOCK { - (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) + if libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) > NO_LOCK { + (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = libc.Uint8FromInt32(eFileLock) /* Always update the timestamp on the old file */ libc.Xutimes(tls, zLockFile, libc.UintptrFromInt32(0)) return SQLITE_OK @@ -26530,7 +25252,7 @@ func _dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { return rc } /* got it, set the type and return ok */ - (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) + (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = libc.Uint8FromInt32(eFileLock) return rc } @@ -26551,10 +25273,8 @@ func _dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { _, _, _, _ = pFile, rc, tErrno, zLockFile pFile = id zLockFile = (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* no-op if possible */ - if int32((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) == eFileLock { + if libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) == eFileLock { return SQLITE_OK } /* To downgrade to shared, simply update our internal notion of the @@ -26565,7 +25285,6 @@ func _dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { return SQLITE_OK } /* To fully unlock the database, delete the lock file */ - _ = libc.Int32FromInt32(0) rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(19)].FpCurrent})))(tls, zLockFile) if rc < 0 { tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) @@ -26590,7 +25309,6 @@ func _dotlockClose(tls *libc.TLS, id uintptr) (r int32) { var pFile uintptr _ = pFile pFile = id - _ = libc.Int32FromInt32(0) _dotlockUnlock(tls, id, NO_LOCK) Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext) return _closeUnixFile(tls, id) @@ -26686,10 +25404,8 @@ func _seekAndRead(tls *libc.TLS, id uintptr, offset Tsqlite3_int64, pBuf uintptr var got, prior int32 _, _ = got, prior prior = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for cond := true; cond; cond = got > 0 { - got = (*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(9)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(id)).Fh, pBuf, uint32(cnt), offset) + got = (*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(9)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(id)).Fh, pBuf, libc.Uint32FromInt32(cnt), offset) if got == cnt { break } @@ -26725,20 +25441,17 @@ func _unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Tsqlit var pFile uintptr _, _, _ = got, nCopy, pFile pFile = id - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If this is a database file (not a journal, super-journal or temp ** file), the bytes in the locking range should never be read or written. */ /* Deal with as much of this read request as possible by transferring ** data from the memory mapping using memcpy(). */ if offset < (*TunixFile)(unsafe.Pointer(pFile)).FmmapSize { if offset+int64(amt) <= (*TunixFile)(unsafe.Pointer(pFile)).FmmapSize { - libc.Xmemcpy(tls, pBuf, (*TunixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint32(amt)) + libc.Xmemcpy(tls, pBuf, (*TunixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), libc.Uint32FromInt32(amt)) return SQLITE_OK } else { nCopy = int32((*TunixFile)(unsafe.Pointer(pFile)).FmmapSize - offset) - libc.Xmemcpy(tls, pBuf, (*TunixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint32(nCopy)) + libc.Xmemcpy(tls, pBuf, (*TunixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), libc.Uint32FromInt32(nCopy)) pBuf = pBuf + uintptr(nCopy) amt -= nCopy offset += int64(nCopy) @@ -26768,7 +25481,7 @@ func _unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Tsqlit } else { _storeLastErrno(tls, pFile, 0) /* not a system error */ /* Unread parts of the buffer must be zero-filled */ - libc.Xmemset(tls, pBuf+uintptr(got), 0, uint32(amt-got)) + libc.Xmemset(tls, pBuf+uintptr(got), 0, libc.Uint32FromInt32(amt-got)) return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) } } @@ -26788,12 +25501,9 @@ func _seekAndWriteFd(tls *libc.TLS, fd int32, iOff Ti64, pBuf uintptr, nBuf int3 var rc int32 _ = rc rc = 0 /* Value returned by system call */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) nBuf &= int32(0x1ffff) for cond := true; cond; cond = rc < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(EINTR) { - rc = (*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(12)].FpCurrent})))(tls, fd, pBuf, uint32(nBuf), iOff) + rc = (*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(12)].FpCurrent})))(tls, fd, pBuf, libc.Uint32FromInt32(nBuf), iOff) } if rc < 0 { *(*int32)(unsafe.Pointer(piErrno)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) @@ -26826,8 +25536,6 @@ func _unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Tsqli _, _, _ = pFile, wrote, v1 pFile = id wrote = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If this is a database file (not a journal, super-journal or temp ** file), the bytes in the locking range should never be read or written. */ for { @@ -26949,7 +25657,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { _, _ = fd, ii fd = -int32(1) Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3859, libc.VaList(bp+528, zFilename)) - ii = int32(libc.Xstrlen(tls, bp)) + ii = libc.Int32FromUint32(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && int32((*(*[513]int8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { break @@ -27005,11 +25713,9 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { isDataOnly = flags & int32(SQLITE_SYNC_DATAONLY) isFullsync = libc.BoolInt32(flags&int32(0x0F) == int32(SQLITE_SYNC_FULL)) /* Check that one of SQLITE_SYNC_NORMAL or FULL was passed */ - _ = libc.Int32FromInt32(0) /* Unix cannot, but some systems may return SQLITE_FULL from here. This ** line is to test that doing so does not cause any problems. */ - _ = libc.Int32FromInt32(0) rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) @@ -27019,13 +25725,12 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { ** is set. This is a one-time occurrence. Many systems (examples: AIX) ** are unable to fsync a directory, so ignore errors on the fsync. */ - if int32((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&int32(UNIXFILE_DIRSYNC) != 0 { + if libc.Int32FromUint16((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&int32(UNIXFILE_DIRSYNC) != 0 { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(17)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, bp) if rc == SQLITE_OK { _full_fsync(tls, *(*int32)(unsafe.Pointer(bp)), 0, 0) _robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp)), int32(42166)) } else { - _ = libc.Int32FromInt32(0) rc = SQLITE_OK } p1 = pFile + 18 @@ -27044,7 +25749,6 @@ func _unixTruncate(tls *libc.TLS, id uintptr, nByte Ti64) (r int32) { var rc int32 _, _ = pFile, rc pFile = id - _ = libc.Int32FromInt32(0) /* If the user has configured a chunk-size for this file, truncate the ** file so that it consists of an integer number of chunks (i.e. the ** actual file size after the operation may be larger than the requested @@ -27076,12 +25780,11 @@ func _unixTruncate(tls *libc.TLS, id uintptr, nByte Ti64) (r int32) { // ** Determine the current size of a file in bytes // */ func _unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - bp := tls.Alloc(96) - defer tls.Free(96) + bp := tls.Alloc(144) + defer tls.Free(144) var rc int32 var _ /* buf at bp+0 */ Tstat _ = rc - _ = libc.Int32FromInt32(0) rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(5)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(id)).Fh, bp) if rc != 0 { _storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) @@ -27109,8 +25812,8 @@ func _unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { // ** nBytes or larger, this routine is a no-op. // */ func _fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte Ti64) (r int32) { - bp := tls.Alloc(96) - defer tls.Free(96) + bp := tls.Alloc(144) + defer tls.Free(144) var iWrite, nSize Ti64 var nBlk, nWrite, rc int32 var _ /* buf at bp+0 */ Tstat @@ -27131,8 +25834,6 @@ func _fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte Ti64) (r int32) { nBlk = (*(*Tstat)(unsafe.Pointer(bp))).Fst_blksize /* File-system block size */ nWrite = 0 /* Next offset to write to */ iWrite = (*(*Tstat)(unsafe.Pointer(bp))).Fst_size/int64(nBlk)*int64(nBlk) + int64(nBlk) - int64(1) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for { if !(iWrite < nSize+int64(nBlk)-int64(1)) { break @@ -27176,14 +25877,14 @@ func _unixModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { var p1, p2 uintptr _, _ = p1, p2 if *(*int32)(unsafe.Pointer(pArg)) < 0 { - *(*int32)(unsafe.Pointer(pArg)) = libc.BoolInt32(int32((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&int32(mask) != 0) + *(*int32)(unsafe.Pointer(pArg)) = libc.BoolInt32(libc.Int32FromUint16((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&libc.Int32FromUint8(mask) != 0) } else { if *(*int32)(unsafe.Pointer(pArg)) == 0 { p1 = pFile + 18 - *(*uint16)(unsafe.Pointer(p1)) = uint16(int32(*(*uint16)(unsafe.Pointer(p1))) & ^int32(mask)) + *(*uint16)(unsafe.Pointer(p1)) = uint16(int32(*(*uint16)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(mask)) } else { p2 = pFile + 18 - *(*uint16)(unsafe.Pointer(p2)) = uint16(int32(*(*uint16)(unsafe.Pointer(p2))) | int32(mask)) + *(*uint16)(unsafe.Pointer(p2)) = uint16(int32(*(*uint16)(unsafe.Pointer(p2))) | libc.Int32FromUint8(mask)) } } } @@ -27203,7 +25904,7 @@ func _unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int3 pFile = id switch op { case int32(SQLITE_FCNTL_LOCKSTATE): - *(*int32)(unsafe.Pointer(pArg)) = int32((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) + *(*int32)(unsafe.Pointer(pArg)) = libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) return SQLITE_OK case int32(SQLITE_FCNTL_LAST_ERRNO): *(*int32)(unsafe.Pointer(pArg)) = (*TunixFile)(unsafe.Pointer(pFile)).FlastErrno @@ -27224,7 +25925,7 @@ func _unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int3 *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, (*Tsqlite3_vfs)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpVfs)).FzName)) return SQLITE_OK case int32(SQLITE_FCNTL_TEMPFILENAME): - zTFile = Xsqlite3_malloc64(tls, uint64((*Tsqlite3_vfs)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpVfs)).FmxPathname)) + zTFile = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpVfs)).FmxPathname)) if zTFile != 0 { _unixGetTempname(tls, (*Tsqlite3_vfs)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpVfs)).FmxPathname, zTFile) *(*uintptr)(unsafe.Pointer(pArg)) = zTFile @@ -27272,10 +25973,9 @@ func _unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int3 // ** other systems. // */ func _setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { - _ = libc.Int32FromInt32(0) if (*TunixFile)(unsafe.Pointer(pFd)).FsectorSize == 0 { /* Set the POWERSAFE_OVERWRITE flag if requested. */ - if int32((*TunixFile)(unsafe.Pointer(pFd)).FctrlFlags)&int32(UNIXFILE_PSOW) != 0 { + if libc.Int32FromUint16((*TunixFile)(unsafe.Pointer(pFd)).FctrlFlags)&int32(UNIXFILE_PSOW) != 0 { *(*int32)(unsafe.Pointer(pFd + 80)) |= int32(SQLITE_IOCAP_POWERSAFE_OVERWRITE) } (*TunixFile)(unsafe.Pointer(pFd)).FsectorSize = int32(SQLITE_DEFAULT_SECTOR_SIZE) @@ -27334,7 +26034,7 @@ func _unixDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { // ** Instead, it should be called via macro osGetpagesize(). // */ func _unixGetpagesize(tls *libc.TLS) (r int32) { - return libc.Xsysconf(tls, int32(__SC_PAGESIZE)) + return libc.Xsysconf(tls, int32(_SC_PAGESIZE)) } /* @@ -27453,11 +26153,11 @@ func _unixFcntlExternalReader(tls *libc.TLS, pFile uintptr, piOut uintptr) (r in pShmNode = (*TunixShm)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpShm)).FpShmNode libc.Xmemset(tls, bp, 0, uint32(24)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(F_WRLCK) - (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = SEEK_SET + (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64((libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4) + libc.Int32FromInt32(3)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(libc.Int32FromInt32(SQLITE_SHM_NLOCK) - libc.Int32FromInt32(3)) Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) - if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int32(F_GETLK64), libc.VaList(bp+32, bp)) < 0 { + if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int32(F_GETLK), libc.VaList(bp+32, bp)) < 0 { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(15)<<libc.Int32FromInt32(8) } else { *(*int32)(unsafe.Pointer(piOut)) = libc.BoolInt32(int32((*(*Tflock)(unsafe.Pointer(bp))).Fl_type) != int32(F_UNLCK)) @@ -27486,27 +26186,18 @@ func _unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32 pShmNode = (*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpInode)).FpShmNode /* Assert that the parameters are within expected range and that the ** correct mutex or mutexes are held. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if ofst == (libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } /* Shared locks never span more than one byte */ - _ = libc.Int32FromInt32(0) /* Locks are within range */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0 { /* Initialize the locking parameters */ (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(lockType) - (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = SEEK_SET + (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(ofst) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(n) - res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int32(F_SETLK64), libc.VaList(bp+32, bp)) + res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int32(F_SETLK), libc.VaList(bp+32, bp)) if res == -int32(1) { rc = int32(SQLITE_BUSY) } @@ -27531,7 +26222,7 @@ func _unixShmRegionPerMap(tls *libc.TLS) (r int32) { _, _ = pgsz, shmsz shmsz = libc.Int32FromInt32(32) * libc.Int32FromInt32(1024) /* SHM region size */ pgsz = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(25)].FpCurrent})))(tls) /* System page size */ - _ = libc.Int32FromInt32(0) /* Page size must be a power of 2 */ + /* Page size must be a power of 2 */ if pgsz < shmsz { return int32(1) } @@ -27551,18 +26242,16 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { var p uintptr _, _, _ = i, nShmPerMap, p p = (*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFd)).FpInode)).FpShmNode - _ = libc.Int32FromInt32(0) if p != 0 && (*TunixShmNode)(unsafe.Pointer(p)).FnRef == 0 { nShmPerMap = _unixShmRegionPerMap(tls) - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FpShmMutex) i = 0 for { - if !(i < int32((*TunixShmNode)(unsafe.Pointer(p)).FnRegion)) { + if !(i < libc.Int32FromUint16((*TunixShmNode)(unsafe.Pointer(p)).FnRegion)) { break } if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, *(*uintptr)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FapRegion + uintptr(i)*4)), uint32((*TunixShmNode)(unsafe.Pointer(p)).FszRegion)) + (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, *(*uintptr)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FapRegion + uintptr(i)*4)), libc.Uint32FromInt32((*TunixShmNode)(unsafe.Pointer(p)).FszRegion)) } else { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FapRegion + uintptr(i)*4))) } @@ -27617,11 +26306,11 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** process might open and use the *-shm file without truncating it. ** And if the *-shm file has been corrupted by a power failure or ** system crash, the database itself may also become corrupt. */ - (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = SEEK_SET + (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64((libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4) + libc.Int32FromInt32(SQLITE_SHM_NLOCK)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(1) (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(F_WRLCK) - if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int32(F_GETLK64), libc.VaList(bp+32, bp)) != 0 { + if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int32(F_GETLK), libc.VaList(bp+32, bp)) != 0 { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(15)<<libc.Int32FromInt32(8) } else { if int32((*(*Tflock)(unsafe.Pointer(bp))).Fl_type) == int32(F_UNLCK) { @@ -27646,7 +26335,6 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in } } if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) rc = _unixShmSystemLock(tls, pDbFd, F_RDLCK, (libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK), int32(1)) } return rc @@ -27690,8 +26378,8 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in // ** file is created. The shared memory will be simulated with heap memory. // */ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { - bp := tls.Alloc(112) - defer tls.Free(112) + bp := tls.Alloc(160) + defer tls.Free(160) var nShmFilename, rc int32 var p, pInode, pShmNode, zBasePath, zShm, v1 uintptr var _ /* sStat at bp+0 */ Tstat @@ -27704,11 +26392,9 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { return int32(SQLITE_NOMEM) } libc.Xmemset(tls, p, 0, uint32(16)) - _ = libc.Int32FromInt32(0) /* Check to see if a unixShmNode object already exists. Reuse an existing ** one if present. Create a new one if necessary. */ - _ = libc.Int32FromInt32(0) _unixEnterMutex(tls) pInode = (*TunixFile)(unsafe.Pointer(pDbFd)).FpInode pShmNode = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpShmNode @@ -27722,17 +26408,17 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(7)<<libc.Int32FromInt32(8) goto shm_open_err } - nShmFilename = int32(6) + int32(libc.Xstrlen(tls, zBasePath)) - pShmNode = Xsqlite3_malloc64(tls, uint64(uint32(68)+uint32(nShmFilename))) + nShmFilename = int32(6) + libc.Int32FromUint32(libc.Xstrlen(tls, zBasePath)) + pShmNode = Xsqlite3_malloc64(tls, uint64(uint32(68)+libc.Uint32FromInt32(nShmFilename))) if pShmNode == uintptr(0) { rc = int32(SQLITE_NOMEM) goto shm_open_err } - libc.Xmemset(tls, pShmNode, 0, uint32(68)+uint32(nShmFilename)) + libc.Xmemset(tls, pShmNode, 0, uint32(68)+libc.Uint32FromInt32(nShmFilename)) v1 = pShmNode + 1*68 (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FzFilename = v1 zShm = v1 - Xsqlite3_snprintf(tls, nShmFilename, zShm, __ccgo_ts+3873, libc.VaList(bp+104, zBasePath)) + Xsqlite3_snprintf(tls, nShmFilename, zShm, __ccgo_ts+3873, libc.VaList(bp+152, zBasePath)) (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm = -int32(1) (*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pDbFd)).FpInode)).FpShmNode = pShmNode (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpInode = (*TunixFile)(unsafe.Pointer(pDbFd)).FpInode @@ -27743,12 +26429,12 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { goto shm_open_err } } - if int32((*TunixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { + if libc.Int32FromUint8((*TunixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { if 0 == Xsqlite3_uri_boolean(tls, (*TunixFile)(unsafe.Pointer(pDbFd)).FzPath, __ccgo_ts+3880, 0) { - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm = _robust_open(tls, zShm, libc.Int32FromInt32(O_RDWR)|libc.Int32FromInt32(O_CREAT)|libc.Int32FromInt32(__O_NOFOLLOW), (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(0777)) + (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm = _robust_open(tls, zShm, libc.Int32FromInt32(O_RDWR)|libc.Int32FromInt32(O_CREAT)|libc.Int32FromInt32(O_NOFOLLOW), (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(0777)) } if (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm < 0 { - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm = _robust_open(tls, zShm, libc.Int32FromInt32(O_RDONLY)|libc.Int32FromInt32(__O_NOFOLLOW), (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(0777)) + (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm = _robust_open(tls, zShm, libc.Int32FromInt32(O_RDONLY)|libc.Int32FromInt32(O_NOFOLLOW), (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(0777)) if (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm < 0 { rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(43123)), __ccgo_ts+3457, zShm, int32(43123)) goto shm_open_err @@ -27815,12 +26501,12 @@ shm_open_err: // ** memory and SQLITE_OK returned. // */ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) (r int32) { - bp := tls.Alloc(112) - defer tls.Free(112) + bp := tls.Alloc(160) + defer tls.Free(160) var apNew, p, pDbFd, pMem, pShmNode, zFile, p4 uintptr var i, iPg, nByte, nMap, nReqRegion, nShmPerMap, rc, v2 int32 var _ /* sStat at bp+0 */ Tstat - var _ /* x at bp+96 */ int32 + var _ /* x at bp+144 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = apNew, i, iPg, nByte, nMap, nReqRegion, nShmPerMap, p, pDbFd, pMem, pShmNode, rc, zFile, v2, p4 pDbFd = fd rc = SQLITE_OK @@ -27842,13 +26528,9 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte } (*TunixShmNode)(unsafe.Pointer(pShmNode)).FisUnlocked = uint8(0) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Minimum number of regions required to be mapped. */ nReqRegion = (iRegion + nShmPerMap) / nShmPerMap * nShmPerMap - if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) < nReqRegion { /* New apRegion[] array */ + if libc.Int32FromUint16((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) < nReqRegion { /* New apRegion[] array */ nByte = nReqRegion * szRegion /* Used by fstat() */ (*TunixShmNode)(unsafe.Pointer(pShmNode)).FszRegion = szRegion if (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0 { @@ -27868,14 +26550,13 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte goto shmpage_out } else { /* Write to the last byte of each newly allocated or extended page */ - _ = libc.Int32FromInt32(0) iPg = int32((*(*Tstat)(unsafe.Pointer(bp))).Fst_size / int64(_pgsz)) for { if !(iPg < nByte/_pgsz) { break } - *(*int32)(unsafe.Pointer(bp + 96)) = 0 - if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1662, int32(1), bp+96) != int32(1) { + *(*int32)(unsafe.Pointer(bp + 144)) = 0 + if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1662, int32(1), bp+144) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<<libc.Int32FromInt32(8), __ccgo_ts+3528, zFile, int32(43267)) goto shmpage_out @@ -27889,13 +26570,13 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte } } /* Map the requested memory region into this processes address space. */ - apNew = Xsqlite3_realloc(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FapRegion, int32(uint32(nReqRegion)*uint32(4))) + apNew = Xsqlite3_realloc(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FapRegion, libc.Int32FromUint32(libc.Uint32FromInt32(nReqRegion)*uint32(4))) if !(apNew != 0) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) goto shmpage_out } (*TunixShmNode)(unsafe.Pointer(pShmNode)).FapRegion = apNew - for int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) < nReqRegion { + for libc.Int32FromUint16((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) < nReqRegion { nMap = szRegion * nShmPerMap if (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0 { if (*TunixShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 { @@ -27903,25 +26584,25 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte } else { v2 = libc.Int32FromInt32(PROT_READ) | libc.Int32FromInt32(PROT_WRITE) } - pMem = (*(*func(*libc.TLS, uintptr, Tsize_t, int32, int32, int32, Toff_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(22)].FpCurrent})))(tls, uintptr(0), uint32(nMap), v2, int32(MAP_SHARED), (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(szRegion)*int64((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion)) + pMem = (*(*func(*libc.TLS, uintptr, Tsize_t, int32, int32, int32, Toff_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(22)].FpCurrent})))(tls, uintptr(0), libc.Uint32FromInt32(nMap), v2, int32(MAP_SHARED), (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(szRegion)*libc.Int64FromUint16((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion)) if pMem == uintptr(-libc.Int32FromInt32(1)) { rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(21)<<libc.Int32FromInt32(8), __ccgo_ts+3615, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, int32(43294)) goto shmpage_out } } else { - pMem = Xsqlite3_malloc64(tls, uint64(nMap)) + pMem = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nMap)) if pMem == uintptr(0) { rc = int32(SQLITE_NOMEM) goto shmpage_out } - libc.Xmemset(tls, pMem, 0, uint32(nMap)) + libc.Xmemset(tls, pMem, 0, libc.Uint32FromInt32(nMap)) } i = 0 for { if !(i < nShmPerMap) { break } - *(*uintptr)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(pShmNode)).FapRegion + uintptr(int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion)+i)*4)) = pMem + uintptr(szRegion*i) + *(*uintptr)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(pShmNode)).FapRegion + uintptr(libc.Int32FromUint16((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion)+i)*4)) = pMem + uintptr(szRegion*i) goto _3 _3: ; @@ -27934,7 +26615,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte goto shmpage_out shmpage_out: ; - if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { + if libc.Int32FromUint16((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { *(*uintptr)(unsafe.Pointer(pp)) = *(*uintptr)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(pShmNode)).FapRegion + uintptr(iRegion)*4)) } else { *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) @@ -27973,7 +26654,7 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( _, _, _, _, _, _, _, _, _, _, _, _, _ = aLock, bUnlock, ii, mask, p, pDbFd, pShmNode, rc, p1, p2, p3, p4, p6 pDbFd = fd /* The underlying file iNode */ rc = SQLITE_OK /* Result code */ - mask = uint16(int32(1)<<(ofst+n) - int32(1)<<ofst) + mask = libc.Uint16FromInt32(int32(1)<<(ofst+n) - int32(1)<<ofst) p = (*TunixFile)(unsafe.Pointer(pDbFd)).FpShm if p == uintptr(0) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(20)<<libc.Int32FromInt32(8) @@ -27983,14 +26664,6 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(20)<<libc.Int32FromInt32(8) } aLock = pShmNode + 36 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Check that, if this to be a blocking lock, no locks that occur later ** in the following list than the lock being obtained are already held: ** @@ -28013,8 +26686,7 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( ** The SQLite core never requests an exclusive lock that it already holds. ** This is assert()ed below. */ - _ = libc.Int32FromInt32(0) - if flags&int32(SQLITE_SHM_UNLOCK) != 0 && (int32((*TunixShm)(unsafe.Pointer(p)).FexclMask)|int32((*TunixShm)(unsafe.Pointer(p)).FsharedMask))&int32(mask) != 0 || flags == libc.Int32FromInt32(SQLITE_SHM_SHARED)|libc.Int32FromInt32(SQLITE_SHM_LOCK) && 0 == int32((*TunixShm)(unsafe.Pointer(p)).FsharedMask)&int32(mask) || flags == libc.Int32FromInt32(SQLITE_SHM_EXCLUSIVE)|libc.Int32FromInt32(SQLITE_SHM_LOCK) { + if flags&int32(SQLITE_SHM_UNLOCK) != 0 && (libc.Int32FromUint16((*TunixShm)(unsafe.Pointer(p)).FexclMask)|libc.Int32FromUint16((*TunixShm)(unsafe.Pointer(p)).FsharedMask))&libc.Int32FromUint16(mask) != 0 || flags == libc.Int32FromInt32(SQLITE_SHM_SHARED)|libc.Int32FromInt32(SQLITE_SHM_LOCK) && 0 == libc.Int32FromUint16((*TunixShm)(unsafe.Pointer(p)).FsharedMask)&libc.Int32FromUint16(mask) || flags == libc.Int32FromInt32(SQLITE_SHM_EXCLUSIVE)|libc.Int32FromInt32(SQLITE_SHM_LOCK) { /* Take the required mutexes. In SETLK_TIMEOUT mode (blocking locks), if ** this is an attempt on an exclusive lock use sqlite3_mutex_try(). If any ** other thread is holding this mutex, then it is either holding or about @@ -28035,31 +26707,26 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( if flags&int32(SQLITE_SHM_UNLOCK) != 0 { /* Case (a) - unlock. */ bUnlock = int32(1) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If this is a SHARED lock being unlocked, it is possible that other ** clients within this process are holding the same SHARED lock. In ** this case, set bUnlock to 0 so that the posix lock is not removed ** from the file-descriptor below. */ if flags&int32(SQLITE_SHM_SHARED) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4)) > int32(1) { bUnlock = 0 *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))-- p1 = p + 10 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^int32(mask)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromUint16(mask)) } } if bUnlock != 0 { rc = _unixShmSystemLock(tls, pDbFd, int32(F_UNLCK), ofst+(libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4), n) if rc == SQLITE_OK { - libc.Xmemset(tls, aLock+uintptr(ofst)*4, 0, uint32(4)*uint32(n)) + libc.Xmemset(tls, aLock+uintptr(ofst)*4, 0, uint32(4)*libc.Uint32FromInt32(n)) p2 = p + 10 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) & ^int32(mask)) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) & ^libc.Int32FromUint16(mask)) p3 = p + 12 - *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^int32(mask)) + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^libc.Int32FromUint16(mask)) } } } else { @@ -28076,13 +26743,10 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( /* Get the local shared locks */ if rc == SQLITE_OK { p4 = p + 10 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | int32(mask)) + *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16(mask)) *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))++ } } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Make sure no sibling connections hold locks that will block this ** lock. If any do, return SQLITE_BUSY right away. */ ii = ofst @@ -28105,7 +26769,7 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( rc = _unixShmSystemLock(tls, pDbFd, int32(F_WRLCK), ofst+(libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4), n) if rc == SQLITE_OK { p6 = p + 12 - *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | int32(mask)) + *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromUint16(mask)) ii = ofst for { if !(ii < ofst+n) { @@ -28121,7 +26785,6 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( } } } - _ = libc.Int32FromInt32(0) } /* Drop the mutexes acquired above. */ Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) @@ -28140,7 +26803,6 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( func _unixShmBarrier(tls *libc.TLS, fd uintptr) { _ = fd /* compiler-defined memory barrier */ - _ = libc.Int32FromInt32(0) _unixEnterMutex(tls) /* Also mutex, for redundancy */ _unixLeaveMutex(tls) } @@ -28163,8 +26825,6 @@ func _unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) (r int32) { return SQLITE_OK } pShmNode = (*TunixShm)(unsafe.Pointer(p)).FpShmNode - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Remove connection p from the set of connections associated ** with pShmNode */ Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) @@ -28185,9 +26845,7 @@ func _unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) /* If pShmNode->nRef has reached 0, then close the underlying ** shared-memory file, too */ - _ = libc.Int32FromInt32(0) _unixEnterMutex(tls) - _ = libc.Int32FromInt32(0) (*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRef-- if (*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRef == 0 { if deleteFlag != 0 && (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0 { @@ -28205,9 +26863,8 @@ func _unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) (r int32) { // ** If it is currently memory mapped, unmap file pFd. // */ func _unixUnmapfile(tls *libc.TLS, pFd uintptr) { - _ = libc.Int32FromInt32(0) if (*TunixFile)(unsafe.Pointer(pFd)).FpMapRegion != 0 { - (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFd)).FpMapRegion, uint32((*TunixFile)(unsafe.Pointer(pFd)).FmmapSizeActual)) + (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFd)).FpMapRegion, libc.Uint32FromInt64((*TunixFile)(unsafe.Pointer(pFd)).FmmapSizeActual)) (*TunixFile)(unsafe.Pointer(pFd)).FpMapRegion = uintptr(0) (*TunixFile)(unsafe.Pointer(pFd)).FmmapSize = 0 (*TunixFile)(unsafe.Pointer(pFd)).FmmapSizeActual = 0 @@ -28243,29 +26900,23 @@ func _unixRemapfile(tls *libc.TLS, pFd uintptr, nNew Ti64) { nOrig = (*TunixFile)(unsafe.Pointer(pFd)).FmmapSizeActual /* Size of pOrig region in bytes */ pNew = uintptr(0) /* Location of new mapping */ flags = int32(PROT_READ) /* Flags to pass to mmap() */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pOrig != 0 { nReuse = (*TunixFile)(unsafe.Pointer(pFd)).FmmapSize pReq = pOrig + uintptr(nReuse) /* Unmap any pages of the existing mapping that cannot be reused. */ if nReuse != nOrig { - (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, pReq, uint32(nOrig-nReuse)) + (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, pReq, libc.Uint32FromInt64(nOrig-nReuse)) } - pNew = (*(*func(*libc.TLS, uintptr, Tsize_t, Tsize_t, int32, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(24)].FpCurrent})))(tls, pOrig, uint32(nReuse), uint32(nNew), int32(MREMAP_MAYMOVE), 0) + pNew = (*(*func(*libc.TLS, uintptr, Tsize_t, Tsize_t, int32, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(24)].FpCurrent})))(tls, pOrig, libc.Uint32FromInt64(nReuse), libc.Uint32FromInt64(nNew), int32(MREMAP_MAYMOVE), 0) zErr = __ccgo_ts + 3627 /* The attempt to extend the existing mapping failed. Free it. */ if pNew == uintptr(-libc.Int32FromInt32(1)) || pNew == uintptr(0) { - (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, pOrig, uint32(nReuse)) + (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, pOrig, libc.Uint32FromInt64(nReuse)) } } /* If pNew is still NULL, try to create an entirely new mapping. */ if pNew == uintptr(0) { - pNew = (*(*func(*libc.TLS, uintptr, Tsize_t, int32, int32, int32, Toff_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(22)].FpCurrent})))(tls, uintptr(0), uint32(nNew), flags, int32(MAP_SHARED), h, 0) + pNew = (*(*func(*libc.TLS, uintptr, Tsize_t, int32, int32, int32, Toff_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(22)].FpCurrent})))(tls, uintptr(0), libc.Uint32FromInt64(nNew), flags, int32(MAP_SHARED), h, 0) } if pNew == uintptr(-libc.Int32FromInt32(1)) { pNew = uintptr(0) @@ -28301,11 +26952,9 @@ func _unixRemapfile(tls *libc.TLS, pFd uintptr, nNew Ti64) { // ** code otherwise. // */ func _unixMapfile(tls *libc.TLS, pFd uintptr, nMap Ti64) (r int32) { - bp := tls.Alloc(96) - defer tls.Free(96) + bp := tls.Alloc(144) + defer tls.Free(144) var _ /* statbuf at bp+0 */ Tstat - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TunixFile)(unsafe.Pointer(pFd)).FnFetchOut > 0 { return SQLITE_OK } @@ -28318,7 +26967,6 @@ func _unixMapfile(tls *libc.TLS, pFd uintptr, nMap Ti64) (r int32) { if nMap > (*TunixFile)(unsafe.Pointer(pFd)).FmmapSizeMax { nMap = (*TunixFile)(unsafe.Pointer(pFd)).FmmapSizeMax } - _ = libc.Int32FromInt32(0) if nMap != (*TunixFile)(unsafe.Pointer(pFd)).FmmapSize { _unixRemapfile(tls, pFd, nMap) } @@ -28385,15 +27033,12 @@ func _unixUnfetch(tls *libc.TLS, fd uintptr, iOff Ti64, p uintptr) (r int32) { /* If p==0 (unmap the entire file) then there must be no outstanding ** xFetch references. Or, if p!=0 (meaning it is an xFetch reference), ** then there must be at least one outstanding. */ - _ = libc.Int32FromInt32(0) /* If p!=0, it must match the iOff value. */ - _ = libc.Int32FromInt32(0) if p != 0 { (*TunixFile)(unsafe.Pointer(pFd)).FnFetchOut-- } else { _unixUnmapfile(tls, pFd) } - _ = libc.Int32FromInt32(0) return SQLITE_OK } @@ -28601,13 +27246,11 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam _, _, _, _, _, _, _, _ = nFilename, pLockingStyle, pNew, rc, zLockFile, v1, p2, p3 pNew = pId rc = SQLITE_OK - _ = libc.Int32FromInt32(0) /* No locking occurs in temporary files */ - _ = libc.Int32FromInt32(0) (*TunixFile)(unsafe.Pointer(pNew)).Fh = h (*TunixFile)(unsafe.Pointer(pNew)).FpVfs = pVfs (*TunixFile)(unsafe.Pointer(pNew)).FzPath = zFilename - (*TunixFile)(unsafe.Pointer(pNew)).FctrlFlags = uint16(uint8(ctrlFlags)) + (*TunixFile)(unsafe.Pointer(pNew)).FctrlFlags = uint16(libc.Uint8FromInt32(ctrlFlags)) (*TunixFile)(unsafe.Pointer(pNew)).FmmapSizeMax = _sqlite3Config.FszMmap if ctrlFlags&int32(UNIXFILE_URI) != 0 { v1 = zFilename @@ -28655,9 +27298,8 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam _unixLeaveMutex(tls) } else { if pLockingStyle == uintptr(unsafe.Pointer(&_dotlockIoMethods)) { - _ = libc.Int32FromInt32(0) - nFilename = int32(libc.Xstrlen(tls, zFilename)) + int32(6) - zLockFile = Xsqlite3_malloc64(tls, uint64(nFilename)) + nFilename = libc.Int32FromUint32(libc.Xstrlen(tls, zFilename)) + int32(6) + zLockFile = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nFilename)) if zLockFile == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -28707,8 +27349,8 @@ func _unixTempFileInit(tls *libc.TLS) { // ** If no suitable temporary file directory can be found, return NULL. // */ func _unixTempFileDir(tls *libc.TLS) (r uintptr) { - bp := tls.Alloc(96) - defer tls.Free(96) + bp := tls.Alloc(144) + defer tls.Free(144) var i, v1 uint32 var zDir uintptr var _ /* buf at bp+0 */ Tstat @@ -28716,7 +27358,7 @@ func _unixTempFileDir(tls *libc.TLS) (r uintptr) { i = uint32(0) zDir = Xsqlite3_temp_directory for int32(1) != 0 { - if zDir != uintptr(0) && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(4)].FpCurrent})))(tls, zDir, bp) == 0 && (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(__S_IFMT) == uint32(libc.Int32FromInt32(__S_IFDIR)) && (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zDir, int32(03)) == 0 { + if zDir != uintptr(0) && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(4)].FpCurrent})))(tls, zDir, bp) == 0 && (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFDIR) && (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zDir, int32(03)) == 0 { return zDir } if i >= libc.Uint32FromInt64(24)/libc.Uint32FromInt64(4) { @@ -28758,7 +27400,6 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { } else { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) - _ = libc.Int32FromInt32(0) *(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = 0 Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3960, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = int32(*(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { @@ -28794,8 +27435,8 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { // ** such file descriptor is located, -1 is returned. // */ func _findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) (r uintptr) { - bp := tls.Alloc(96) - defer tls.Free(96) + bp := tls.Alloc(144) + defer tls.Free(144) var pInode, pUnused, pp uintptr var _ /* sStat at bp+0 */ Tstat _, _, _ = pInode, pUnused, pp @@ -28815,7 +27456,6 @@ func _findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) (r uintptr) { pInode = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpNext } if pInode != 0 { - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) flags &= libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) pp = pInode + 32 @@ -28845,8 +27485,8 @@ func _findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) (r uintptr) { // ** Find the mode, uid and gid of file zFile. // */ func _getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid uintptr) (r int32) { - bp := tls.Alloc(96) - defer tls.Free(96) + bp := tls.Alloc(144) + defer tls.Free(144) var rc int32 var _ /* sStat at bp+0 */ Tstat _ = rc /* Output of stat() on database file */ @@ -28917,7 +27557,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt nDb = _sqlite3Strlen30(tls, zPath) - int32(1) for nDb > 0 && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nDb)))) != int32('.') { if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nDb)))) == int32('-') { - libc.Xmemcpy(tls, bp, zPath, uint32(nDb)) + libc.Xmemcpy(tls, bp, zPath, libc.Uint32FromInt32(nDb)) (*(*[513]int8)(unsafe.Pointer(bp)))[nDb] = int8('\000') rc = _getFileMode(tls, bp, pMode, pUid, pGid) break @@ -29001,18 +27641,9 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags ** (c) if EXCLUSIVE is set, then CREATE must also be set. ** (d) if DELETEONCLOSE is set, then CREATE must also be set. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The main DB, main journal, WAL file and super-journal are never ** automatically deleted. Nor are they ever temporary files. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Assert that the upper layer has set one of the "file-type" flags. */ - _ = libc.Int32FromInt32(0) /* Detect a pid change and reset the PRNG. There is a race condition ** here such that two or more threads all trying to open databases at ** the same instant might all reset the PRNG. But multiple resets @@ -29037,11 +27668,9 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags /* Database filenames are double-zero terminated if they are not ** URIs with parameters. Hence, they can always be passed into ** sqlite3_uri_parameter(). */ - _ = libc.Int32FromInt32(0) } else { if !(zName != 0) { /* If zName is NULL, the upper layer is requesting a temp file. */ - _ = libc.Int32FromInt32(0) rc = _unixGetTempname(tls, (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname, bp) if rc != SQLITE_OK { return rc @@ -29049,7 +27678,6 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags zName = bp /* Generated temporary filenames are always double-zero terminated ** for use by sqlite3_uri_parameter(). */ - _ = libc.Int32FromInt32(0) } } /* Determine the value of the flags parameter passed to POSIX function @@ -29066,18 +27694,15 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags openFlags |= int32(O_CREAT) } if isExclusive != 0 { - openFlags |= libc.Int32FromInt32(O_EXCL) | libc.Int32FromInt32(__O_NOFOLLOW) + openFlags |= libc.Int32FromInt32(O_EXCL) | libc.Int32FromInt32(O_NOFOLLOW) } - openFlags |= libc.Int32FromInt32(__O_LARGEFILE) | libc.Int32FromInt32(O_BINARY) | libc.Int32FromInt32(__O_NOFOLLOW) + openFlags |= libc.Int32FromInt32(O_LARGEFILE) | libc.Int32FromInt32(O_BINARY) | libc.Int32FromInt32(O_NOFOLLOW) if fd < 0 { /* Groupid for the file */ rc = _findCreateFileMode(tls, zName, flags, bp+516, bp+520, bp+524) if rc != SQLITE_OK { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return rc } fd = _robust_open(tls, zName, openFlags, *(*Tmode_t)(unsafe.Pointer(bp + 516))) - _ = libc.Int32FromInt32(0) if fd < 0 { if isNewJrnl != 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(EACCES) && (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zName, F_OK) != 0 { /* If unable to create a journal because the directory is not @@ -29125,7 +27750,6 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags _robustFchown(tls, fd, *(*Tuid_t)(unsafe.Pointer(bp + 520)), *(*Tgid_t)(unsafe.Pointer(bp + 524))) } } - _ = libc.Int32FromInt32(0) if pOutFlags != 0 { *(*int32)(unsafe.Pointer(pOutFlags)) = flags } @@ -29153,7 +27777,6 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags if flags&int32(SQLITE_OPEN_URI) != 0 { ctrlFlags |= int32(UNIXFILE_URI) } - _ = libc.Int32FromInt32(0) rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) goto open_finished open_finished: @@ -29194,7 +27817,6 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( } _robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp)), int32(44926)) } else { - _ = libc.Int32FromInt32(0) rc = SQLITE_OK } } @@ -29214,16 +27836,14 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( // ** Otherwise return 0. // */ func _unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResOut uintptr) (r int32) { - bp := tls.Alloc(96) - defer tls.Free(96) + bp := tls.Alloc(144) + defer tls.Free(144) var _ /* buf at bp+0 */ Tstat _ = NotUsed - _ = libc.Int32FromInt32(0) /* The spec says there are three possible values for flags. But only ** two of them are actually used */ - _ = libc.Int32FromInt32(0) if flags == SQLITE_ACCESS_EXISTS { - *(*int32)(unsafe.Pointer(pResOut)) = libc.BoolInt32(0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(4)].FpCurrent})))(tls, zPath, bp) && (!((*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(__S_IFMT) == uint32(libc.Int32FromInt32(__S_IFREG))) || (*(*Tstat)(unsafe.Pointer(bp))).Fst_size > 0)) + *(*int32)(unsafe.Pointer(pResOut)) = libc.BoolInt32(0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(4)].FpCurrent})))(tls, zPath, bp) && (!((*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(S_IFMT) == libc.Uint32FromInt32(S_IFREG)) || (*(*Tstat)(unsafe.Pointer(bp))).Fst_size > 0)) } else { *(*int32)(unsafe.Pointer(pResOut)) = libc.BoolInt32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zPath, libc.Int32FromInt32(W_OK)|libc.Int32FromInt32(R_OK)) == 0) } @@ -29261,23 +27881,20 @@ type DbPath1 = TDbPath1 // ** Append a single path element to the DbPath under construction // */ func _appendOnePathElement(tls *libc.TLS, pPath uintptr, zName uintptr, nName int32) { - bp := tls.Alloc(4208) - defer tls.Free(4208) + bp := tls.Alloc(4256) + defer tls.Free(4256) var got Tssize_t var zIn, v2, v4, v6 uintptr var v1, v3, v5 int32 var _ /* buf at bp+0 */ Tstat - var _ /* zLnk at bp+96 */ [4098]int8 + var _ /* zLnk at bp+144 */ [4098]int8 _, _, _, _, _, _, _, _ = got, zIn, v1, v2, v3, v4, v5, v6 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(*(*int8)(unsafe.Pointer(zName))) == int32('.') { if nName == int32(1) { return } if int32(*(*int8)(unsafe.Pointer(zName + 1))) == int32('.') && nName == int32(2) { if (*TDbPath)(unsafe.Pointer(pPath)).FnUsed > int32(1) { - _ = libc.Int32FromInt32(0) for { v2 = pPath + 16 *(*int32)(unsafe.Pointer(v2))-- @@ -29298,7 +27915,7 @@ func _appendOnePathElement(tls *libc.TLS, pPath uintptr, zName uintptr, nName in v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ *(*int8)(unsafe.Pointer((*TDbPath)(unsafe.Pointer(pPath)).FzOut + uintptr(v3))) = int8('/') - libc.Xmemcpy(tls, (*TDbPath)(unsafe.Pointer(pPath)).FzOut+uintptr((*TDbPath)(unsafe.Pointer(pPath)).FnUsed), zName, uint32(nName)) + libc.Xmemcpy(tls, (*TDbPath)(unsafe.Pointer(pPath)).FzOut+uintptr((*TDbPath)(unsafe.Pointer(pPath)).FnUsed), zName, libc.Uint32FromInt32(nName)) *(*int32)(unsafe.Pointer(pPath + 16)) += nName if (*TDbPath)(unsafe.Pointer(pPath)).Frc == SQLITE_OK { *(*int8)(unsafe.Pointer((*TDbPath)(unsafe.Pointer(pPath)).FzOut + uintptr((*TDbPath)(unsafe.Pointer(pPath)).FnUsed))) = 0 @@ -29308,7 +27925,7 @@ func _appendOnePathElement(tls *libc.TLS, pPath uintptr, zName uintptr, nName in (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45020)), __ccgo_ts+3655, zIn, int32(45020)) } } else { - if (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(__S_IFMT) == uint32(libc.Int32FromInt32(__S_IFLNK)) { + if (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFLNK) { v6 = pPath + 4 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ @@ -29316,18 +27933,18 @@ func _appendOnePathElement(tls *libc.TLS, pPath uintptr, zName uintptr, nName in (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45026)) return } - got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+96, libc.Uint32FromInt64(4098)-libc.Uint32FromInt32(2)) + got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+144, libc.Uint32FromInt64(4098)-libc.Uint32FromInt32(2)) if got <= 0 || got >= libc.Int32FromInt64(4098)-libc.Int32FromInt32(2) { (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45031)), __ccgo_ts+3646, zIn, int32(45031)) return } - (*(*[4098]int8)(unsafe.Pointer(bp + 96)))[got] = 0 - if int32((*(*[4098]int8)(unsafe.Pointer(bp + 96)))[0]) == int32('/') { + (*(*[4098]int8)(unsafe.Pointer(bp + 144)))[got] = 0 + if int32((*(*[4098]int8)(unsafe.Pointer(bp + 144)))[0]) == int32('/') { (*TDbPath)(unsafe.Pointer(pPath)).FnUsed = 0 } else { *(*int32)(unsafe.Pointer(pPath + 16)) -= nName + int32(1) } - _appendAllPathElements(tls, pPath, bp+96) + _appendAllPathElements(tls, pPath, bp+144) } } } @@ -29401,10 +28018,6 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z return SQLITE_OK } -type TLmid_t = int32 - -type Lmid_t = TLmid_t - type TDl_info = struct { Fdli_fname uintptr Fdli_fbase uintptr @@ -29414,51 +28027,6 @@ type TDl_info = struct { type Dl_info = TDl_info -const _RTLD_DL_SYMENT = 1 -const _RTLD_DL_LINKMAP = 2 -const _RTLD_DI_LMID = 1 -const _RTLD_DI_LINKMAP = 2 -const _RTLD_DI_CONFIGADDR = 3 -const _RTLD_DI_SERINFO = 4 -const _RTLD_DI_SERINFOSIZE = 5 -const _RTLD_DI_ORIGIN = 6 -const _RTLD_DI_PROFILENAME = 7 -const _RTLD_DI_PROFILEOUT = 8 -const _RTLD_DI_TLS_MODID = 9 -const _RTLD_DI_TLS_DATA = 10 -const _RTLD_DI_PHDR = 11 -const _RTLD_DI_MAX = 11 - -type TDl_serpath = struct { - Fdls_name uintptr - Fdls_flags uint32 -} - -type Dl_serpath = TDl_serpath - -type TDl_serinfo = struct { - Fdls_size Tsize_t - Fdls_cnt uint32 - F__ccgo2_8 struct { - F__dls_serpath_pad [1]TDl_serpath - } -} - -type Dl_serinfo = TDl_serinfo - -type Tdl_find_object = struct { - Fdlfo_flags uint64 - Fdlfo_map_start uintptr - Fdlfo_map_end uintptr - Fdlfo_link_map uintptr - Fdlfo_eh_frame uintptr - Fdlfo_eh_dbase uintptr - F__dlfo_eh_dbase_pad uint32 - F__dflo_reserved [7]uint64 -} - -type dl_find_object = Tdl_find_object - func _unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) (r uintptr) { _ = NotUsed return libc.Xdlopen(tls, zFilename, libc.Int32FromInt32(RTLD_NOW)|libc.Int32FromInt32(RTLD_GLOBAL)) @@ -29509,11 +28077,10 @@ func _unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) ( bp := tls.Alloc(16) defer tls.Free(16) var fd, got int32 - var _ /* rp at bp+4 */ Tpid_t + var _ /* rp at bp+8 */ Tpid_t var _ /* t at bp+0 */ Ttime_t _, _ = fd, got _ = NotUsed - _ = libc.Int32FromInt32(0) /* We have to initialize zBuf to prevent valgrind from reporting ** errors. The reports issued by valgrind are incorrect - we would ** prefer that the randomness be increased by making use of the @@ -29526,19 +28093,18 @@ func _unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) ( ** that we always use the same random number sequence. This makes the ** tests repeatable. */ - libc.Xmemset(tls, zBuf, 0, uint32(nBuf)) + libc.Xmemset(tls, zBuf, 0, libc.Uint32FromInt32(nBuf)) libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_randomnessPid)), libc.Xgetpid(tls)) fd = _robust_open(tls, __ccgo_ts+3990, O_RDONLY, uint32(0)) if fd < 0 { libc.Xtime(tls, bp) - libc.Xmemcpy(tls, zBuf, bp, uint32(4)) - *(*Tpid_t)(unsafe.Pointer(bp + 4)) = libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_randomnessPid))) - libc.Xmemcpy(tls, zBuf+uintptr(4), bp+4, uint32(4)) - _ = libc.Int32FromInt32(0) - nBuf = int32(libc.Uint32FromInt64(4) + libc.Uint32FromInt64(4)) + libc.Xmemcpy(tls, zBuf, bp, uint32(8)) + *(*Tpid_t)(unsafe.Pointer(bp + 8)) = libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_randomnessPid))) + libc.Xmemcpy(tls, zBuf+uintptr(8), bp+8, uint32(4)) + nBuf = libc.Int32FromUint32(libc.Uint32FromInt64(8) + libc.Uint32FromInt64(4)) } else { for cond := true; cond; cond = got < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(EINTR) { - got = (*(*func(*libc.TLS, int32, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(8)].FpCurrent})))(tls, fd, zBuf, uint32(nBuf)) + got = (*(*func(*libc.TLS, int32, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(8)].FpCurrent})))(tls, fd, zBuf, libc.Uint32FromInt32(nBuf)) } _robust_close(tls, uintptr(0), fd, int32(45197)) } @@ -29559,7 +28125,7 @@ func _unixSleep(tls *libc.TLS, NotUsed uintptr, microseconds int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* sp at bp+0 */ Ttimespec - (*(*Ttimespec)(unsafe.Pointer(bp))).Ftv_sec = microseconds / int32(1000000) + (*(*Ttimespec)(unsafe.Pointer(bp))).Ftv_sec = int64(microseconds / int32(1000000)) (*(*Ttimespec)(unsafe.Pointer(bp))).Ftv_nsec = microseconds % int32(1000000) * int32(1000) /* Almost all modern unix systems support nanosleep(). But if you are ** compiling for one of the rare exceptions, you can use @@ -29596,7 +28162,7 @@ func _unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) (r int _ = rc rc = SQLITE_OK libc.Xgettimeofday(tls, bp, uintptr(0)) /* Cannot fail given valid arguments */ - *(*Tsqlite3_int64)(unsafe.Pointer(piNow)) = _unixEpoch + int64(1000)*int64((*(*Ttimeval)(unsafe.Pointer(bp))).Ftv_sec) + int64((*(*Ttimeval)(unsafe.Pointer(bp))).Ftv_usec/int32(1000)) + *(*Tsqlite3_int64)(unsafe.Pointer(piNow)) = _unixEpoch + int64(1000)*(*(*Ttimeval)(unsafe.Pointer(bp))).Ftv_sec + (*(*Ttimeval)(unsafe.Pointer(bp))).Ftv_usec/int64(1000) _ = NotUsed return rc } @@ -29824,7 +28390,6 @@ func Xsqlite3_os_init(tls *libc.TLS) (r int32) { _ = i /* Double-check that the aSyscall[] array has been constructed ** correctly. See ticket [bb3a86e890c8e96ab] */ - _ = libc.Int32FromInt32(0) /* Register all VFSes defined in the aVfs[] array */ i = uint32(0) for { @@ -29839,8 +28404,8 @@ func Xsqlite3_os_init(tls *libc.TLS) (r int32) { } _unixBigLock = _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1)) /* Validate lock assumptions */ - _ = libc.Int32FromInt32(0) /* Number of available locks */ - _ = libc.Int32FromInt32(0) /* Start of locking area */ + /* Number of available locks */ + /* Start of locking area */ /* Locks: ** WRITE UNIX_SHM_BASE 120 ** CKPT UNIX_SHM_BASE+1 121 @@ -29852,7 +28417,7 @@ func Xsqlite3_os_init(tls *libc.TLS) (r int32) { ** READ-4 UNIX_SHM_BASE+7 127 ** DMS UNIX_SHM_BASE+8 128 */ - _ = libc.Int32FromInt32(0) /* Byte offset of the deadman-switch */ + /* Byte offset of the deadman-switch */ /* Initialize temp file dir array. */ _unixTempFileInit(tls) return SQLITE_OK @@ -30307,14 +28872,14 @@ func _memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Ts p = (*TMemFile)(unsafe.Pointer(pFile)).FpStore _memdbEnter(tls, p) if iOfst+int64(iAmt) > (*TMemStore)(unsafe.Pointer(p)).Fsz { - libc.Xmemset(tls, zBuf, 0, uint32(iAmt)) + libc.Xmemset(tls, zBuf, 0, libc.Uint32FromInt32(iAmt)) if iOfst < (*TMemStore)(unsafe.Pointer(p)).Fsz { - libc.Xmemcpy(tls, zBuf, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), uint32((*TMemStore)(unsafe.Pointer(p)).Fsz-iOfst)) + libc.Xmemcpy(tls, zBuf, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), libc.Uint32FromInt64((*TMemStore)(unsafe.Pointer(p)).Fsz-iOfst)) } _memdbLeave(tls, p) return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) } - libc.Xmemcpy(tls, zBuf, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), uint32(iAmt)) + libc.Xmemcpy(tls, zBuf, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), libc.Uint32FromInt32(iAmt)) _memdbLeave(tls, p) return SQLITE_OK } @@ -30337,7 +28902,7 @@ func _memdbEnlarge(tls *libc.TLS, p uintptr, newSz Tsqlite3_int64) (r int32) { if newSz > (*TMemStore)(unsafe.Pointer(p)).FszMax { newSz = (*TMemStore)(unsafe.Pointer(p)).FszMax } - pNew = _sqlite3Realloc(tls, (*TMemStore)(unsafe.Pointer(p)).FaData, uint64(newSz)) + pNew = _sqlite3Realloc(tls, (*TMemStore)(unsafe.Pointer(p)).FaData, libc.Uint64FromInt64(newSz)) if pNew == uintptr(0) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) } @@ -30374,11 +28939,11 @@ func _memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Tsql return rc } if iOfst > (*TMemStore)(unsafe.Pointer(p)).Fsz { - libc.Xmemset(tls, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr((*TMemStore)(unsafe.Pointer(p)).Fsz), 0, uint32(iOfst-(*TMemStore)(unsafe.Pointer(p)).Fsz)) + libc.Xmemset(tls, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr((*TMemStore)(unsafe.Pointer(p)).Fsz), 0, libc.Uint32FromInt64(iOfst-(*TMemStore)(unsafe.Pointer(p)).Fsz)) } (*TMemStore)(unsafe.Pointer(p)).Fsz = iOfst + int64(iAmt) } - libc.Xmemcpy(tls, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), z, uint32(iAmt)) + libc.Xmemcpy(tls, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), z, libc.Uint32FromInt32(iAmt)) _memdbLeave(tls, p) return SQLITE_OK } @@ -30451,15 +29016,11 @@ func _memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) (r int32) { return SQLITE_OK } _memdbEnter(tls, p) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if eLock > int32(SQLITE_LOCK_SHARED) && (*TMemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_READONLY) != 0 { rc = int32(SQLITE_READONLY) } else { switch eLock { case int32(SQLITE_LOCK_SHARED): - _ = libc.Int32FromInt32(0) if (*TMemStore)(unsafe.Pointer(p)).FnWrLock > 0 { rc = int32(SQLITE_BUSY) } else { @@ -30468,7 +29029,6 @@ func _memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) (r int32) { case int32(SQLITE_LOCK_RESERVED): fallthrough case int32(SQLITE_LOCK_PENDING): - _ = libc.Int32FromInt32(0) if (*TMemFile)(unsafe.Pointer(pThis)).FeLock == int32(SQLITE_LOCK_SHARED) { if (*TMemStore)(unsafe.Pointer(p)).FnWrLock > 0 { rc = int32(SQLITE_BUSY) @@ -30477,8 +29037,6 @@ func _memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) (r int32) { } } default: - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TMemStore)(unsafe.Pointer(p)).FnRdLock > int32(1) { rc = int32(SQLITE_BUSY) } else { @@ -30510,7 +29068,6 @@ func _memdbUnlock(tls *libc.TLS, pFile uintptr, eLock int32) (r int32) { return SQLITE_OK } _memdbEnter(tls, p) - _ = libc.Int32FromInt32(0) if eLock == int32(SQLITE_LOCK_SHARED) { if (*TMemFile)(unsafe.Pointer(pThis)).FeLock > int32(SQLITE_LOCK_SHARED) { (*TMemStore)(unsafe.Pointer(p)).FnWrLock-- @@ -30637,12 +29194,12 @@ func _memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags i i++ } if p == uintptr(0) { - p = _sqlite3Malloc(tls, uint64(uint32(56)+uint32(szName)+uint32(3))) + p = _sqlite3Malloc(tls, uint64(uint32(56)+libc.Uint32FromInt32(szName)+uint32(3))) if p == uintptr(0) { Xsqlite3_mutex_leave(tls, pVfsMutex) return int32(SQLITE_NOMEM) } - apNew = _sqlite3Realloc(tls, _memdb_g.FapMemStore, uint64(uint32(4)*uint32(_memdb_g.FnMemStore+libc.Int32FromInt32(1)))) + apNew = _sqlite3Realloc(tls, _memdb_g.FapMemStore, uint64(uint32(4)*libc.Uint32FromInt32(_memdb_g.FnMemStore+libc.Int32FromInt32(1)))) if apNew == uintptr(0) { Xsqlite3_free(tls, p) Xsqlite3_mutex_leave(tls, pVfsMutex) @@ -30654,10 +29211,10 @@ func _memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags i *(*uintptr)(unsafe.Pointer(apNew + uintptr(v2)*4)) = p _memdb_g.FapMemStore = apNew libc.Xmemset(tls, p, 0, uint32(56)) - (*TMemStore)(unsafe.Pointer(p)).FmFlags = uint32(libc.Int32FromInt32(SQLITE_DESERIALIZE_RESIZEABLE) | libc.Int32FromInt32(SQLITE_DESERIALIZE_FREEONCLOSE)) + (*TMemStore)(unsafe.Pointer(p)).FmFlags = libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_DESERIALIZE_RESIZEABLE) | libc.Int32FromInt32(SQLITE_DESERIALIZE_FREEONCLOSE)) (*TMemStore)(unsafe.Pointer(p)).FszMax = _sqlite3Config.FmxMemdbSize (*TMemStore)(unsafe.Pointer(p)).FzFName = p + 1*56 - libc.Xmemcpy(tls, (*TMemStore)(unsafe.Pointer(p)).FzFName, zName, uint32(szName+int32(1))) + libc.Xmemcpy(tls, (*TMemStore)(unsafe.Pointer(p)).FzFName, zName, libc.Uint32FromInt32(szName+int32(1))) (*TMemStore)(unsafe.Pointer(p)).FpMutex = Xsqlite3_mutex_alloc(tls, SQLITE_MUTEX_FAST) if (*TMemStore)(unsafe.Pointer(p)).FpMutex == uintptr(0) { _memdb_g.FnMemStore-- @@ -30678,7 +29235,7 @@ func _memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags i return int32(SQLITE_NOMEM) } libc.Xmemset(tls, p, 0, uint32(56)) - (*TMemStore)(unsafe.Pointer(p)).FmFlags = uint32(libc.Int32FromInt32(SQLITE_DESERIALIZE_RESIZEABLE) | libc.Int32FromInt32(SQLITE_DESERIALIZE_FREEONCLOSE)) + (*TMemStore)(unsafe.Pointer(p)).FmFlags = libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_DESERIALIZE_RESIZEABLE) | libc.Int32FromInt32(SQLITE_DESERIALIZE_FREEONCLOSE)) (*TMemStore)(unsafe.Pointer(p)).FszMax = _sqlite3Config.FmxMemdbSize } (*TMemFile)(unsafe.Pointer(pFile)).FpStore = p @@ -30846,16 +29403,15 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp } if p != 0 { pStore = (*TMemFile)(unsafe.Pointer(p)).FpStore - _ = libc.Int32FromInt32(0) if piSize != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(piSize)) = (*TMemStore)(unsafe.Pointer(pStore)).Fsz } if mFlags&uint32(SQLITE_SERIALIZE_NOCOPY) != 0 { pOut = (*TMemStore)(unsafe.Pointer(pStore)).FaData } else { - pOut = Xsqlite3_malloc64(tls, uint64((*TMemStore)(unsafe.Pointer(pStore)).Fsz)) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64((*TMemStore)(unsafe.Pointer(pStore)).Fsz)) if pOut != 0 { - libc.Xmemcpy(tls, pOut, (*TMemStore)(unsafe.Pointer(pStore)).FaData, uint32((*TMemStore)(unsafe.Pointer(pStore)).Fsz)) + libc.Xmemcpy(tls, pOut, (*TMemStore)(unsafe.Pointer(pStore)).FaData, libc.Uint32FromInt64((*TMemStore)(unsafe.Pointer(pStore)).Fsz)) } } return pOut @@ -30895,7 +29451,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp if mFlags&uint32(SQLITE_SERIALIZE_NOCOPY) != 0 { pOut = uintptr(0) } else { - pOut = Xsqlite3_malloc64(tls, uint64(sz)) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(sz)) if pOut != 0 { nPage = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pPager = _sqlite3BtreePager(tls, pBt) @@ -30906,11 +29462,11 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp } *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) pTo = pOut + uintptr(int64(szPage)*int64(pgno-libc.Int32FromInt32(1))) - rc = _sqlite3PagerGet(tls, pPager, uint32(pgno), bp+4, 0) + rc = _sqlite3PagerGet(tls, pPager, libc.Uint32FromInt32(pgno), bp+4, 0) if rc == SQLITE_OK { - libc.Xmemcpy(tls, pTo, _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 4))), uint32(szPage)) + libc.Xmemcpy(tls, pTo, _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 4))), libc.Uint32FromInt32(szPage)) } else { - libc.Xmemset(tls, pTo, 0, uint32(szPage)) + libc.Xmemset(tls, pTo, 0, libc.Uint32FromInt32(szPage)) } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) goto _2 @@ -30956,7 +29512,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint if rc != 0 { goto end_deserialize } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(iDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) libc.SetBitFieldPtr8Uint32(db+168+8, libc.Uint32FromInt32(1), 2, 0x4) rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) libc.SetBitFieldPtr8Uint32(db+168+8, libc.Uint32FromInt32(0), 2, 0x4) @@ -31014,7 +29570,7 @@ func _sqlite3MemdbInit(tls *libc.TLS) (r int32) { if pLower == uintptr(0) { return int32(SQLITE_ERROR) } - sz = uint32((*Tsqlite3_vfs)(unsafe.Pointer(pLower)).FszOsFile) + sz = libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pLower)).FszOsFile) _memdb_vfs.FpAppData = pLower /* The following conditional can only be true when compiled for ** Windows x86 and SQLITE_MAX_MMAP_SIZE=0. We always leave @@ -31023,7 +29579,7 @@ func _sqlite3MemdbInit(tls *libc.TLS) (r int32) { if sz < uint32(12) { sz = uint32(12) } /*NO_TEST*/ - _memdb_vfs.FszOsFile = int32(sz) + _memdb_vfs.FszOsFile = libc.Int32FromUint32(sz) return Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&_memdb_vfs)), 0) } @@ -31132,7 +29688,6 @@ type Bitvec1 = TBitvec1 func _sqlite3BitvecCreate(tls *libc.TLS, iSize Tu32) (r uintptr) { var p uintptr _ = p - _ = libc.Int32FromInt32(0) p = _sqlite3MallocZero(tls, uint64(512)) if p != 0 { (*TBitvec)(unsafe.Pointer(p)).FiSize = iSize @@ -31150,7 +29705,6 @@ func _sqlite3BitvecCreate(tls *libc.TLS, iSize Tu32) (r uintptr) { func _sqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i Tu32) (r int32) { var bin, h, v1 Tu32 _, _, _ = bin, h, v1 - _ = libc.Int32FromInt32(0) i-- if i >= (*TBitvec)(unsafe.Pointer(p)).FiSize { return 0 @@ -31164,7 +29718,7 @@ func _sqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i Tu32) (r int32) { } } if (*TBitvec)(unsafe.Pointer(p)).FiSize <= (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) { - return libc.BoolInt32(int32(*(*Tu8)(unsafe.Pointer(p + 12 + uintptr(i/uint32(BITVEC_SZELEM)))))&(int32(1)<<(i&uint32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))) != 0) + return libc.BoolInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p + 12 + uintptr(i/uint32(BITVEC_SZELEM)))))&(int32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))) != 0) } else { v1 = i i++ @@ -31207,8 +29761,6 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { if p == uintptr(0) { return SQLITE_OK } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) i-- for (*TBitvec)(unsafe.Pointer(p)).FiSize > (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) && (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { bin = i / (*TBitvec)(unsafe.Pointer(p)).FiDivisor @@ -31223,7 +29775,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { } if (*TBitvec)(unsafe.Pointer(p)).FiSize <= (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) { p1 = p + 12 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(1)<<(i&uint32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))) return SQLITE_OK } v2 = i @@ -31306,7 +29858,6 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { if p == uintptr(0) { return } - _ = libc.Int32FromInt32(0) i-- for (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { bin = i / (*TBitvec)(unsafe.Pointer(p)).FiDivisor @@ -31318,7 +29869,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if (*TBitvec)(unsafe.Pointer(p)).FiSize <= (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) { p1 = p + 12 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & uint32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+12, uint32(500)) @@ -31436,8 +29987,8 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { rc = -int32(1) /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ - pBitvec = _sqlite3BitvecCreate(tls, uint32(sz)) - pV = _sqlite3MallocZero(tls, uint64((sz+int32(7))/int32(8)+int32(1))) + pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -31485,14 +30036,14 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { p5 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) *(*uint8)(unsafe.Pointer(p5)) = uint8(int32(*(*uint8)(unsafe.Pointer(p5))) | libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))) if op != int32(5) { - if _sqlite3BitvecSet(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))+int32(1))) != 0 { + if _sqlite3BitvecSet(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1))) != 0 { goto bitvec_end } } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) - _sqlite3BitvecClear(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) + _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } /* Test to make sure the linear array exactly matches the @@ -31500,13 +30051,13 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { ** match (rc==0). Change rc to non-zero if a discrepancy ** is found. */ - rc = int32(uint32(_sqlite3BitvecTest(tls, uintptr(0), uint32(0))+_sqlite3BitvecTest(tls, pBitvec, uint32(sz+int32(1)))+_sqlite3BitvecTest(tls, pBitvec, uint32(0))) + (_sqlite3BitvecSize(tls, pBitvec) - uint32(sz))) + rc = libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3BitvecTest(tls, uintptr(0), uint32(0))+_sqlite3BitvecTest(tls, pBitvec, libc.Uint32FromInt32(sz+int32(1)))+_sqlite3BitvecTest(tls, pBitvec, uint32(0))) + (_sqlite3BitvecSize(tls, pBitvec) - libc.Uint32FromInt32(sz))) *(*int32)(unsafe.Pointer(bp)) = int32(1) for { if !(*(*int32)(unsafe.Pointer(bp)) <= sz) { break } - if libc.BoolInt32(int32(*(*uint8)(unsafe.Pointer(pV + uintptr(*(*int32)(unsafe.Pointer(bp))>>int32(3)))))&(int32(1)<<(*(*int32)(unsafe.Pointer(bp))&int32(7))) != 0) != _sqlite3BitvecTest(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp)))) { + if libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(pV + uintptr(*(*int32)(unsafe.Pointer(bp))>>int32(3)))))&(int32(1)<<(*(*int32)(unsafe.Pointer(bp))&int32(7))) != 0) != _sqlite3BitvecTest(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) { rc = *(*int32)(unsafe.Pointer(bp)) break } @@ -31626,9 +30177,7 @@ func _pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove Tu8) { var p uintptr _ = p p = (*TPgHdr)(unsafe.Pointer(pPage)).FpCache - if int32(addRemove)&int32(PCACHE_DIRTYLIST_REMOVE) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(addRemove)&int32(PCACHE_DIRTYLIST_REMOVE) != 0 { /* Update the PCache1.pSynced variable if necessary. */ if (*TPCache)(unsafe.Pointer(p)).FpSynced == pPage { (*TPCache)(unsafe.Pointer(p)).FpSynced = (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev @@ -31636,7 +30185,6 @@ func _pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove Tu8) { if (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyNext != 0 { (*TPgHdr)(unsafe.Pointer((*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyNext)).FpDirtyPrev = (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev } else { - _ = libc.Int32FromInt32(0) (*TPCache)(unsafe.Pointer(p)).FpDirtyTail = (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev } if (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev != 0 { @@ -31646,25 +30194,20 @@ func _pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove Tu8) { ** This is an optimization that allows sqlite3PcacheFetch() to skip ** searching for a dirty page to eject from the cache when it might ** otherwise have to. */ - _ = libc.Int32FromInt32(0) (*TPCache)(unsafe.Pointer(p)).FpDirty = (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyNext - _ = libc.Int32FromInt32(0) if (*TPCache)(unsafe.Pointer(p)).FpDirty == uintptr(0) { /*OPTIMIZATION-IF-TRUE*/ - _ = libc.Int32FromInt32(0) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) } } } - if int32(addRemove)&int32(PCACHE_DIRTYLIST_ADD) != 0 { + if libc.Int32FromUint8(addRemove)&int32(PCACHE_DIRTYLIST_ADD) != 0 { (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev = uintptr(0) (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyNext = (*TPCache)(unsafe.Pointer(p)).FpDirty if (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyNext != 0 { - _ = libc.Int32FromInt32(0) (*TPgHdr)(unsafe.Pointer((*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyNext)).FpDirtyPrev = pPage } else { (*TPCache)(unsafe.Pointer(p)).FpDirtyTail = pPage if (*TPCache)(unsafe.Pointer(p)).FbPurgeable != 0 { - _ = libc.Int32FromInt32(0) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(1) } } @@ -31674,7 +30217,7 @@ func _pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove Tu8) { ** optimization, as if pSynced points to a page with the NEED_SYNC ** flag set sqlite3PcacheFetchStress() searches through all newer ** entries of the dirty-list for a page with NEED_SYNC clear anyway. */ - if !((*TPCache)(unsafe.Pointer(p)).FpSynced != 0) && 0 == int32((*TPgHdr)(unsafe.Pointer(pPage)).Fflags)&int32(PGHDR_NEED_SYNC) { + if !((*TPCache)(unsafe.Pointer(p)).FpSynced != 0) && 0 == libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPage)).Fflags)&int32(PGHDR_NEED_SYNC) { (*TPCache)(unsafe.Pointer(p)).FpSynced = pPage } } @@ -31732,7 +30275,6 @@ func _sqlite3PcacheInitialize(tls *libc.TLS) (r int32) { ** built-in default page cache is used instead of the application defined ** page cache. */ _sqlite3PCacheSetDefault(tls) - _ = libc.Int32FromInt32(0) } return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxInit})))(tls, _sqlite3Config.Fpcache2.FpArg) } @@ -31771,8 +30313,8 @@ func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable i libc.Xmemset(tls, p, 0, uint32(52)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra - _ = libc.Int32FromInt32(0) /* First 8 bytes will be zeroed */ - (*TPCache)(unsafe.Pointer(p)).FbPurgeable = uint8(bPurgeable) + /* First 8 bytes will be zeroed */ + (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) (*TPCache)(unsafe.Pointer(p)).FxStress = xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress @@ -31790,9 +30332,8 @@ func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable i func _sqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) (r int32) { var pNew uintptr _ = pNew - _ = libc.Int32FromInt32(0) if (*TPCache)(unsafe.Pointer(pCache)).FszPage != 0 { - pNew = (*(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxCreate})))(tls, szPage, int32(uint32((*TPCache)(unsafe.Pointer(pCache)).FszExtra)+(libc.Uint32FromInt64(48)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))), int32((*TPCache)(unsafe.Pointer(pCache)).FbPurgeable)) + pNew = (*(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxCreate})))(tls, szPage, libc.Int32FromUint32(libc.Uint32FromInt32((*TPCache)(unsafe.Pointer(pCache)).FszExtra)+(libc.Uint32FromInt64(48)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))), libc.Int32FromUint8((*TPCache)(unsafe.Pointer(pCache)).FbPurgeable)) if pNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -31836,10 +30377,6 @@ func _sqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno TPgno, createFlag i var eCreate int32 var pRes uintptr _, _ = eCreate, pRes - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* eCreate defines what to do if the page does not exist. ** 0 Do not allocate a new page. (createFlag==0) ** 1 Allocate a new page if doing so is inexpensive. @@ -31847,10 +30384,7 @@ func _sqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno TPgno, createFlag i ** 2 Allocate a new page even it doing so is difficult. ** (createFlag==1 AND !(bPurgeable AND pDirty) */ - eCreate = createFlag & int32((*TPCache)(unsafe.Pointer(pCache)).FeCreate) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + eCreate = createFlag & libc.Int32FromUint8((*TPCache)(unsafe.Pointer(pCache)).FeCreate) pRes = (*(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxFetch})))(tls, (*TPCache)(unsafe.Pointer(pCache)).FpCache, pgno, eCreate) return pRes } @@ -31872,7 +30406,7 @@ func _sqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno TPgno, ppPage var pPg uintptr var rc, v3 int32 _, _, _ = pPg, rc, v3 - if int32((*TPCache)(unsafe.Pointer(pCache)).FeCreate) == int32(2) { + if libc.Int32FromUint8((*TPCache)(unsafe.Pointer(pCache)).FeCreate) == int32(2) { return 0 } if _sqlite3PcachePagecount(tls, pCache) > (*TPCache)(unsafe.Pointer(pCache)).FszSpill { @@ -31887,7 +30421,7 @@ func _sqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno TPgno, ppPage ** cleared). This is Ok, as pSynced is just an optimization. */ pPg = (*TPCache)(unsafe.Pointer(pCache)).FpSynced for { - if !(pPg != 0 && ((*TPgHdr)(unsafe.Pointer(pPg)).FnRef != 0 || int32((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_NEED_SYNC) != 0)) { + if !(pPg != 0 && ((*TPgHdr)(unsafe.Pointer(pPg)).FnRef != 0 || libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_NEED_SYNC) != 0)) { break } goto _1 @@ -31938,9 +30472,7 @@ func _sqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno TPgno, ppPage func _pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno TPgno, pPage uintptr) (r uintptr) { var pPgHdr uintptr _ = pPgHdr - _ = libc.Int32FromInt32(0) pPgHdr = (*Tsqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, pPgHdr+16, 0, libc.Uint32FromInt64(48)-uint32(libc.UintptrFromInt32(0)+16)) (*TPgHdr)(unsafe.Pointer(pPgHdr)).FpPage = pPage (*TPgHdr)(unsafe.Pointer(pPgHdr)).FpData = (*Tsqlite3_pcache_page)(unsafe.Pointer(pPage)).FpBuf @@ -31963,14 +30495,12 @@ func _pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno TPgno, pPage func _sqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno TPgno, pPage uintptr) (r uintptr) { var pPgHdr uintptr _ = pPgHdr - _ = libc.Int32FromInt32(0) pPgHdr = (*Tsqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra if !((*TPgHdr)(unsafe.Pointer(pPgHdr)).FpPage != 0) { return _pcacheFetchFinishWithInit(tls, pCache, pgno, pPage) } (*TPCache)(unsafe.Pointer(pCache)).FnRefSum++ (*TPgHdr)(unsafe.Pointer(pPgHdr)).FnRef++ - _ = libc.Int32FromInt32(0) return pPgHdr } @@ -31984,17 +30514,15 @@ func _sqlite3PcacheRelease(tls *libc.TLS, p uintptr) { var v1 Ti64 var v2 uintptr _, _ = v1, v2 - _ = libc.Int32FromInt32(0) (*TPCache)(unsafe.Pointer((*TPgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum-- v2 = p + 32 *(*Ti64)(unsafe.Pointer(v2))-- v1 = *(*Ti64)(unsafe.Pointer(v2)) if v1 == 0 { - if int32((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_CLEAN) != 0 { + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_CLEAN) != 0 { _pcacheUnpin(tls, p) } else { _pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) - _ = libc.Int32FromInt32(0) } } } @@ -32005,8 +30533,6 @@ func _sqlite3PcacheRelease(tls *libc.TLS, p uintptr) { // ** Increase the reference count of a supplied page by 1. // */ func _sqlite3PcacheRef(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TPgHdr)(unsafe.Pointer(p)).FnRef++ (*TPCache)(unsafe.Pointer((*TPgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum++ } @@ -32019,9 +30545,7 @@ func _sqlite3PcacheRef(tls *libc.TLS, p uintptr) { // ** page pointed to by p is invalid. // */ func _sqlite3PcacheDrop(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_DIRTY) != 0 { + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_DIRTY) != 0 { _pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) } (*TPCache)(unsafe.Pointer((*TPgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum-- @@ -32037,19 +30561,14 @@ func _sqlite3PcacheDrop(tls *libc.TLS, p uintptr) { func _sqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { var p1, p2 uintptr _, _ = p1, p2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TPgHdr)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(PGHDR_CLEAN)|libc.Int32FromInt32(PGHDR_DONT_WRITE)) != 0 { /*OPTIMIZATION-IF-FALSE*/ + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(PGHDR_CLEAN)|libc.Int32FromInt32(PGHDR_DONT_WRITE)) != 0 { /*OPTIMIZATION-IF-FALSE*/ p1 = p + 28 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(PGHDR_DONT_WRITE)) - if int32((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_CLEAN) != 0 { + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_CLEAN) != 0 { p2 = p + 28 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) ^ (libc.Int32FromInt32(PGHDR_DIRTY) | libc.Int32FromInt32(PGHDR_CLEAN))) - _ = libc.Int32FromInt32(0) _pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_ADD)) - _ = libc.Int32FromInt32(0) } - _ = libc.Int32FromInt32(0) } } @@ -32062,15 +30581,11 @@ func _sqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { func _sqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { var p1, p2 uintptr _, _ = p1, p2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) p1 = p + 28 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(PGHDR_DIRTY) | libc.Int32FromInt32(PGHDR_NEED_SYNC) | libc.Int32FromInt32(PGHDR_WRITEABLE))) p2 = p + 28 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(PGHDR_CLEAN)) - _ = libc.Int32FromInt32(0) if (*TPgHdr)(unsafe.Pointer(p)).FnRef == 0 { _pcacheUnpin(tls, p) } @@ -32149,22 +30664,17 @@ func _sqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno TPgno) { var pCache, pOther, pXPage uintptr _, _, _ = pCache, pOther, pXPage pCache = (*TPgHdr)(unsafe.Pointer(p)).FpCache - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOther = (*(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxFetch})))(tls, (*TPCache)(unsafe.Pointer(pCache)).FpCache, newPgno, 0) if pOther != 0 { pXPage = (*Tsqlite3_pcache_page)(unsafe.Pointer(pOther)).FpExtra - _ = libc.Int32FromInt32(0) (*TPgHdr)(unsafe.Pointer(pXPage)).FnRef++ (*TPCache)(unsafe.Pointer(pCache)).FnRefSum++ _sqlite3PcacheDrop(tls, pXPage) } (*(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxRekey})))(tls, (*TPCache)(unsafe.Pointer(pCache)).FpCache, (*TPgHdr)(unsafe.Pointer(p)).FpPage, (*TPgHdr)(unsafe.Pointer(p)).Fpgno, newPgno) (*TPgHdr)(unsafe.Pointer(p)).Fpgno = newPgno - if int32((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_DIRTY) != 0 && int32((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_NEED_SYNC) != 0 { + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_DIRTY) != 0 && libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_NEED_SYNC) != 0 { _pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) - _ = libc.Int32FromInt32(0) } } @@ -32193,9 +30703,7 @@ func _sqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno TPgno) { ** after sqlite3PcacheCleanAll(). So if there are dirty pages, ** it must be that pgno==0. */ - _ = libc.Int32FromInt32(0) if (*TPgHdr)(unsafe.Pointer(p)).Fpgno > pgno { - _ = libc.Int32FromInt32(0) _sqlite3PcacheMakeClean(tls, p) } goto _1 @@ -32207,7 +30715,7 @@ func _sqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno TPgno) { pPage1 = (*(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxFetch})))(tls, (*TPCache)(unsafe.Pointer(pCache)).FpCache, uint32(1), 0) if pPage1 != 0 { /* Page 1 is always available in cache, because ** pCache->nRefSum>0 */ - libc.Xmemset(tls, (*Tsqlite3_pcache_page)(unsafe.Pointer(pPage1)).FpBuf, 0, uint32((*TPCache)(unsafe.Pointer(pCache)).FszPage)) + libc.Xmemset(tls, (*Tsqlite3_pcache_page)(unsafe.Pointer(pPage1)).FpBuf, 0, libc.Uint32FromInt32((*TPCache)(unsafe.Pointer(pCache)).FszPage)) pgno = uint32(1) } } @@ -32221,7 +30729,6 @@ func _sqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno TPgno) { // ** Close a cache. // */ func _sqlite3PcacheClose(tls *libc.TLS, pCache uintptr) { - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxDestroy})))(tls, (*TPCache)(unsafe.Pointer(pCache)).FpCache) } @@ -32247,7 +30754,6 @@ func _pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) (r uintptr) { var _ /* result at bp+0 */ TPgHdr _ = pTail pTail = bp - _ = libc.Int32FromInt32(0) for { if (*TPgHdr)(unsafe.Pointer(pA)).Fpgno < (*TPgHdr)(unsafe.Pointer(pB)).Fpgno { (*TPgHdr)(unsafe.Pointer(pTail)).FpDirty = pA @@ -32392,7 +30898,6 @@ func _sqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) (r Ti64) { // ** Return the total number of pages in the cache. // */ func _sqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxPagecount})))(tls, (*TPCache)(unsafe.Pointer(pCache)).FpCache) } @@ -32402,7 +30907,6 @@ func _sqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) (r int32) { // ** Set the suggested cache-size value. // */ func _sqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { - _ = libc.Int32FromInt32(0) (*TPCache)(unsafe.Pointer(pCache)).FszCache = mxPage (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxCachesize})))(tls, (*TPCache)(unsafe.Pointer(pCache)).FpCache, _numberOfCachePages(tls, pCache)) } @@ -32417,7 +30921,6 @@ func _sqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { func _sqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) (r int32) { var res int32 _ = res - _ = libc.Int32FromInt32(0) if mxPage != 0 { if mxPage < 0 { mxPage = int32(int64(-libc.Int32FromInt32(1024)) * int64(mxPage) / int64((*TPCache)(unsafe.Pointer(p)).FszPage+(*TPCache)(unsafe.Pointer(p)).FszExtra)) @@ -32437,7 +30940,6 @@ func _sqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) (r int32 // ** Free up as much memory as possible from the page cache. // */ func _sqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) { - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fpcache2.FxShrink})))(tls, (*TPCache)(unsafe.Pointer(pCache)).FpCache) } @@ -32448,7 +30950,7 @@ func _sqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) { // ** in the page-cache hierarchy. // */ func _sqlite3HeaderSizePcache(tls *libc.TLS) (r int32) { - return int32((libc.Uint32FromInt64(48) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + return libc.Int32FromUint32((libc.Uint32FromInt64(48) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) } // C documentation @@ -32867,10 +31369,10 @@ func _pcache1InitBulk(tls *libc.TLS, pCache uintptr) (r int32) { } else { szBulk = int64(-int32(1024)) * int64(_pcache1_g.FnInitPage) } - if szBulk > int64((*TPCache1)(unsafe.Pointer(pCache)).FszAlloc)*int64((*TPCache1)(unsafe.Pointer(pCache)).FnMax) { - szBulk = int64((*TPCache1)(unsafe.Pointer(pCache)).FszAlloc) * int64((*TPCache1)(unsafe.Pointer(pCache)).FnMax) + if szBulk > int64((*TPCache1)(unsafe.Pointer(pCache)).FszAlloc)*libc.Int64FromUint32((*TPCache1)(unsafe.Pointer(pCache)).FnMax) { + szBulk = int64((*TPCache1)(unsafe.Pointer(pCache)).FszAlloc) * libc.Int64FromUint32((*TPCache1)(unsafe.Pointer(pCache)).FnMax) } - v1 = _sqlite3Malloc(tls, uint64(szBulk)) + v1 = _sqlite3Malloc(tls, libc.Uint64FromInt64(szBulk)) (*TPCache1)(unsafe.Pointer(pCache)).FpBulk = v1 zBulk = v1 _sqlite3EndBenignMalloc(tls) @@ -32915,7 +31417,6 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { var sz int32 _, _ = p, sz p = uintptr(0) - _ = libc.Int32FromInt32(0) if nByte <= _pcache1_g.FszSlot { Xsqlite3_mutex_enter(tls, _pcache1_g.Fmutex) p = _pcache1_g.FpFree @@ -32923,7 +31424,6 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) - _ = libc.Int32FromInt32(0) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -32933,7 +31433,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { /* Memory is not available in the SQLITE_CONFIG_PAGECACHE pool. Get ** it from sqlite3Malloc instead. */ - p = _sqlite3Malloc(tls, uint64(nByte)) + p = _sqlite3Malloc(tls, libc.Uint64FromInt32(nByte)) if p != 0 { sz = _sqlite3MallocSize(tls, p) Xsqlite3_mutex_enter(tls, _pcache1_g.Fmutex) @@ -32965,10 +31465,8 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { - _ = libc.Int32FromInt32(0) nFreed = 0 nFreed = _sqlite3MallocSize(tls, p) Xsqlite3_mutex_enter(tls, _pcache1_g.Fmutex) @@ -32989,7 +31487,6 @@ func _pcache1MemSize(tls *libc.TLS, p uintptr) (r int32) { if p >= _pcache1_g.FpStart && p < _pcache1_g.FpEnd { return _pcache1_g.FszSlot } else { - _ = libc.Int32FromInt32(0) iSize = _sqlite3MallocSize(tls, p) return iSize } @@ -33005,9 +31502,7 @@ func _pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) (r uin var p, pPg uintptr _, _ = p, pPg p = uintptr(0) - _ = libc.Int32FromInt32(0) if (*TPCache1)(unsafe.Pointer(pCache)).FpFree != 0 || (*TPCache1)(unsafe.Pointer(pCache)).FnPage == uint32(0) && _pcache1InitBulk(tls, pCache) != 0 { - _ = libc.Int32FromInt32(0) p = (*TPCache1)(unsafe.Pointer(pCache)).FpFree (*TPCache1)(unsafe.Pointer(pCache)).FpFree = (*TPgHdr1)(unsafe.Pointer(p)).FpNext (*TPgHdr1)(unsafe.Pointer(p)).FpNext = uintptr(0) @@ -33015,8 +31510,6 @@ func _pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) (r uin /* The group mutex must be released before pcache1Alloc() is called. This ** is because it might call sqlite3_release_memory(), which assumes that ** this mutex is not held. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) if benignMalloc != 0 { _sqlite3BeginBenignMalloc(tls) @@ -33048,9 +31541,7 @@ func _pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) (r uin func _pcache1FreePage(tls *libc.TLS, p uintptr) { var pCache uintptr _ = pCache - _ = libc.Int32FromInt32(0) pCache = (*TPgHdr1)(unsafe.Pointer(p)).FpCache - _ = libc.Int32FromInt32(0) if (*TPgHdr1)(unsafe.Pointer(p)).FisBulkLocal != 0 { (*TPgHdr1)(unsafe.Pointer(p)).FpNext = (*TPCache1)(unsafe.Pointer(pCache)).FpFree (*TPCache1)(unsafe.Pointer(pCache)).FpFree = p @@ -33068,7 +31559,7 @@ func _pcache1FreePage(tls *libc.TLS, p uintptr) { // ** exists, this function falls back to sqlite3Malloc(). // */ func _sqlite3PageMalloc(tls *libc.TLS, sz int32) (r uintptr) { - _ = libc.Int32FromInt32(0) /* These allocations are never very large */ + /* These allocations are never very large */ return _pcache1Alloc(tls, sz) } @@ -33123,7 +31614,6 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr var h, i, nNew uint32 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - _ = libc.Int32FromInt32(0) nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) if nNew < uint32(256) { nNew = uint32(256) @@ -33176,18 +31666,11 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { // ** The PGroup mutex must be held when this function is called. // */ func _pcache1PinPage(tls *libc.TLS, pPage uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TPgHdr1)(unsafe.Pointer((*TPgHdr1)(unsafe.Pointer(pPage)).FpLruPrev)).FpLruNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpLruNext (*TPgHdr1)(unsafe.Pointer((*TPgHdr1)(unsafe.Pointer(pPage)).FpLruNext)).FpLruPrev = (*TPgHdr1)(unsafe.Pointer(pPage)).FpLruPrev (*TPgHdr1)(unsafe.Pointer(pPage)).FpLruNext = uintptr(0) /* pPage->pLruPrev = 0; ** No need to clear pLruPrev as it is never accessed if pLruNext is 0 */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TPCache1)(unsafe.Pointer((*TPgHdr1)(unsafe.Pointer(pPage)).FpCache)).FnRecyclable-- return pPage } @@ -33206,7 +31689,6 @@ func _pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { var pCache, pp uintptr _, _, _ = h, pCache, pp pCache = (*TPgHdr1)(unsafe.Pointer(pPage)).FpCache - _ = libc.Int32FromInt32(0) h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % (*TPCache1)(unsafe.Pointer(pCache)).FnHash pp = (*TPCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4 for { @@ -33236,17 +31718,14 @@ func _pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { var v2 bool _, _, _, _, _ = p, pGroup, v1, v2, v3 pGroup = (*TPCache1)(unsafe.Pointer(pCache)).FpGroup - _ = libc.Int32FromInt32(0) for { if v2 = (*TPGroup)(unsafe.Pointer(pGroup)).FnPurgeable > (*TPGroup)(unsafe.Pointer(pGroup)).FnMaxPage; v2 { v1 = (*TPGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev p = v1 } - if !(v2 && int32((*TPgHdr1)(unsafe.Pointer(v1)).FisAnchor) == 0) { + if !(v2 && libc.Int32FromUint16((*TPgHdr1)(unsafe.Pointer(v1)).FisAnchor) == 0) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _pcache1PinPage(tls, p) _pcache1RemoveFromHash(tls, p, int32(1)) } @@ -33271,9 +31750,6 @@ func _pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { var h, iStop uint32 var pPage, pp, v2 uintptr _, _, _, _, _ = h, iStop, pPage, pp, v2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TPCache1)(unsafe.Pointer(pCache)).FiMaxKey-iLimit < (*TPCache1)(unsafe.Pointer(pCache)).FnHash { /* If we are just shaving the last few pages off the end of the ** cache, then there is no point in scanning the entire hash table. @@ -33289,7 +31765,6 @@ func _pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { iStop = h - uint32(1) } for { - _ = libc.Int32FromInt32(0) pp = (*TPCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4 for { v2 = *(*uintptr)(unsafe.Pointer(pp)) @@ -33315,7 +31790,6 @@ func _pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { goto _1 _1: } - _ = libc.Int32FromInt32(0) } /******************************************************************************/ @@ -33328,7 +31802,6 @@ func _pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { // */ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _ = NotUsed - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_pcache1_g)), 0, uint32(100)) /* ** The pcache1.separateCache variable is true if each PCache has its own @@ -33368,7 +31841,6 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { // */ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { _ = NotUsed - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_pcache1_g)), 0, uint32(100)) } @@ -33383,10 +31855,8 @@ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32 var pCache, pGroup, v1 uintptr var sz, v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - sz = int32(uint32(68) + uint32(52)*uint32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, uint64(sz)) + sz = libc.Int32FromUint32(uint32(68) + uint32(52)*libc.Uint32FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*68 @@ -33395,7 +31865,7 @@ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32 pGroup = uintptr(unsafe.Pointer(&_pcache1_g)) } Xsqlite3_mutex_enter(tls, (*TPGroup)(unsafe.Pointer(pGroup)).Fmutex) - if int32((*TPGroup)(unsafe.Pointer(pGroup)).Flru.FisAnchor) == 0 { + if libc.Int32FromUint16((*TPGroup)(unsafe.Pointer(pGroup)).Flru.FisAnchor) == 0 { (*TPGroup)(unsafe.Pointer(pGroup)).Flru.FisAnchor = uint16(1) v1 = pGroup + 20 (*TPGroup)(unsafe.Pointer(pGroup)).Flru.FpLruNext = v1 @@ -33404,7 +31874,7 @@ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32 (*TPCache1)(unsafe.Pointer(pCache)).FpGroup = pGroup (*TPCache1)(unsafe.Pointer(pCache)).FszPage = szPage (*TPCache1)(unsafe.Pointer(pCache)).FszExtra = szExtra - (*TPCache1)(unsafe.Pointer(pCache)).FszAlloc = int32(uint32(szPage+szExtra) + (libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) + (*TPCache1)(unsafe.Pointer(pCache)).FszAlloc = libc.Int32FromUint32(libc.Uint32FromInt32(szPage+szExtra) + (libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) if bPurgeable != 0 { v2 = int32(1) } else { @@ -33441,11 +31911,10 @@ func _pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { var pCache, pGroup uintptr _, _, _ = n, pCache, pGroup pCache = p - _ = libc.Int32FromInt32(0) if (*TPCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 { pGroup = (*TPCache1)(unsafe.Pointer(pCache)).FpGroup Xsqlite3_mutex_enter(tls, (*TPGroup)(unsafe.Pointer(pGroup)).Fmutex) - n = uint32(nMax) + n = libc.Uint32FromInt32(nMax) if n > uint32(0x7fff0000)-(*TPGroup)(unsafe.Pointer(pGroup)).FnMaxPage+(*TPCache1)(unsafe.Pointer(pCache)).FnMax { n = uint32(0x7fff0000) - (*TPGroup)(unsafe.Pointer(pGroup)).FnMaxPage + (*TPCache1)(unsafe.Pointer(pCache)).FnMax } @@ -33492,7 +31961,7 @@ func _pcache1Pagecount(tls *libc.TLS, p uintptr) (r int32) { _, _ = n, pCache pCache = p Xsqlite3_mutex_enter(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) - n = int32((*TPCache1)(unsafe.Pointer(pCache)).FnPage) + n = libc.Int32FromUint32((*TPCache1)(unsafe.Pointer(pCache)).FnPage) Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) return n } @@ -33514,21 +31983,16 @@ func _pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag pGroup = (*TPCache1)(unsafe.Pointer(pCache)).FpGroup pPage = uintptr(0) /* Step 3: Abort if createFlag is 1 but the cache is nearly full */ - _ = libc.Int32FromInt32(0) nPinned = (*TPCache1)(unsafe.Pointer(pCache)).FnPage - (*TPCache1)(unsafe.Pointer(pCache)).FnRecyclable - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if createFlag == int32(1) && (nPinned >= (*TPGroup)(unsafe.Pointer(pGroup)).FmxPinned || nPinned >= (*TPCache1)(unsafe.Pointer(pCache)).Fn90pct || _pcache1UnderMemoryPressure(tls, pCache) != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FnRecyclable < nPinned) { return uintptr(0) } if (*TPCache1)(unsafe.Pointer(pCache)).FnPage >= (*TPCache1)(unsafe.Pointer(pCache)).FnHash { _pcache1ResizeHash(tls, pCache) } - _ = libc.Int32FromInt32(0) /* Step 4. Try to recycle a page. */ if (*TPCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 && !((*TPgHdr1)(unsafe.Pointer((*TPGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev)).FisAnchor != 0) && ((*TPCache1)(unsafe.Pointer(pCache)).FnPage+uint32(1) >= (*TPCache1)(unsafe.Pointer(pCache)).FnMax || _pcache1UnderMemoryPressure(tls, pCache) != 0) { pPage = (*TPGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev - _ = libc.Int32FromInt32(0) _pcache1RemoveFromHash(tls, pPage, 0) _pcache1PinPage(tls, pPage) pOther = (*TPgHdr1)(unsafe.Pointer(pPage)).FpCache @@ -33536,7 +32000,7 @@ func _pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag _pcache1FreePage(tls, pPage) pPage = uintptr(0) } else { - *(*uint32)(unsafe.Pointer(pGroup + 16)) -= uint32((*TPCache1)(unsafe.Pointer(pOther)).FbPurgeable - (*TPCache1)(unsafe.Pointer(pCache)).FbPurgeable) + *(*uint32)(unsafe.Pointer(pGroup + 16)) -= libc.Uint32FromInt32((*TPCache1)(unsafe.Pointer(pOther)).FbPurgeable - (*TPCache1)(unsafe.Pointer(pCache)).FbPurgeable) } } /* Step 5. If a usable page buffer has still not been found, @@ -33661,7 +32125,6 @@ func _pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag in pCache = p Xsqlite3_mutex_enter(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) pPage = _pcache1FetchNoMutex(tls, p, iKey, createFlag) - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) return pPage } @@ -33670,12 +32133,6 @@ func _pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) (r u var pCache uintptr _ = pCache pCache = p - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex != 0 { return _pcache1FetchWithMutex(tls, p, iKey, createFlag) } else { @@ -33697,13 +32154,10 @@ func _pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { pCache = p pPage = pPg pGroup = (*TPCache1)(unsafe.Pointer(pCache)).FpGroup - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*TPGroup)(unsafe.Pointer(pGroup)).Fmutex) /* It is an error to call this function if the page is already ** part of the PGroup LRU list. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if reuseUnlikely != 0 || (*TPGroup)(unsafe.Pointer(pGroup)).FnPurgeable > (*TPGroup)(unsafe.Pointer(pGroup)).FnMaxPage { _pcache1RemoveFromHash(tls, pPage, int32(1)) } else { @@ -33730,18 +32184,16 @@ func _pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint _, _, _, _, _ = hNew, hOld, pCache, pPage, pp pCache = p pPage = pPg - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The page number really is changing */ + /* The page number really is changing */ Xsqlite3_mutex_enter(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) - _ = libc.Int32FromInt32(0) /* pPg really is iOld */ + /* pPg really is iOld */ hOld = iOld % (*TPCache1)(unsafe.Pointer(pCache)).FnHash pp = (*TPCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(hOld)*4 for *(*uintptr)(unsafe.Pointer(pp)) != pPage { pp = *(*uintptr)(unsafe.Pointer(pp)) + 16 } *(*uintptr)(unsafe.Pointer(pp)) = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext - _ = libc.Int32FromInt32(0) /* iNew not in cache */ + /* iNew not in cache */ hNew = iNew % (*TPCache1)(unsafe.Pointer(pCache)).FnHash (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey = iNew (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(hNew)*4)) @@ -33785,14 +32237,11 @@ func _pcache1Destroy(tls *libc.TLS, p uintptr) { _, _ = pCache, pGroup pCache = p pGroup = (*TPCache1)(unsafe.Pointer(pCache)).FpGroup - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*TPGroup)(unsafe.Pointer(pGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(pCache)).FnPage != 0 { _pcache1TruncateUnsafe(tls, pCache, uint32(0)) } - _ = libc.Int32FromInt32(0) *(*uint32)(unsafe.Pointer(pGroup + 4)) -= (*TPCache1)(unsafe.Pointer(pCache)).FnMax - _ = libc.Int32FromInt32(0) *(*uint32)(unsafe.Pointer(pGroup + 8)) -= (*TPCache1)(unsafe.Pointer(pCache)).FnMin (*TPGroup)(unsafe.Pointer(pGroup)).FmxPinned = (*TPGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10) - (*TPGroup)(unsafe.Pointer(pGroup)).FnMinPage _pcache1EnforceMaxPage(tls, pCache) @@ -33840,7 +32289,7 @@ func init() { // ** Return the size of the header on each page of this PCACHE implementation. // */ func _sqlite3HeaderSizePcache1(tls *libc.TLS) (r int32) { - return int32((libc.Uint32FromInt64(32) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + return libc.Int32FromUint32((libc.Uint32FromInt64(32) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) } // C documentation @@ -33870,8 +32319,6 @@ func _sqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) (r int32) { var v2 bool _, _, _, _ = nFree, p, v1, v2 nFree = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _sqlite3Config.FpPage == uintptr(0) { Xsqlite3_mutex_enter(tls, (*TPGroup)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pcache1_g)))).Fmutex) for { @@ -33879,11 +32326,10 @@ func _sqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) (r int32) { v1 = _pcache1_g.Fgrp.Flru.FpLruPrev p = v1 } - if !(v2 && v1 != uintptr(0) && int32((*TPgHdr1)(unsafe.Pointer(p)).FisAnchor) == 0) { + if !(v2 && v1 != uintptr(0) && libc.Int32FromUint16((*TPgHdr1)(unsafe.Pointer(p)).FisAnchor) == 0) { break } nFree += _pcache1MemSize(tls, (*TPgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf) - _ = libc.Int32FromInt32(0) _pcache1PinPage(tls, p) _pcache1RemoveFromHash(tls, p, int32(1)) } @@ -34037,8 +32483,8 @@ func _sqlite3RowSetInit(tls *libc.TLS, db uintptr) (r uintptr) { (*TRowSet)(unsafe.Pointer(p)).FpEntry = uintptr(0) (*TRowSet)(unsafe.Pointer(p)).FpLast = uintptr(0) (*TRowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) - (*TRowSet)(unsafe.Pointer(p)).FpFresh = uintptr((libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) + p - (*TRowSet)(unsafe.Pointer(p)).FnFresh = uint16((uint32(N) - (libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) / libc.Uint32FromInt64(16)) + (*TRowSet)(unsafe.Pointer(p)).FpFresh = uintptr((libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) + p + (*TRowSet)(unsafe.Pointer(p)).FnFresh = uint16((libc.Uint32FromInt32(N) - (libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) / libc.Uint32FromInt64(16)) (*TRowSet)(unsafe.Pointer(p)).FrsFlags = uint16(ROWSET_SORTED) (*TRowSet)(unsafe.Pointer(p)).FiBatch = 0 } @@ -34101,8 +32547,7 @@ func _sqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { func _rowSetEntryAlloc(tls *libc.TLS, p uintptr) (r uintptr) { var pNew, v1, v2 uintptr _, _, _ = pNew, v1, v2 - _ = libc.Int32FromInt32(0) - if int32((*TRowSet)(unsafe.Pointer(p)).FnFresh) == 0 { + if libc.Int32FromUint16((*TRowSet)(unsafe.Pointer(p)).FnFresh) == 0 { pNew = _sqlite3DbMallocRawNN(tls, (*TRowSet)(unsafe.Pointer(p)).Fdb, uint64(1012)) if pNew == uintptr(0) { return uintptr(0) @@ -34110,7 +32555,7 @@ func _rowSetEntryAlloc(tls *libc.TLS, p uintptr) (r uintptr) { (*TRowSetChunk)(unsafe.Pointer(pNew)).FpNextChunk = (*TRowSet)(unsafe.Pointer(p)).FpChunk (*TRowSet)(unsafe.Pointer(p)).FpChunk = pNew (*TRowSet)(unsafe.Pointer(p)).FpFresh = pNew + 4 - (*TRowSet)(unsafe.Pointer(p)).FnFresh = uint16(uint32(libc.Int32FromInt32(ROWSET_ALLOCATION_SIZE)-libc.Int32FromInt32(8)) / libc.Uint32FromInt64(16)) + (*TRowSet)(unsafe.Pointer(p)).FnFresh = uint16(libc.Uint32FromInt32(libc.Int32FromInt32(ROWSET_ALLOCATION_SIZE)-libc.Int32FromInt32(8)) / libc.Uint32FromInt64(16)) } (*TRowSet)(unsafe.Pointer(p)).FnFresh-- v2 = p + 16 @@ -34131,7 +32576,6 @@ func _sqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid Ti64) { var pEntry, pLast, p1 uintptr _, _, _ = pEntry, pLast, p1 /* The last prior entry */ /* This routine is never called after sqlite3RowSetNext() */ - _ = libc.Int32FromInt32(0) pEntry = _rowSetEntryAlloc(tls, p) if pEntry == uintptr(0) { return @@ -34168,10 +32612,7 @@ func _rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) (r uintptr) { var _ /* head at bp+0 */ TRowSetEntry _, _, _ = pTail, v2, v3 pTail = bp - _ = libc.Int32FromInt32(0) for { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TRowSetEntry)(unsafe.Pointer(pA)).Fv <= (*TRowSetEntry)(unsafe.Pointer(pB)).Fv { if (*TRowSetEntry)(unsafe.Pointer(pA)).Fv < (*TRowSetEntry)(unsafe.Pointer(pB)).Fv { v2 = pA @@ -34265,7 +32706,6 @@ func _rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintp bp := tls.Alloc(16) defer tls.Free(16) var _ /* p at bp+0 */ uintptr - _ = libc.Int32FromInt32(0) if (*TRowSetEntry)(unsafe.Pointer(pIn)).FpLeft != 0 { _rowSetTreeToList(tls, (*TRowSetEntry)(unsafe.Pointer(pIn)).FpLeft, ppFirst, bp) (*TRowSetEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpRight = pIn @@ -34277,7 +32717,6 @@ func _rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintp } else { *(*uintptr)(unsafe.Pointer(ppLast)) = pIn } - _ = libc.Int32FromInt32(0) } // C documentation @@ -34339,7 +32778,6 @@ func _rowSetListToTree(tls *libc.TLS, _pList uintptr) (r uintptr) { var iDepth int32 var p, pLeft, v1 uintptr _, _, _, _ = iDepth, p, pLeft, v1 /* Left subtree */ - _ = libc.Int32FromInt32(0) p = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = (*TRowSetEntry)(unsafe.Pointer(p)).FpRight v1 = libc.UintptrFromInt32(0) @@ -34381,11 +32819,10 @@ func _rowSetListToTree(tls *libc.TLS, _pList uintptr) (r uintptr) { func _sqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) (r int32) { var p1 uintptr _ = p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Cannot be used with sqlite3RowSetText() */ + /* Cannot be used with sqlite3RowSetText() */ /* Merge the forest into a single sorted list on first call */ - if int32((*TRowSet)(unsafe.Pointer(p)).FrsFlags)&int32(ROWSET_NEXT) == 0 { /*OPTIMIZATION-IF-FALSE*/ - if int32((*TRowSet)(unsafe.Pointer(p)).FrsFlags)&int32(ROWSET_SORTED) == 0 { /*OPTIMIZATION-IF-FALSE*/ + if libc.Int32FromUint16((*TRowSet)(unsafe.Pointer(p)).FrsFlags)&int32(ROWSET_NEXT) == 0 { /*OPTIMIZATION-IF-FALSE*/ + if libc.Int32FromUint16((*TRowSet)(unsafe.Pointer(p)).FrsFlags)&int32(ROWSET_SORTED) == 0 { /*OPTIMIZATION-IF-FALSE*/ (*TRowSet)(unsafe.Pointer(p)).FpEntry = _rowSetEntrySort(tls, (*TRowSet)(unsafe.Pointer(p)).FpEntry) } p1 = p + 26 @@ -34424,7 +32861,6 @@ func _sqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Tsq var _ /* pTail at bp+4 */ uintptr _, _, _, _, _ = p, pTree, ppPrevTree, v2, p3 /* This routine is never called after sqlite3RowSetNext() */ - _ = libc.Int32FromInt32(0) /* Sort entries into the forest on the first test of a new batch. ** To save unnecessary work, only do this when the batch number changes. */ @@ -34432,7 +32868,7 @@ func _sqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Tsq p = (*TRowSet)(unsafe.Pointer(pRowSet)).FpEntry if p != 0 { ppPrevTree = pRowSet + 20 - if int32((*TRowSet)(unsafe.Pointer(pRowSet)).FrsFlags)&int32(ROWSET_SORTED) == 0 { /*OPTIMIZATION-IF-FALSE*/ + if libc.Int32FromUint16((*TRowSet)(unsafe.Pointer(pRowSet)).FrsFlags)&int32(ROWSET_SORTED) == 0 { /*OPTIMIZATION-IF-FALSE*/ /* Only sort the current set of entries if they need it */ p = _rowSetEntrySort(tls, p) } @@ -35467,19 +33903,15 @@ func _pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) (r int32) { var rc, v1 int32 _, _ = rc, v1 rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) { - _ = libc.Int32FromInt32(0) if (*TPager)(unsafe.Pointer(pPager)).FnoLock != 0 { v1 = SQLITE_OK } else { v1 = _sqlite3OsUnlock(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, eLock) } rc = v1 - if int32((*TPager)(unsafe.Pointer(pPager)).FeLock) != libc.Int32FromInt32(EXCLUSIVE_LOCK)+libc.Int32FromInt32(1) { - (*TPager)(unsafe.Pointer(pPager)).FeLock = uint8(eLock) + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeLock) != libc.Int32FromInt32(EXCLUSIVE_LOCK)+libc.Int32FromInt32(1) { + (*TPager)(unsafe.Pointer(pPager)).FeLock = libc.Uint8FromInt32(eLock) } } (*TPager)(unsafe.Pointer(pPager)).FchangeCountDone = (*TPager)(unsafe.Pointer(pPager)).FtempFile /* ticket fb3b3024ea238d5c */ @@ -35502,16 +33934,15 @@ func _pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) (r int32) { var rc, v1 int32 _, _ = rc, v1 rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - if int32((*TPager)(unsafe.Pointer(pPager)).FeLock) < eLock || int32((*TPager)(unsafe.Pointer(pPager)).FeLock) == libc.Int32FromInt32(EXCLUSIVE_LOCK)+libc.Int32FromInt32(1) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeLock) < eLock || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeLock) == libc.Int32FromInt32(EXCLUSIVE_LOCK)+libc.Int32FromInt32(1) { if (*TPager)(unsafe.Pointer(pPager)).FnoLock != 0 { v1 = SQLITE_OK } else { v1 = _sqlite3OsLock(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, eLock) } rc = v1 - if rc == SQLITE_OK && (int32((*TPager)(unsafe.Pointer(pPager)).FeLock) != libc.Int32FromInt32(EXCLUSIVE_LOCK)+libc.Int32FromInt32(1) || eLock == int32(EXCLUSIVE_LOCK)) { - (*TPager)(unsafe.Pointer(pPager)).FeLock = uint8(eLock) + if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeLock) != libc.Int32FromInt32(EXCLUSIVE_LOCK)+libc.Int32FromInt32(1) || eLock == int32(EXCLUSIVE_LOCK)) { + (*TPager)(unsafe.Pointer(pPager)).FeLock = libc.Uint8FromInt32(eLock) } } return rc @@ -35539,7 +33970,6 @@ func _pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) (r int32) { // ** If neither optimization can be used, 0 is returned. // */ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { - _ = libc.Int32FromInt32(0) _ = pPager return 0 } @@ -35595,7 +34025,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || int64(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -35604,7 +34034,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 rc = v6 } if v9 = v7 || SQLITE_OK != v6 || libc.Xmemcmp(tls, bp+24, uintptr(unsafe.Pointer(&_aJournalMagic)), uint32(8)) != 0; !v9 { - v8 = _sqlite3OsRead(tls, pJrnl, zSuper, int32(*(*Tu32)(unsafe.Pointer(bp))), *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16)-int64(*(*Tu32)(unsafe.Pointer(bp)))) + v8 = _sqlite3OsRead(tls, pJrnl, zSuper, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))), *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16)-libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp)))) rc = v8 } if v9 || SQLITE_OK != v8 { @@ -35616,7 +34046,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 if !(u < *(*Tu32)(unsafe.Pointer(bp))) { break } - *(*Tu32)(unsafe.Pointer(bp + 16)) -= uint32(*(*int8)(unsafe.Pointer(zSuper + uintptr(u)))) + *(*Tu32)(unsafe.Pointer(bp + 16)) -= libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(zSuper + uintptr(u)))) goto _10 _10: ; @@ -35658,11 +34088,8 @@ func _journalHdrOffset(tls *libc.TLS, pPager uintptr) (r Ti64) { offset = 0 c = (*TPager)(unsafe.Pointer(pPager)).FjournalOff if c != 0 { - offset = ((c-int64(1))/int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize) + int64(1)) * int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize) + offset = ((c-int64(1))/libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize) + int64(1)) * libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return offset } @@ -35697,8 +34124,6 @@ func _zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) (r int32) var _ /* sz at bp+0 */ Ti64 _, _ = iLimit, rc rc = SQLITE_OK /* Return code */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TPager)(unsafe.Pointer(pPager)).FjournalOff != 0 { iLimit = (*TPager)(unsafe.Pointer(pPager)).FjournalSizeLimit /* Local cache of jsl */ if doTruncate != 0 || iLimit == 0 { @@ -35707,7 +34132,7 @@ func _zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) (r int32) rc = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&_zeroHdr)), int32(28), 0) } if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FnoSync != 0) { - rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, int32(SQLITE_SYNC_DATAONLY)|int32((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) + rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, int32(SQLITE_SYNC_DATAONLY)|libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) } /* At this point the transaction is committed but the write lock ** is still held on the file. If there is a size limit configured for @@ -35750,10 +34175,10 @@ func _writeJournalHdr(tls *libc.TLS, pPager uintptr) (r int32) { var zHeader uintptr var v2 Ti64 _, _, _, _, _, _ = ii, nHeader, nWrite, rc, zHeader, v2 - rc = SQLITE_OK /* Return code */ - zHeader = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace /* Temporary space used to build header */ - nHeader = uint32((*TPager)(unsafe.Pointer(pPager)).FpageSize) /* Loop counter */ - _ = libc.Int32FromInt32(0) /* Journal file must be open. */ + rc = SQLITE_OK /* Return code */ + zHeader = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace /* Temporary space used to build header */ + nHeader = libc.Uint32FromInt64((*TPager)(unsafe.Pointer(pPager)).FpageSize) /* Loop counter */ + /* Journal file must be open. */ if nHeader > (*TPager)(unsafe.Pointer(pPager)).FsectorSize { nHeader = (*TPager)(unsafe.Pointer(pPager)).FsectorSize } @@ -35797,15 +34222,14 @@ func _writeJournalHdr(tls *libc.TLS, pPager uintptr) (r int32) { ** * When the SQLITE_IOCAP_SAFE_APPEND flag is set. This guarantees ** that garbage data is never appended to the journal file. */ - _ = libc.Int32FromInt32(0) - if (*TPager)(unsafe.Pointer(pPager)).FnoSync != 0 || int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) || _sqlite3OsDeviceCharacteristics(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SAFE_APPEND) != 0 { + if (*TPager)(unsafe.Pointer(pPager)).FnoSync != 0 || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) || _sqlite3OsDeviceCharacteristics(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SAFE_APPEND) != 0 { libc.Xmemcpy(tls, zHeader, uintptr(unsafe.Pointer(&_aJournalMagic)), uint32(8)) _sqlite3Put4byte(tls, zHeader+uintptr(8), uint32(0xffffffff)) } else { libc.Xmemset(tls, zHeader, 0, libc.Uint32FromInt64(8)+libc.Uint32FromInt32(4)) } /* The random check-hash initializer */ - if int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_MEMORY) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_MEMORY) { Xsqlite3_randomness(tls, int32(4), pPager+52) } _sqlite3Put4byte(tls, zHeader+uintptr(libc.Uint32FromInt64(8)+libc.Uint32FromInt32(4)), (*TPager)(unsafe.Pointer(pPager)).FcksumInit) @@ -35814,7 +34238,7 @@ func _writeJournalHdr(tls *libc.TLS, pPager uintptr) (r int32) { /* The assumed sector size for this process */ _sqlite3Put4byte(tls, zHeader+uintptr(libc.Uint32FromInt64(8)+libc.Uint32FromInt32(12)), (*TPager)(unsafe.Pointer(pPager)).FsectorSize) /* The page size */ - _sqlite3Put4byte(tls, zHeader+uintptr(libc.Uint32FromInt64(8)+libc.Uint32FromInt32(16)), uint32((*TPager)(unsafe.Pointer(pPager)).FpageSize)) + _sqlite3Put4byte(tls, zHeader+uintptr(libc.Uint32FromInt64(8)+libc.Uint32FromInt32(16)), libc.Uint32FromInt64((*TPager)(unsafe.Pointer(pPager)).FpageSize)) /* Initializing the tail of the buffer is not necessary. Everything ** works find if the following memset() is omitted. But initializing ** the memory prevents valgrind from complaining, so we are willing to @@ -35843,9 +34267,8 @@ func _writeJournalHdr(tls *libc.TLS, pPager uintptr) (r int32) { if !(rc == SQLITE_OK && nWrite < (*TPager)(unsafe.Pointer(pPager)).FsectorSize) { break } - rc = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zHeader, int32(nHeader), (*TPager)(unsafe.Pointer(pPager)).FjournalOff) - _ = libc.Int32FromInt32(0) - *(*Ti64)(unsafe.Pointer(pPager + 76)) += int64(nHeader) + rc = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zHeader, libc.Int32FromUint32(nHeader), (*TPager)(unsafe.Pointer(pPager)).FjournalOff) + *(*Ti64)(unsafe.Pointer(pPager + 76)) += libc.Int64FromUint32(nHeader) goto _3 _3: ; @@ -35883,13 +34306,13 @@ func _readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize Ti6 var _ /* iPageSize at bp+8 */ Tu32 var _ /* iSectorSize at bp+12 */ Tu32 _, _, _, _, _, _, _, _, _, _ = iHdrOff, rc, v1, v2, v3, v4, v5, v6, v7, v8 /* Offset of journal header being read */ - _ = libc.Int32FromInt32(0) /* Journal file must be open. */ + /* Journal file must be open. */ /* Advance Pager.journalOff to the start of the next sector. If the ** journal file is too small for there to be a header stored at this ** point, return SQLITE_DONE. */ (*TPager)(unsafe.Pointer(pPager)).FjournalOff = _journalHdrOffset(tls, pPager) - if (*TPager)(unsafe.Pointer(pPager)).FjournalOff+int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize) > journalSize { + if (*TPager)(unsafe.Pointer(pPager)).FjournalOff+libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize) > journalSize { return int32(SQLITE_DONE) } iHdrOff = (*TPager)(unsafe.Pointer(pPager)).FjournalOff @@ -35940,7 +34363,7 @@ func _readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize Ti6 ** variable is already set to the correct page size. */ if *(*Tu32)(unsafe.Pointer(bp + 8)) == uint32(0) { - *(*Tu32)(unsafe.Pointer(bp + 8)) = uint32((*TPager)(unsafe.Pointer(pPager)).FpageSize) + *(*Tu32)(unsafe.Pointer(bp + 8)) = libc.Uint32FromInt64((*TPager)(unsafe.Pointer(pPager)).FpageSize) } /* Check that the values read from the page-size and sector-size fields ** are within range. To be 'in range', both values need to be a power @@ -35968,7 +34391,7 @@ func _readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize Ti6 */ (*TPager)(unsafe.Pointer(pPager)).FsectorSize = *(*Tu32)(unsafe.Pointer(bp + 12)) } - *(*Ti64)(unsafe.Pointer(pPager + 76)) += int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize) + *(*Ti64)(unsafe.Pointer(pPager + 76)) += libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize) return rc } @@ -36003,20 +34426,17 @@ func _writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) var _ /* jrnlSize at bp+0 */ Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cksum, iHdrOff, nSuper, rc, v10, v11, v2, v3, v4, v5, v6, v7, v8, v9 /* Size of journal file on disk */ cksum = uint32(0) /* Checksum of string zSuper */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if !(zSuper != 0) || int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) || !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != libc.UintptrFromInt32(0)) { + if !(zSuper != 0) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) || !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != libc.UintptrFromInt32(0)) { return SQLITE_OK } (*TPager)(unsafe.Pointer(pPager)).FsetSuper = uint8(1) - _ = libc.Int32FromInt32(0) /* Calculate the length in bytes and the checksum of zSuper */ nSuper = 0 for { if !(*(*int8)(unsafe.Pointer(zSuper + uintptr(nSuper))) != 0) { break } - cksum += uint32(*(*int8)(unsafe.Pointer(zSuper + uintptr(nSuper)))) + cksum += libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(zSuper + uintptr(nSuper)))) goto _1 _1: ; @@ -36040,7 +34460,7 @@ func _writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) rc = v3 } if v6 = v4 || 0 != v3; !v6 { - v5 = _write32bits(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+int64(nSuper), uint32(nSuper)) + v5 = _write32bits(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+int64(nSuper), libc.Uint32FromInt32(nSuper)) rc = v5 } if v8 = v6 || 0 != v5; !v8 { @@ -36143,7 +34563,6 @@ func _addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int32) p = (*TPager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*48 if pgno <= (*TPagerSavepoint)(unsafe.Pointer(p)).FnOrig { rc |= _sqlite3BitvecSet(tls, (*TPagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno) - _ = libc.Int32FromInt32(0) } goto _1 _1: @@ -36175,12 +34594,10 @@ func _addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int32) func _pager_unlock(tls *libc.TLS, pPager uintptr) { var iDc, rc, v1, v2 int32 _, _, _, _ = iDc, rc, v1, v2 - _ = libc.Int32FromInt32(0) _sqlite3BitvecDestroy(tls, (*TPager)(unsafe.Pointer(pPager)).FpInJournal) (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { - _ = libc.Int32FromInt32(0) _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -36196,13 +34613,7 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { ** another connection with journal_mode=delete might delete the file ** out from under us. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if 0 == iDc&int32(SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN) || int32(1) != int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode)&int32(5) { + if 0 == iDc&int32(SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN) || int32(1) != libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode)&int32(5) { _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } /* If the pager is in the ERROR state and the call to unlock the database @@ -36211,14 +34622,13 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { ** is necessary. */ rc = _pagerUnlockDb(tls, pPager, NO_LOCK) - if rc != SQLITE_OK && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { - (*TPager)(unsafe.Pointer(pPager)).FeLock = uint8(libc.Int32FromInt32(EXCLUSIVE_LOCK) + libc.Int32FromInt32(1)) + if rc != SQLITE_OK && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + (*TPager)(unsafe.Pointer(pPager)).FeLock = libc.Uint8FromInt32(libc.Int32FromInt32(EXCLUSIVE_LOCK) + libc.Int32FromInt32(1)) } /* The pager state may be changed from PAGER_ERROR to PAGER_OPEN here ** without clearing the error code. This is intentional - the error ** code is cleared and the cache reset in the block below. */ - _ = libc.Int32FromInt32(0) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } } @@ -36227,9 +34637,8 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { ** it can safely move back to PAGER_OPEN state. This happens in both ** normal and exclusive-locking mode. */ - _ = libc.Int32FromInt32(0) if (*TPager)(unsafe.Pointer(pPager)).FerrCode != 0 { - if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 { _pager_reset(tls, pPager) (*TPager)(unsafe.Pointer(pPager)).FchangeCountDone = uint8(0) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) @@ -36239,7 +34648,7 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { } else { v2 = int32(PAGER_READER) } - (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(v2) + (*TPager)(unsafe.Pointer(pPager)).FeState = libc.Uint8FromInt32(v2) } if (*TPager)(unsafe.Pointer(pPager)).FbUseFetch != 0 { _sqlite3OsUnfetch(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, 0, uintptr(0)) @@ -36277,8 +34686,6 @@ func _pager_error(tls *libc.TLS, pPager uintptr, rc int32) (r int32) { var rc2 int32 _ = rc2 rc2 = rc & int32(0xff) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if rc2 == int32(SQLITE_FULL) || rc2 == int32(SQLITE_IOERR) { (*TPager)(unsafe.Pointer(pPager)).FerrCode = rc (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_ERROR) @@ -36306,7 +34713,7 @@ func _pager_error(tls *libc.TLS, pPager uintptr, rc int32) (r int32) { // ** cache size. // */ func _pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) (r int32) { - if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 { return int32(1) } if !(bCommit != 0) { @@ -36391,21 +34798,17 @@ func _pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bComm ** read-transaction, this function is called with eState==PAGER_READER ** and eLock==EXCLUSIVE_LOCK when the read-transaction is closed. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) < int32(PAGER_WRITER_LOCKED) && int32((*TPager)(unsafe.Pointer(pPager)).FeLock) < int32(RESERVED_LOCK) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) < int32(PAGER_WRITER_LOCKED) && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeLock) < int32(RESERVED_LOCK) { return SQLITE_OK } _releaseAllSavepoints(tls, pPager) - _ = libc.Int32FromInt32(0) if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) { - _ = libc.Int32FromInt32(0) /* Finalize the journal file. */ if _sqlite3JournalIsInMemory(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) != 0 { /* assert( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ); */ _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } else { - if int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_TRUNCATE) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_TRUNCATE) { if (*TPager)(unsafe.Pointer(pPager)).FjournalOff == 0 { rc = SQLITE_OK } else { @@ -36416,12 +34819,12 @@ func _pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bComm ** cause the last transaction to roll back. See ** https://bugzilla.mozilla.org/show_bug.cgi?id=1072773 */ - rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, int32((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) + rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) } } (*TPager)(unsafe.Pointer(pPager)).FjournalOff = 0 } else { - if int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_PERSIST) || (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_WAL) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_PERSIST) || (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_WAL) { rc = _zeroJournalHdr(tls, pPager, libc.BoolInt32(hasSuper != 0 || (*TPager)(unsafe.Pointer(pPager)).FtempFile != 0)) (*TPager)(unsafe.Pointer(pPager)).FjournalOff = 0 } else { @@ -36431,11 +34834,9 @@ func _pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bComm ** the database file, it will do so using an in-memory journal. */ bDelete = libc.BoolInt32(!((*TPager)(unsafe.Pointer(pPager)).FtempFile != 0)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) if bDelete != 0 { - rc = _sqlite3OsDelete(tls, (*TPager)(unsafe.Pointer(pPager)).FpVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, int32((*TPager)(unsafe.Pointer(pPager)).FextraSync)) + rc = _sqlite3OsDelete(tls, (*TPager)(unsafe.Pointer(pPager)).FpVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FextraSync)) } } } @@ -36458,7 +34859,6 @@ func _pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bComm ** lock held on the database file. */ rc2 = _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) - _ = libc.Int32FromInt32(0) } else { if rc == SQLITE_OK && bCommit != 0 && (*TPager)(unsafe.Pointer(pPager)).FdbFileSize > (*TPager)(unsafe.Pointer(pPager)).FdbSize { /* This branch is taken when committing a transaction in rollback-journal @@ -36467,7 +34867,6 @@ func _pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bComm ** successfully committed, but the EXCLUSIVE lock is still held on the ** file. So it is safe to truncate the database file to its minimum ** required size. */ - _ = libc.Int32FromInt32(0) rc = _pager_truncate(tls, pPager, (*TPager)(unsafe.Pointer(pPager)).FdbSize) } } @@ -36513,20 +34912,18 @@ func _pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) { var eLock Tu8 var errCode int32 _, _ = eLock, errCode - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) != int32(PAGER_ERROR) && int32((*TPager)(unsafe.Pointer(pPager)).FeState) != PAGER_OPEN { - _ = libc.Int32FromInt32(0) - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_LOCKED) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) != int32(PAGER_ERROR) && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) != PAGER_OPEN { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_LOCKED) { _sqlite3BeginBenignMalloc(tls) _sqlite3PagerRollback(tls, pPager) _sqlite3EndBenignMalloc(tls) } else { if !((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) { - _ = libc.Int32FromInt32(0) _pager_end_transaction(tls, pPager, 0, 0) } } } else { - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) && int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) && (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) && (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) { /* Special case for a ROLLBACK due to I/O error with an in-memory ** journal: We have to rollback immediately, before the journal is ** closed, because once it is closed, all content is forgotten. */ @@ -36627,21 +35024,18 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD var _ /* pPg at bp+0 */ uintptr var _ /* pgno at bp+4 */ TPgno _, _, _, _, _, _, _, _, _, _, _ = aData, isSynced, jfd, ofst, pData, rc, v1, v2, v3, p4, p5 /* True if journal page is synced */ - _ = libc.Int32FromInt32(0) /* isMainJrnl is 0 or 1 */ - _ = libc.Int32FromInt32(0) /* isSavepnt is 0 or 1 */ - _ = libc.Int32FromInt32(0) /* pDone always used on sub-journals */ - _ = libc.Int32FromInt32(0) /* pDone never used on non-savepoint */ + /* isMainJrnl is 0 or 1 */ + /* isSavepnt is 0 or 1 */ + /* pDone always used on sub-journals */ + /* pDone never used on non-savepoint */ aData = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - _ = libc.Int32FromInt32(0) /* Temp storage must have already been allocated */ - _ = libc.Int32FromInt32(0) + /* Temp storage must have already been allocated */ /* Either the state is greater than PAGER_WRITER_CACHEMOD (a transaction ** or savepoint rollback done at the request of the caller) or this is ** a hot-journal rollback. If it is a hot-journal rollback, the pager ** is in state OPEN and holds an EXCLUSIVE lock. Hot-journal rollback ** only reads from the main journal, not the sub-journal. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Read the page number and page data from the journal or sub-journal ** file. Return an error code to the caller if an IO error occurs. */ @@ -36666,7 +35060,6 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD ** detect this invalid data (with high probability) and ignore it. */ if *(*TPgno)(unsafe.Pointer(bp + 4)) == uint32(0) || *(*TPgno)(unsafe.Pointer(bp + 4)) == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - _ = libc.Int32FromInt32(0) return int32(SQLITE_DONE) } if *(*TPgno)(unsafe.Pointer(bp + 4)) > (*TPager)(unsafe.Pointer(pPager)).FdbSize || _sqlite3BitvecTest(tls, pDone, *(*TPgno)(unsafe.Pointer(bp + 4))) != 0 { @@ -36693,8 +35086,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD } /* When playing back page 1, restore the nReserve setting */ - if *(*TPgno)(unsafe.Pointer(bp + 4)) == uint32(1) && int32((*TPager)(unsafe.Pointer(pPager)).FnReserve) != int32(*(*Tu8)(unsafe.Pointer(aData + 20))) { - (*TPager)(unsafe.Pointer(pPager)).FnReserve = int16(*(*Tu8)(unsafe.Pointer(aData + 20))) + if *(*TPgno)(unsafe.Pointer(bp + 4)) == uint32(1) && int32((*TPager)(unsafe.Pointer(pPager)).FnReserve) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + 20))) { + (*TPager)(unsafe.Pointer(pPager)).FnReserve = libc.Int16FromUint8(*(*Tu8)(unsafe.Pointer(aData + 20))) } /* If the pager is in CACHEMOD state, then there must be a copy of this ** page in the pager cache. In this case just update the pager cache, @@ -36736,16 +35129,13 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD } else { *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PagerLookup(tls, pPager, *(*TPgno)(unsafe.Pointer(bp + 4))) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if isMainJrnl != 0 { isSynced = libc.BoolInt32((*TPager)(unsafe.Pointer(pPager)).FnoSync != 0 || *(*Ti64)(unsafe.Pointer(pOffset)) <= (*TPager)(unsafe.Pointer(pPager)).FjournalHdr) } else { - isSynced = libc.BoolInt32(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || 0 == int32((*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&int32(PGHDR_NEED_SYNC)) + isSynced = libc.BoolInt32(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || 0 == libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&int32(PGHDR_NEED_SYNC)) } - if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) && (int32((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) && isSynced != 0 { - ofst = int64(*(*TPgno)(unsafe.Pointer(bp + 4))-libc.Uint32FromInt32(1)) * (*TPager)(unsafe.Pointer(pPager)).FpageSize - _ = libc.Int32FromInt32(0) + if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) && isSynced != 0 { + ofst = libc.Int64FromUint32(*(*TPgno)(unsafe.Pointer(bp + 4))-libc.Uint32FromInt32(1)) * (*TPager)(unsafe.Pointer(pPager)).FpageSize /* Write the data read from the journal back into the database file. ** This is usually safe even for an encrypted database - as the data ** was encrypted before it was written to the journal file. The exception @@ -36777,12 +35167,9 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD ** and if the pager requires a journal-sync, then mark the page as ** requiring a journal-sync before it is written. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p4 = pPager + 21 *(*Tu8)(unsafe.Pointer(p4)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p4))) | libc.Int32FromInt32(SPILLFLAG_ROLLBACK)) rc = _sqlite3PagerGet(tls, pPager, *(*TPgno)(unsafe.Pointer(bp + 4)), bp, int32(1)) - _ = libc.Int32FromInt32(0) p5 = pPager + 21 *(*Tu8)(unsafe.Pointer(p5)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p5))) & ^libc.Int32FromInt32(SPILLFLAG_ROLLBACK)) if rc != SQLITE_OK { @@ -36793,7 +35180,7 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { pData = (*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpData - libc.Xmemcpy(tls, pData, aData, uint32((*TPager)(unsafe.Pointer(pPager)).FpageSize)) + libc.Xmemcpy(tls, pData, aData, libc.Uint32FromInt64((*TPager)(unsafe.Pointer(pPager)).FpageSize)) (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TPager)(unsafe.Pointer(pPager)).FxReiniter})))(tls, *(*uintptr)(unsafe.Pointer(bp))) /* It used to be that sqlite3PcacheMakeClean(pPg) was called here. But ** that call was dangerous and had no detectable benefit since the cache @@ -36869,7 +35256,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, uint64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -36891,7 +35278,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { goto delsuper_out } nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, uint64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out @@ -36923,7 +35310,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, uint32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -36944,7 +35331,6 @@ delsuper_out: Xsqlite3_free(tls, zFree) if pSuper != 0 { _sqlite3OsClose(tls, pSuper) - _ = libc.Int32FromInt32(0) Xsqlite3_free(tls, pSuper) } return rc @@ -36981,21 +35367,18 @@ func _pager_truncate(tls *libc.TLS, pPager uintptr, nPage TPgno) (r int32) { var _ /* newSize at bp+8 */ Ti64 _, _, _ = pTmp, rc, szPage rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) && (int32((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { + if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { szPage = int32((*TPager)(unsafe.Pointer(pPager)).FpageSize) - _ = libc.Int32FromInt32(0) /* TODO: Is it safe to use Pager.dbFileSize here? */ rc = _sqlite3OsFileSize(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, bp) - *(*Ti64)(unsafe.Pointer(bp + 8)) = int64(szPage) * int64(nPage) + *(*Ti64)(unsafe.Pointer(bp + 8)) = int64(szPage) * libc.Int64FromUint32(nPage) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp)) != *(*Ti64)(unsafe.Pointer(bp + 8)) { if *(*Ti64)(unsafe.Pointer(bp)) > *(*Ti64)(unsafe.Pointer(bp + 8)) { rc = _sqlite3OsTruncate(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, *(*Ti64)(unsafe.Pointer(bp + 8))) } else { if *(*Ti64)(unsafe.Pointer(bp))+int64(szPage) <= *(*Ti64)(unsafe.Pointer(bp + 8)) { pTmp = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - libc.Xmemset(tls, pTmp, 0, uint32(szPage)) + libc.Xmemset(tls, pTmp, 0, libc.Uint32FromInt32(szPage)) _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_SIZE_HINT), bp+8) rc = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, pTmp, szPage, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(szPage)) } @@ -37022,7 +35405,6 @@ func _sqlite3SectorSize(tls *libc.TLS, pFile uintptr) (r int32) { iRet = int32(512) } else { if iRet > int32(MAX_SECTOR_SIZE) { - _ = libc.Int32FromInt32(0) iRet = int32(MAX_SECTOR_SIZE) } } @@ -37055,14 +35437,13 @@ func _sqlite3SectorSize(tls *libc.TLS, pFile uintptr) (r int32) { // ** we cannot reduce the effective sector size below 512. // */ func _setSectorSize(tls *libc.TLS, pPager uintptr) { - _ = libc.Int32FromInt32(0) if (*TPager)(unsafe.Pointer(pPager)).FtempFile != 0 || _sqlite3OsDeviceCharacteristics(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_POWERSAFE_OVERWRITE) != 0 { /* Sector size doesn't matter for temporary files. Also, the file ** may not have been opened yet, in which case the OsSectorSize() ** call will segfault. */ (*TPager)(unsafe.Pointer(pPager)).FsectorSize = uint32(512) } else { - (*TPager)(unsafe.Pointer(pPager)).FsectorSize = uint32(_sqlite3SectorSize(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)) + (*TPager)(unsafe.Pointer(pPager)).FsectorSize = libc.Uint32FromInt32(_sqlite3SectorSize(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)) } } @@ -37142,11 +35523,10 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { *(*int32)(unsafe.Pointer(bp + 16)) = int32(1) /* Value returned by sqlite3OsAccess() */ zSuper = uintptr(0) /* True to reset page prior to first page rollback */ nPlayback = 0 /* Total number of pages restored from journal */ - *(*Tu32)(unsafe.Pointer(bp + 20)) = uint32((*TPager)(unsafe.Pointer(pPager)).FpageSize) + *(*Tu32)(unsafe.Pointer(bp + 20)) = libc.Uint32FromInt64((*TPager)(unsafe.Pointer(pPager)).FpageSize) /* Figure out how many records are in the journal. Abort early if ** the journal is empty. */ - _ = libc.Int32FromInt32(0) rc = _sqlite3OsFileSize(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, bp) if rc != SQLITE_OK { goto end_playback @@ -37163,7 +35543,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) if rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -37196,8 +35576,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** the value of nRec based on this assumption. */ if *(*Tu32)(unsafe.Pointer(bp + 8)) == uint32(0xffffffff) { - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(bp + 8)) = uint32(int32((*(*Ti64)(unsafe.Pointer(bp)) - int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize)) / ((*TPager)(unsafe.Pointer(pPager)).FpageSize + libc.Int64FromInt32(8)))) + *(*Tu32)(unsafe.Pointer(bp + 8)) = libc.Uint32FromInt32(int32((*(*Ti64)(unsafe.Pointer(bp)) - libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize)) / ((*TPager)(unsafe.Pointer(pPager)).FpageSize + libc.Int64FromInt32(8)))) } /* If nRec is 0 and this rollback is of a transaction created by this ** process and if this is the final header in the journal, then it means @@ -37213,13 +35592,13 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** pages that need to be rolled back and that the number of pages ** should be computed based on the journal file size. */ - if *(*Tu32)(unsafe.Pointer(bp + 8)) == uint32(0) && !(isHot != 0) && (*TPager)(unsafe.Pointer(pPager)).FjournalHdr+int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize) == (*TPager)(unsafe.Pointer(pPager)).FjournalOff { - *(*Tu32)(unsafe.Pointer(bp + 8)) = uint32(int32((*(*Ti64)(unsafe.Pointer(bp)) - (*TPager)(unsafe.Pointer(pPager)).FjournalOff) / ((*TPager)(unsafe.Pointer(pPager)).FpageSize + libc.Int64FromInt32(8)))) + if *(*Tu32)(unsafe.Pointer(bp + 8)) == uint32(0) && !(isHot != 0) && (*TPager)(unsafe.Pointer(pPager)).FjournalHdr+libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize) == (*TPager)(unsafe.Pointer(pPager)).FjournalOff { + *(*Tu32)(unsafe.Pointer(bp + 8)) = libc.Uint32FromInt32(int32((*(*Ti64)(unsafe.Pointer(bp)) - (*TPager)(unsafe.Pointer(pPager)).FjournalOff) / ((*TPager)(unsafe.Pointer(pPager)).FpageSize + libc.Int64FromInt32(8)))) } /* If this is the first header read from the journal, truncate the ** database file back to its original size. */ - if (*TPager)(unsafe.Pointer(pPager)).FjournalOff == int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize) { + if (*TPager)(unsafe.Pointer(pPager)).FjournalOff == libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize) { rc = _pager_truncate(tls, pPager, *(*TPgno)(unsafe.Pointer(bp + 12))) if rc != SQLITE_OK { goto end_playback @@ -37274,7 +35653,6 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } } /*NOTREACHED*/ - _ = libc.Int32FromInt32(0) goto end_playback end_playback: ; @@ -37302,9 +35680,9 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) } - if rc == SQLITE_OK && (int32((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { + if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) } if rc == SQLITE_OK { @@ -37314,7 +35692,6 @@ end_playback: /* If there was a super-journal and this routine will return success, ** see if it is possible to delete the super-journal. */ - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace, 0, uint32(4)) rc = _pager_delsuper(tls, pPager, zSuper) } @@ -37354,8 +35731,6 @@ func _readDbPage(tls *libc.TLS, pPg uintptr) (r int32) { pPager = (*TPgHdr)(unsafe.Pointer(pPg)).FpPager /* Pager object associated with page pPg */ rc = SQLITE_OK /* Return code */ *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) /* Frame of WAL containing pgno */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno, bp) if rc != 0 { @@ -37365,7 +35740,7 @@ func _readDbPage(tls *libc.TLS, pPg uintptr) (r int32) { if *(*Tu32)(unsafe.Pointer(bp)) != 0 { rc = _sqlite3WalReadFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, *(*Tu32)(unsafe.Pointer(bp)), int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), (*TPgHdr)(unsafe.Pointer(pPg)).FpData) } else { - iOffset = int64((*TPgHdr)(unsafe.Pointer(pPg)).Fpgno-libc.Uint32FromInt32(1)) * (*TPager)(unsafe.Pointer(pPager)).FpageSize + iOffset = libc.Int64FromUint32((*TPgHdr)(unsafe.Pointer(pPg)).Fpgno-libc.Uint32FromInt32(1)) * (*TPager)(unsafe.Pointer(pPager)).FpageSize rc = _sqlite3OsRead(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, (*TPgHdr)(unsafe.Pointer(pPg)).FpData, int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), iOffset) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) { rc = SQLITE_OK @@ -37440,7 +35815,6 @@ func _pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg TPgno) (r int32) { _, _, _ = pPager, pPg, rc rc = SQLITE_OK pPager = pCtx - _ = libc.Int32FromInt32(0) pPg = _sqlite3PagerLookup(tls, pPager, iPg) if pPg != 0 { if _sqlite3PcachePageRefcount(tls, pPg) == int64(1) { @@ -37510,9 +35884,6 @@ func _pagerWalFrames(tls *libc.TLS, pPager uintptr, _pList uintptr, nTruncate TP var nList, rc int32 var p, ppNext, v2 uintptr _, _, _, _, _ = nList, p, ppNext, rc, v2 /* For looping over pages */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if isCommit != 0 { /* If a WAL transaction is being committed, there is no point in writing ** any pages with page numbers greater than nTruncate into the WAL file. @@ -37536,15 +35907,14 @@ func _pagerWalFrames(tls *libc.TLS, pPager uintptr, _pList uintptr, nTruncate TP ; p = (*TPgHdr)(unsafe.Pointer(p)).FpDirty } - _ = libc.Int32FromInt32(0) } else { nList = int32(1) } - *(*Tu32)(unsafe.Pointer(pPager + 192 + 2*4)) += uint32(nList) + *(*Tu32)(unsafe.Pointer(pPager + 192 + 2*4)) += libc.Uint32FromInt32(nList) if (*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fpgno == uint32(1) { _pager_write_changecounter(tls, *(*uintptr)(unsafe.Pointer(bp))) } - rc = _sqlite3WalFrames(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), *(*uintptr)(unsafe.Pointer(bp)), nTruncate, isCommit, int32((*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags)) + rc = _sqlite3WalFrames(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), *(*uintptr)(unsafe.Pointer(bp)), nTruncate, isCommit, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags)) if rc == SQLITE_OK && (*TPager)(unsafe.Pointer(pPager)).FpBackup != 0 { p = *(*uintptr)(unsafe.Pointer(bp)) for { @@ -37578,8 +35948,6 @@ func _pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) (r int32) { var _ /* changed at bp+0 */ int32 _ = rc /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if cache must be reset */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* sqlite3WalEndReadTransaction() was not called for the previous ** transaction in locking_mode=EXCLUSIVE. So call it now. If we ** are in locking_mode=NORMAL and EndRead() was previously called, @@ -37620,10 +35988,6 @@ func _pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) (r int32) { ** available from the WAL sub-system if the log file is empty or ** contains no valid committed transactions. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) nPage = _sqlite3WalDbsize(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) /* If the number of pages in the database is not available from the ** WAL sub-system, determine the page count based on the size of @@ -37636,7 +36000,7 @@ func _pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) (r int32) { if rc != SQLITE_OK { return rc } - nPage = uint32((*(*Ti64)(unsafe.Pointer(bp)) + (*TPager)(unsafe.Pointer(pPager)).FpageSize - libc.Int64FromInt32(1)) / (*TPager)(unsafe.Pointer(pPager)).FpageSize) + nPage = libc.Uint32FromInt64((*(*Ti64)(unsafe.Pointer(bp)) + (*TPager)(unsafe.Pointer(pPager)).FpageSize - libc.Int64FromInt32(1)) / (*TPager)(unsafe.Pointer(pPager)).FpageSize) } /* If the current number of pages in the file is greater than the ** configured maximum pager number, increase the allowed limit so @@ -37677,8 +36041,6 @@ func _pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) (r int32) { var _ /* nPage at bp+4 */ TPgno _ = rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if !((*TPager)(unsafe.Pointer(pPager)).FtempFile != 0) { /* True if WAL file exists */ rc = _sqlite3OsAccess(tls, (*TPager)(unsafe.Pointer(pPager)).FpVfs, (*TPager)(unsafe.Pointer(pPager)).FzWal, SQLITE_ACCESS_EXISTS, bp) if rc == SQLITE_OK { @@ -37693,7 +36055,7 @@ func _pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) (r int32) { rc = _sqlite3PagerOpenWal(tls, pPager, uintptr(0)) } } else { - if int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_WAL) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_WAL) { (*TPager)(unsafe.Pointer(pPager)).FjournalMode = uint8(PAGER_JOURNALMODE_DELETE) } } @@ -37755,8 +36117,6 @@ func _pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) _, _, _, _, _, _, _, _ = iHdrOff, ii, ii1, pDone, rc, szJ, v1, v2 /* End of first segment of main-journal records */ rc = SQLITE_OK /* Return code */ pDone = uintptr(0) /* Bitvec to ensure pages played back only once */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Allocate a bitvec to use to store the set of pages rolled back */ if pSavepoint != 0 { pDone = _sqlite3BitvecCreate(tls, (*TPagerSavepoint)(unsafe.Pointer(pSavepoint)).FnOrig) @@ -37783,7 +36143,6 @@ func _pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) ** past pPager->journalOff is off-limits to us. */ szJ = (*TPager)(unsafe.Pointer(pPager)).FjournalOff - _ = libc.Int32FromInt32(0) /* Begin by rolling back records from the main journal starting at ** PagerSavepoint.iOffset and continuing to the next journal header. ** There might be records in the main journal that have a page number @@ -37802,7 +36161,6 @@ func _pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) for rc == SQLITE_OK && (*TPager)(unsafe.Pointer(pPager)).FjournalOff < iHdrOff { rc = _pager_playback_one_page(tls, pPager, pPager+76, pDone, int32(1), int32(1)) } - _ = libc.Int32FromInt32(0) } else { (*TPager)(unsafe.Pointer(pPager)).FjournalOff = 0 } @@ -37814,14 +36172,13 @@ func _pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) for rc == SQLITE_OK && (*TPager)(unsafe.Pointer(pPager)).FjournalOff < szJ { /* Loop counter */ *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) rc = _readJournalHdr(tls, pPager, 0, szJ, bp, bp+4) - _ = libc.Int32FromInt32(0) /* ** The "pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff" ** test is related to ticket #2565. See the discussion in the ** pager_playback() function for additional information. */ - if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) && (*TPager)(unsafe.Pointer(pPager)).FjournalHdr+int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize) == (*TPager)(unsafe.Pointer(pPager)).FjournalOff { - *(*Tu32)(unsafe.Pointer(bp)) = uint32((szJ - (*TPager)(unsafe.Pointer(pPager)).FjournalOff) / ((*TPager)(unsafe.Pointer(pPager)).FpageSize + libc.Int64FromInt32(8))) + if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) && (*TPager)(unsafe.Pointer(pPager)).FjournalHdr+libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize) == (*TPager)(unsafe.Pointer(pPager)).FjournalOff { + *(*Tu32)(unsafe.Pointer(bp)) = libc.Uint32FromInt64((szJ - (*TPager)(unsafe.Pointer(pPager)).FjournalOff) / ((*TPager)(unsafe.Pointer(pPager)).FpageSize + libc.Int64FromInt32(8))) } ii = uint32(0) for { @@ -37834,15 +36191,13 @@ func _pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) ; ii++ } - _ = libc.Int32FromInt32(0) } - _ = libc.Int32FromInt32(0) /* Finally, rollback pages from the sub-journal. Page that were ** previously rolled back out of the main journal (and are hence in pDone) ** will be skipped. Out-of-range pages are also skipped. */ if pSavepoint != 0 { /* Loop counter */ - *(*Ti64)(unsafe.Pointer(bp + 8)) = int64((*TPagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec) * (int64(4) + (*TPager)(unsafe.Pointer(pPager)).FpageSize) + *(*Ti64)(unsafe.Pointer(bp + 8)) = libc.Int64FromUint32((*TPagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec) * (int64(4) + (*TPager)(unsafe.Pointer(pPager)).FpageSize) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalSavepointUndo(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pSavepoint+32) } @@ -37851,14 +36206,12 @@ func _pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) if !(rc == SQLITE_OK && ii1 < (*TPager)(unsafe.Pointer(pPager)).FnSubRec) { break } - _ = libc.Int32FromInt32(0) rc = _pager_playback_one_page(tls, pPager, bp+8, pDone, 0, int32(1)) goto _4 _4: ; ii1++ } - _ = libc.Int32FromInt32(0) } _sqlite3BitvecDestroy(tls, pDone) if rc == SQLITE_OK { @@ -37995,19 +36348,19 @@ func _sqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { } else { v1 = 0 } - (*TPager)(unsafe.Pointer(pPager)).FnoSync = uint8(v1) + (*TPager)(unsafe.Pointer(pPager)).FnoSync = libc.Uint8FromInt32(v1) if level >= uint32(PAGER_SYNCHRONOUS_FULL) { v2 = int32(1) } else { v2 = 0 } - (*TPager)(unsafe.Pointer(pPager)).FfullSync = uint8(v2) + (*TPager)(unsafe.Pointer(pPager)).FfullSync = libc.Uint8FromInt32(v2) if level == uint32(PAGER_SYNCHRONOUS_EXTRA) { v3 = int32(1) } else { v3 = 0 } - (*TPager)(unsafe.Pointer(pPager)).FextraSync = uint8(v3) + (*TPager)(unsafe.Pointer(pPager)).FextraSync = libc.Uint8FromInt32(v3) } if (*TPager)(unsafe.Pointer(pPager)).FnoSync != 0 { (*TPager)(unsafe.Pointer(pPager)).FsyncFlags = uint8(0) @@ -38018,10 +36371,10 @@ func _sqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { (*TPager)(unsafe.Pointer(pPager)).FsyncFlags = uint8(SQLITE_SYNC_NORMAL) } } - (*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags = uint8(int32((*TPager)(unsafe.Pointer(pPager)).FsyncFlags) << libc.Int32FromInt32(2)) + (*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsyncFlags) << libc.Int32FromInt32(2)) if (*TPager)(unsafe.Pointer(pPager)).FfullSync != 0 { p4 = pPager + 11 - *(*Tu8)(unsafe.Pointer(p4)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p4))) | int32((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) + *(*Tu8)(unsafe.Pointer(p4)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p4))) | libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) } if pgFlags&uint32(PAGER_CKPT_FULLFSYNC) != 0 && !((*TPager)(unsafe.Pointer(pPager)).FnoSync != 0) { p5 = pPager + 11 @@ -38064,7 +36417,6 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 _ = rc /* Return code */ vfsFlags |= libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) rc = _sqlite3OsOpen(tls, (*TPager)(unsafe.Pointer(pPager)).FpVfs, uintptr(0), pFile, vfsFlags, uintptr(0)) - _ = libc.Int32FromInt32(0) return rc } @@ -38097,8 +36449,6 @@ func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uin (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 184 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) } @@ -38153,17 +36503,16 @@ func _sqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, ** is a no-op for that case anyhow. */ pageSize = *(*Tu32)(unsafe.Pointer(pPageSize)) - _ = libc.Int32FromInt32(0) - if (int32((*TPager)(unsafe.Pointer(pPager)).FmemDb) == 0 || (*TPager)(unsafe.Pointer(pPager)).FdbSize == uint32(0)) && _sqlite3PcacheRefCount(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache) == 0 && pageSize != 0 && pageSize != uint32((*TPager)(unsafe.Pointer(pPager)).FpageSize) { + if (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FmemDb) == 0 || (*TPager)(unsafe.Pointer(pPager)).FdbSize == uint32(0)) && _sqlite3PcacheRefCount(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache) == 0 && pageSize != 0 && pageSize != libc.Uint32FromInt64((*TPager)(unsafe.Pointer(pPager)).FpageSize) { pNew = libc.UintptrFromInt32(0) /* New temp space */ *(*Ti64)(unsafe.Pointer(bp)) = 0 - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) > PAGER_OPEN && (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) > PAGER_OPEN && (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) { rc = _sqlite3OsFileSize(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, bp) } if rc == SQLITE_OK { /* 8 bytes of zeroed overrun space is sufficient so that the b-tree * cell header parser will never run off the end of the allocation */ - pNew = _sqlite3PageMalloc(tls, int32(pageSize+uint32(8))) + pNew = _sqlite3PageMalloc(tls, libc.Int32FromUint32(pageSize+uint32(8))) if !(pNew != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -38172,24 +36521,23 @@ func _sqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, } if rc == SQLITE_OK { _pager_reset(tls, pPager) - rc = _sqlite3PcacheSetPageSize(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, int32(pageSize)) + rc = _sqlite3PcacheSetPageSize(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, libc.Int32FromUint32(pageSize)) } if rc == SQLITE_OK { _sqlite3PageFree(tls, (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace) (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace = pNew - (*TPager)(unsafe.Pointer(pPager)).FdbSize = uint32((*(*Ti64)(unsafe.Pointer(bp)) + int64(pageSize) - libc.Int64FromInt32(1)) / int64(pageSize)) - (*TPager)(unsafe.Pointer(pPager)).FpageSize = int64(pageSize) - (*TPager)(unsafe.Pointer(pPager)).FlckPgno = uint32(_sqlite3PendingByte)/pageSize + uint32(1) + (*TPager)(unsafe.Pointer(pPager)).FdbSize = libc.Uint32FromInt64((*(*Ti64)(unsafe.Pointer(bp)) + libc.Int64FromUint32(pageSize) - libc.Int64FromInt32(1)) / libc.Int64FromUint32(pageSize)) + (*TPager)(unsafe.Pointer(pPager)).FpageSize = libc.Int64FromUint32(pageSize) + (*TPager)(unsafe.Pointer(pPager)).FlckPgno = libc.Uint32FromInt32(_sqlite3PendingByte)/pageSize + uint32(1) } else { _sqlite3PageFree(tls, pNew) } } - *(*Tu32)(unsafe.Pointer(pPageSize)) = uint32((*TPager)(unsafe.Pointer(pPager)).FpageSize) + *(*Tu32)(unsafe.Pointer(pPageSize)) = libc.Uint32FromInt64((*TPager)(unsafe.Pointer(pPager)).FpageSize) if rc == SQLITE_OK { if nReserve < 0 { nReserve = int32((*TPager)(unsafe.Pointer(pPager)).FnReserve) } - _ = libc.Int32FromInt32(0) (*TPager)(unsafe.Pointer(pPager)).FnReserve = int16(nReserve) _pagerFixMaplimit(tls, pPager) } @@ -38223,7 +36571,7 @@ func _sqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage TPgno) (r T if mxPage > uint32(0) { (*TPager)(unsafe.Pointer(pPager)).FmxPgno = mxPage } - _ = libc.Int32FromInt32(0) /* Called only by OP_MaxPgcnt */ + /* Called only by OP_MaxPgcnt */ /* assert( pPager->mxPgno>=pPager->dbSize ); */ /* OP_MaxPgcnt ensures that the parameter passed to this function is not ** less than the total number of valid pages in the database. But this @@ -38260,13 +36608,11 @@ func _sqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest u var rc int32 _ = rc rc = SQLITE_OK - libc.Xmemset(tls, pDest, 0, uint32(N)) - _ = libc.Int32FromInt32(0) + libc.Xmemset(tls, pDest, 0, libc.Uint32FromInt32(N)) /* This routine is only called by btree immediately after creating ** the Pager object. There has not been an opportunity to transition ** to WAL mode yet. */ - _ = libc.Int32FromInt32(0) if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) { rc = _sqlite3OsRead(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, pDest, N, 0) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) { @@ -38286,9 +36632,7 @@ func _sqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest u // ** this is considered a 1 page file. // */ func _sqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(pnPage)) = int32((*TPager)(unsafe.Pointer(pPager)).FdbSize) + *(*int32)(unsafe.Pointer(pnPage)) = libc.Int32FromUint32((*TPager)(unsafe.Pointer(pPager)).FdbSize) } // C documentation @@ -38315,7 +36659,6 @@ func _pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) (r int32 ** may be invoked during, according to the comment above ** sqlite3PagerSetBusyhandler(). */ - _ = libc.Int32FromInt32(0) for cond := true; cond; cond = rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPager)(unsafe.Pointer(pPager)).FxBusyHandler})))(tls, (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg) != 0 { rc = _pagerLockDb(tls, pPager, locktype) } @@ -38358,8 +36701,6 @@ func _pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) (r int32 // ** then continue writing to the database. // */ func _sqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage TPgno) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TPager)(unsafe.Pointer(pPager)).FdbSize = nPage /* At one point the code here called assertTruncateConstraint() to ** ensure that all pages being truncated away by this operation are, @@ -38422,14 +36763,13 @@ func _pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno TPgno, pData uintp *(*uintptr)(unsafe.Pointer(ppPage)) = v1 (*TPager)(unsafe.Pointer(pPager)).FpMmapFreelist = (*TPgHdr)(unsafe.Pointer(p)).FpDirty (*TPgHdr)(unsafe.Pointer(p)).FpDirty = uintptr(0) - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, (*TPgHdr)(unsafe.Pointer(p)).FpExtra, 0, uint32(8)) } else { v2 = _sqlite3MallocZero(tls, uint64(uint32(48)+uint32((*TPager)(unsafe.Pointer(pPager)).FnExtra))) p = v2 *(*uintptr)(unsafe.Pointer(ppPage)) = v2 if p == uintptr(0) { - _sqlite3OsUnfetch(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int64(pgno-libc.Uint32FromInt32(1))*(*TPager)(unsafe.Pointer(pPager)).FpageSize, pData) + _sqlite3OsUnfetch(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, libc.Int64FromUint32(pgno-libc.Uint32FromInt32(1))*(*TPager)(unsafe.Pointer(pPager)).FpageSize, pData) return int32(SQLITE_NOMEM) } (*TPgHdr)(unsafe.Pointer(p)).FpExtra = p + 1*48 @@ -38437,11 +36777,6 @@ func _pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno TPgno, pData uintp (*TPgHdr)(unsafe.Pointer(p)).FnRef = int64(1) (*TPgHdr)(unsafe.Pointer(p)).FpPager = pPager } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TPgHdr)(unsafe.Pointer(p)).Fpgno = pgno (*TPgHdr)(unsafe.Pointer(p)).FpData = pData (*TPager)(unsafe.Pointer(pPager)).FnMmapOut++ @@ -38461,8 +36796,7 @@ func _pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { (*TPager)(unsafe.Pointer(pPager)).FnMmapOut-- (*TPgHdr)(unsafe.Pointer(pPg)).FpDirty = (*TPager)(unsafe.Pointer(pPager)).FpMmapFreelist (*TPager)(unsafe.Pointer(pPager)).FpMmapFreelist = pPg - _ = libc.Int32FromInt32(0) - _sqlite3OsUnfetch(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int64((*TPgHdr)(unsafe.Pointer(pPg)).Fpgno-libc.Uint32FromInt32(1))*(*TPager)(unsafe.Pointer(pPager)).FpageSize, (*TPgHdr)(unsafe.Pointer(pPg)).FpData) + _sqlite3OsUnfetch(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, libc.Int64FromUint32((*TPgHdr)(unsafe.Pointer(pPg)).Fpgno-libc.Uint32FromInt32(1))*(*TPager)(unsafe.Pointer(pPager)).FpageSize, (*TPgHdr)(unsafe.Pointer(pPg)).FpData) } // C documentation @@ -38507,7 +36841,6 @@ func _databaseIsUnmoved(tls *libc.TLS, pPager uintptr) (r int32) { if (*TPager)(unsafe.Pointer(pPager)).FdbSize == uint32(0) { return SQLITE_OK } - _ = libc.Int32FromInt32(0) rc = _sqlite3OsFileControl(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_HAS_MOVED), bp) if rc == int32(SQLITE_NOTFOUND) { /* If the HAS_MOVED file-control is unimplemented, assume that the file @@ -38542,18 +36875,15 @@ func _sqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) (r int32) { var a, pTmp uintptr _, _ = a, pTmp pTmp = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3BeginBenignMalloc(tls) _pagerFreeMapHdrs(tls, pPager) /* pPager->errCode = 0; */ (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode = uint8(0) a = uintptr(0) - _ = libc.Int32FromInt32(0) if db != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_NoCkptOnClose) && SQLITE_OK == _databaseIsUnmoved(tls, pPager) { a = pTmp } - _sqlite3WalClose(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, db, int32((*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), a) + _sqlite3WalClose(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, db, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), a) (*TPager)(unsafe.Pointer(pPager)).FpWal = uintptr(0) _pager_reset(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FmemDb != 0 { @@ -38580,8 +36910,6 @@ func _sqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) (r int32) { _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd) _sqlite3PageFree(tls, pTmp) _sqlite3PcacheClose(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) Xsqlite3_free(tls, pPager) return SQLITE_OK } @@ -38640,21 +36968,16 @@ func _syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) (r int32) { var _ /* aMagic at bp+0 */ [8]Tu8 var _ /* zHeader at bp+8 */ [12]Tu8 _, _, _, _ = iDc, iNextHdrOffset, rc, v1 /* Return code */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3PagerExclusiveLock(tls, pPager) if rc != SQLITE_OK { return rc } if !((*TPager)(unsafe.Pointer(pPager)).FnoSync != 0) { - _ = libc.Int32FromInt32(0) - if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_MEMORY) { + if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_MEMORY) { iDc = _sqlite3OsDeviceCharacteristics(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd) - _ = libc.Int32FromInt32(0) if 0 == iDc&int32(SQLITE_IOCAP_SAFE_APPEND) { libc.Xmemcpy(tls, bp+8, uintptr(unsafe.Pointer(&_aJournalMagic)), uint32(8)) - _sqlite3Put4byte(tls, bp+8+uintptr(8), uint32((*TPager)(unsafe.Pointer(pPager)).FnRec)) + _sqlite3Put4byte(tls, bp+8+uintptr(8), libc.Uint32FromInt32((*TPager)(unsafe.Pointer(pPager)).FnRec)) iNextHdrOffset = _journalHdrOffset(tls, pPager) rc = _sqlite3OsRead(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, bp, int32(8), iNextHdrOffset) if rc == SQLITE_OK && 0 == libc.Xmemcmp(tls, bp, uintptr(unsafe.Pointer(&_aJournalMagic)), uint32(8)) { @@ -38675,7 +36998,7 @@ func _syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) (r int32) { ** and never needs to be updated. */ if (*TPager)(unsafe.Pointer(pPager)).FfullSync != 0 && 0 == iDc&int32(SQLITE_IOCAP_SEQUENTIAL) { - rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, int32((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) + rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) if rc != SQLITE_OK { return rc } @@ -38686,12 +37009,12 @@ func _syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) (r int32) { } } if 0 == iDc&int32(SQLITE_IOCAP_SEQUENTIAL) { - if int32((*TPager)(unsafe.Pointer(pPager)).FsyncFlags) == int32(SQLITE_SYNC_FULL) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsyncFlags) == int32(SQLITE_SYNC_FULL) { v1 = int32(SQLITE_SYNC_DATAONLY) } else { v1 = 0 } - rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, int32((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)|v1) + rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)|v1) if rc != SQLITE_OK { return rc } @@ -38714,7 +37037,6 @@ func _syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) (r int32) { */ _sqlite3PcacheClearSyncFlags(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_WRITER_DBMOD) - _ = libc.Int32FromInt32(0) return SQLITE_OK } @@ -38765,24 +37087,18 @@ func _pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) (r int3 _, _, _, _ = offset, pData, pgno, rc rc = SQLITE_OK /* Return code */ /* This function is only called for rollback pagers in WRITER_DBMOD state. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the file is a temp-file has not yet been opened, open it now. It ** is not possible for rc to be other than SQLITE_OK if this branch ** is taken, as pager_wait_on_lock() is a no-op for temp-files. */ if !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != libc.UintptrFromInt32(0)) { - _ = libc.Int32FromInt32(0) - rc = _pagerOpentemp(tls, pPager, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32((*TPager)(unsafe.Pointer(pPager)).FvfsFlags)) + rc = _pagerOpentemp(tls, pPager, (*TPager)(unsafe.Pointer(pPager)).Ffd, libc.Int32FromUint32((*TPager)(unsafe.Pointer(pPager)).FvfsFlags)) } /* Before the first write, give the VFS a hint of what the final ** file size will be. */ - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK && (*TPager)(unsafe.Pointer(pPager)).FdbHintSize < (*TPager)(unsafe.Pointer(pPager)).FdbSize && ((*TPgHdr)(unsafe.Pointer(pList)).FpDirty != 0 || (*TPgHdr)(unsafe.Pointer(pList)).Fpgno > (*TPager)(unsafe.Pointer(pPager)).FdbHintSize) { - *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FpageSize * int64((*TPager)(unsafe.Pointer(pPager)).FdbSize) + *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FpageSize * libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FdbSize) _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_SIZE_HINT), bp) (*TPager)(unsafe.Pointer(pPager)).FdbHintSize = (*TPager)(unsafe.Pointer(pPager)).FdbSize } @@ -38796,9 +37112,8 @@ func _pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) (r int3 ** Also, do not write out any page that has the PGHDR_DONT_WRITE flag ** set (set by sqlite3PagerDontWrite()). */ - if pgno <= (*TPager)(unsafe.Pointer(pPager)).FdbSize && 0 == int32((*TPgHdr)(unsafe.Pointer(pList)).Fflags)&int32(PGHDR_DONT_WRITE) { - offset = int64(pgno-libc.Uint32FromInt32(1)) * (*TPager)(unsafe.Pointer(pPager)).FpageSize /* Data to write */ - _ = libc.Int32FromInt32(0) + if pgno <= (*TPager)(unsafe.Pointer(pPager)).FdbSize && 0 == libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pList)).Fflags)&int32(PGHDR_DONT_WRITE) { + offset = libc.Int64FromUint32(pgno-libc.Uint32FromInt32(1)) * (*TPager)(unsafe.Pointer(pPager)).FpageSize /* Data to write */ if (*TPgHdr)(unsafe.Pointer(pList)).Fpgno == uint32(1) { _pager_write_changecounter(tls, pList) } @@ -38842,7 +37157,7 @@ func _openSubJournal(tls *libc.TLS, pPager uintptr) (r int32) { if !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fsjfd)).FpMethods != libc.UintptrFromInt32(0)) { flags = libc.Int32FromInt32(SQLITE_OPEN_SUBJOURNAL) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) nStmtSpill = _sqlite3Config.FnStmtSpill - if int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) || (*TPager)(unsafe.Pointer(pPager)).FsubjInMemory != 0 { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) || (*TPager)(unsafe.Pointer(pPager)).FsubjInMemory != 0 { nStmtSpill = -int32(1) } rc = _sqlite3JournalOpen(tls, (*TPager)(unsafe.Pointer(pPager)).FpVfs, uintptr(0), (*TPager)(unsafe.Pointer(pPager)).Fsjfd, flags, nStmtSpill) @@ -38870,18 +37185,14 @@ func _subjournalPage(tls *libc.TLS, pPg uintptr) (r int32) { _, _, _, _, _ = offset, pData, pData2, pPager, rc rc = SQLITE_OK pPager = (*TPgHdr)(unsafe.Pointer(pPg)).FpPager - if int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_OFF) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_OFF) { /* Open the sub-journal, if it has not already been opened */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _openSubJournal(tls, pPager) /* If the sub-journal was opened successfully (or was already open), ** write the journal record into the file. */ if rc == SQLITE_OK { pData = (*TPgHdr)(unsafe.Pointer(pPg)).FpData - offset = int64((*TPager)(unsafe.Pointer(pPager)).FnSubRec) * (int64(4) + (*TPager)(unsafe.Pointer(pPager)).FpageSize) + offset = libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FnSubRec) * (int64(4) + (*TPager)(unsafe.Pointer(pPager)).FpageSize) pData2 = pData rc = _write32bits(tls, (*TPager)(unsafe.Pointer(pPager)).Fsjfd, offset, (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno) if rc == SQLITE_OK { @@ -38891,7 +37202,6 @@ func _subjournalPage(tls *libc.TLS, pPg uintptr) (r int32) { } if rc == SQLITE_OK { (*TPager)(unsafe.Pointer(pPager)).FnSubRec++ - _ = libc.Int32FromInt32(0) rc = _addToSavepointBitvecs(tls, pPager, (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno) } return rc @@ -38933,8 +37243,6 @@ func _pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) (r int32) { _, _ = pPager, rc pPager = p rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The doNotSpill NOSYNC bit is set during times when doing a sync of ** journal (and adding a new header) is not allowed. This occurs ** during calls to sqlite3PagerWrite() while trying to journal multiple @@ -38954,7 +37262,7 @@ func _pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) (r int32) { if (*TPager)(unsafe.Pointer(pPager)).FerrCode != 0 { return SQLITE_OK } - if (*TPager)(unsafe.Pointer(pPager)).FdoNotSpill != 0 && (int32((*TPager)(unsafe.Pointer(pPager)).FdoNotSpill)&(libc.Int32FromInt32(SPILLFLAG_ROLLBACK)|libc.Int32FromInt32(SPILLFLAG_OFF)) != 0 || int32((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_NEED_SYNC) != 0) { + if (*TPager)(unsafe.Pointer(pPager)).FdoNotSpill != 0 && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FdoNotSpill)&(libc.Int32FromInt32(SPILLFLAG_ROLLBACK)|libc.Int32FromInt32(SPILLFLAG_OFF)) != 0 || libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_NEED_SYNC) != 0) { return SQLITE_OK } *(*Tu32)(unsafe.Pointer(pPager + 192 + 3*4))++ @@ -38967,12 +37275,11 @@ func _pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) (r int32) { } } else { /* Sync the journal file if required. */ - if int32((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_NEED_SYNC) != 0 || int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_WRITER_CACHEMOD) { + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_NEED_SYNC) != 0 || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_WRITER_CACHEMOD) { rc = _syncJournal(tls, pPager, int32(1)) } /* Write the contents of the page out to the database file. */ if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) rc = _pager_write_pagelist(tls, pPager, pPg) } } @@ -38995,7 +37302,6 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { rc = (*TPager)(unsafe.Pointer(pPager)).FerrCode if !((*TPager)(unsafe.Pointer(pPager)).FmemDb != 0) { pList = _sqlite3PcacheDirtyList(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache) - _ = libc.Int32FromInt32(0) for rc == SQLITE_OK && pList != 0 { pNext = (*TPgHdr)(unsafe.Pointer(pList)).FpDirty if (*TPgHdr)(unsafe.Pointer(pList)).FnRef == 0 { @@ -39085,7 +37391,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -39109,7 +37415,6 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u z += uintptr(libc.Xstrlen(tls, z) + uint32(1)) } nUriByte = t__predefined_ptrdiff_t(z+1) - int32(zUri) - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK && nPathname+int32(8) > (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname { /* This branch is taken when the journal path required by ** the database being opened will be more than pVfs->mxPathname @@ -39168,15 +37473,13 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - _ = libc.Int32FromInt32(0) - pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint32FromInt64(232)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))+uint32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint32(journalFileSize*int32(2))+uint32(__SIZEOF_POINTER__)+uint32(4)+uint32(nPathname)+uint32(1)+uint32(nUriByte)+uint32(nPathname)+uint32(8)+uint32(1)+uint32(nPathname)+uint32(4)+uint32(1)+uint32(3))) - _ = libc.Int32FromInt32(0) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint32FromInt64(232)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint32FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint32FromInt32(journalFileSize*int32(2))+uint32(__SIZEOF_POINTER__)+uint32(4)+libc.Uint32FromInt32(nPathname)+uint32(1)+libc.Uint32FromInt32(nUriByte)+libc.Uint32FromInt32(nPathname)+uint32(8)+uint32(1)+libc.Uint32FromInt32(nPathname)+uint32(4)+uint32(1)+uint32(3))) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) } *(*uintptr)(unsafe.Pointer(bp)) = pPtr - pPtr += uintptr((libc.Uint32FromInt64(232) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + pPtr += uintptr((libc.Uint32FromInt64(232) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpPCache = pPtr pPtr += uintptr((pcacheSize + libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)) (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ffd = pPtr @@ -39185,17 +37488,16 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u pPtr += uintptr(journalFileSize) (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fjfd = pPtr pPtr += uintptr(journalFileSize) - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, pPtr, bp, uint32(__SIZEOF_POINTER__)) pPtr += uintptr(__SIZEOF_POINTER__) /* Fill in the Pager.zFilename and pPager.zQueryParam fields */ pPtr += uintptr(4) /* Skip zero prefix */ (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename = pPtr if nPathname > 0 { - libc.Xmemcpy(tls, pPtr, zPathname, uint32(nPathname)) + libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint32FromInt32(nPathname)) pPtr += uintptr(nPathname + int32(1)) if zUri != 0 { - libc.Xmemcpy(tls, pPtr, zUri, uint32(nUriByte)) + libc.Xmemcpy(tls, pPtr, zUri, libc.Uint32FromInt32(nUriByte)) pPtr += uintptr(nUriByte) } else { pPtr++ @@ -39204,7 +37506,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u /* Fill in Pager.zJournal */ if nPathname > 0 { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr - libc.Xmemcpy(tls, pPtr, zPathname, uint32(nPathname)) + libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint32FromInt32(nPathname)) pPtr += uintptr(nPathname) libc.Xmemcpy(tls, pPtr, __ccgo_ts+4142, uint32(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) @@ -39214,7 +37516,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u /* Fill in Pager.zWal */ if nPathname > 0 { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr - libc.Xmemcpy(tls, pPtr, zPathname, uint32(nPathname)) + libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint32FromInt32(nPathname)) pPtr += uintptr(nPathname) libc.Xmemcpy(tls, pPtr, __ccgo_ts+4151, uint32(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) @@ -39226,7 +37528,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u _sqlite3DbFree(tls, uintptr(0), zPathname) } (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpVfs = pVfs - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FvfsFlags = uint32(vfsFlags) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FvfsFlags = libc.Uint32FromInt32(vfsFlags) /* Open the pager file. */ if !(zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0) { @@ -39234,10 +37536,9 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* VFS flags returned by xOpen() */ rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ffd, vfsFlags, bp+8) - _ = libc.Int32FromInt32(0) v4 = libc.BoolInt32(*(*int32)(unsafe.Pointer(bp + 8))&libc.Int32FromInt32(SQLITE_OPEN_MEMORY) != libc.Int32FromInt32(0)) memJM = v4 - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmemVfs = uint8(v4) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmemVfs = libc.Uint8FromInt32(v4) readOnly = libc.BoolInt32(*(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0) /* If the file was successfully opened for read/write access, ** choose a default page size in case we have to create the @@ -39251,7 +37552,6 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u iDc = _sqlite3OsDeviceCharacteristics(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ffd) if !(readOnly != 0) { _setSectorSize(tls, *(*uintptr)(unsafe.Pointer(bp))) - _ = libc.Int32FromInt32(0) if *(*Tu32)(unsafe.Pointer(bp + 4)) < (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FsectorSize { if (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FsectorSize > uint32(SQLITE_MAX_DEFAULT_PAGE_SIZE) { *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(SQLITE_MAX_DEFAULT_PAGE_SIZE) @@ -39260,7 +37560,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = uint8(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4156, 0)) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4156, 0)) if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4163, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file @@ -39293,19 +37593,17 @@ _3: ** Pager.pageSize and to allocate the Pager.pTmpSpace buffer. */ if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) rc = _sqlite3PagerSetPagesize(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+4, -int32(1)) } /* Initialize the PCache object. */ if rc == SQLITE_OK { nExtra = (nExtra + int32(7)) & ^libc.Int32FromInt32(7) - _ = libc.Int32FromInt32(0) if !(memDb != 0) { v5 = __ccgo_fp(_pagerStress) } else { v5 = uintptr(0) } - rc = _sqlite3PcacheOpen(tls, int32(*(*Tu32)(unsafe.Pointer(bp + 4))), nExtra, libc.BoolInt32(!(memDb != 0)), v5, *(*uintptr)(unsafe.Pointer(bp)), (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpPCache) + rc = _sqlite3PcacheOpen(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))), nExtra, libc.BoolInt32(!(memDb != 0)), v5, *(*uintptr)(unsafe.Pointer(bp)), (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpPCache) } /* If an error occurred above, free the Pager structure and close the file. */ @@ -39315,7 +37613,7 @@ _3: Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FuseJournal = uint8(useJournal) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FuseJournal = libc.Uint8FromInt32(useJournal) /* pPager->stmtOpen = 0; */ /* pPager->stmtInUse = 0; */ /* pPager->nRef = 0; */ @@ -39325,21 +37623,17 @@ _3: (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmxPgno = uint32(SQLITE_MAX_PAGE_COUNT) /* pPager->state = PAGER_UNLOCK; */ /* pPager->errMask = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtempFile = uint8(tempFile) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FexclusiveMode = uint8(tempFile) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtempFile = libc.Uint8FromInt32(tempFile) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FexclusiveMode = libc.Uint8FromInt32(tempFile) (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FchangeCountDone = (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtempFile - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmemDb = uint8(memDb) - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FreadOnly = uint8(readOnly) - _ = libc.Int32FromInt32(0) - _sqlite3PagerSetFlags(tls, *(*uintptr)(unsafe.Pointer(bp)), uint32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS)+libc.Int32FromInt32(1)|libc.Int32FromInt32(PAGER_CACHESPILL))) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmemDb = libc.Uint8FromInt32(memDb) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FreadOnly = libc.Uint8FromInt32(readOnly) + _sqlite3PagerSetFlags(tls, *(*uintptr)(unsafe.Pointer(bp)), libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS)+libc.Int32FromInt32(1)|libc.Int32FromInt32(PAGER_CACHESPILL))) /* pPager->pFirst = 0; */ /* pPager->pFirstSynced = 0; */ /* pPager->pLast = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExtra = uint16(nExtra) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExtra = libc.Uint16FromInt32(nExtra) (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FjournalSizeLimit = int64(-int32(1)) - _ = libc.Int32FromInt32(0) _setSectorSize(tls, *(*uintptr)(unsafe.Pointer(bp))) if !(useJournal != 0) { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FjournalMode = uint8(PAGER_JOURNALMODE_OFF) @@ -39372,7 +37666,6 @@ func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) (r uintptr) { zName-- } p = zName - uintptr(4) - uintptr(4) - _ = libc.Int32FromInt32(0) pPager = *(*uintptr)(unsafe.Pointer(p)) return (*TPager)(unsafe.Pointer(pPager)).Ffd } @@ -39425,10 +37718,6 @@ func _hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) (r int32) { rc = SQLITE_OK /* Return code */ *(*int32)(unsafe.Pointer(bp)) = int32(1) /* True if a journal file is present */ jrnlOpen = libc.BoolInt32(!!((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != libc.UintptrFromInt32(0))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pExists)) = 0 if !(jrnlOpen != 0) { rc = _sqlite3OsAccess(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, SQLITE_ACCESS_EXISTS, bp) @@ -39445,7 +37734,6 @@ func _hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) (r int32) { */ rc = _sqlite3OsCheckReservedLock(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, bp+4) if rc == SQLITE_OK && !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) { /* Number of pages in database file */ - _ = libc.Int32FromInt32(0) rc = _pagerPagecount(tls, pPager, bp+8) if rc == SQLITE_OK { /* If the database is zero pages in size, that means that either (1) the @@ -39485,7 +37773,7 @@ func _hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) (r int32) { if !(jrnlOpen != 0) { _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } - *(*int32)(unsafe.Pointer(pExists)) = libc.BoolInt32(int32(*(*Tu8)(unsafe.Pointer(bp + 16))) != 0) + *(*int32)(unsafe.Pointer(pExists)) = libc.BoolInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 16))) != 0) } else { if rc == int32(SQLITE_CANTOPEN) { /* If we cannot open the rollback journal file in order to see if @@ -39552,23 +37840,16 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { ** outstanding pages. This implies that the pager state should either ** be OPEN or READER. READER is only possible if the pager is or was in ** exclusive access mode. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN { + if !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN { *(*int32)(unsafe.Pointer(bp)) = int32(1) /* True if there exists a hot journal-file */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _pager_wait_on_lock(tls, pPager, int32(SHARED_LOCK)) if rc != SQLITE_OK { - _ = libc.Int32FromInt32(0) goto failed } /* If a journal file exists, and there is no RESERVED lock on the ** database file, then it either needs to be played back or deleted. */ - if int32((*TPager)(unsafe.Pointer(pPager)).FeLock) <= int32(SHARED_LOCK) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeLock) <= int32(SHARED_LOCK) { rc = _hasHotJournal(tls, pPager, bp) } if rc != SQLITE_OK { @@ -39611,15 +37892,13 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { ** may mean that the pager was in the error-state when this ** function was called and the journal file does not exist. */ - if !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != libc.UintptrFromInt32(0)) && int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_OFF) { + if !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != libc.UintptrFromInt32(0)) && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_OFF) { pVfs = (*TPager)(unsafe.Pointer(pPager)).FpVfs /* True if journal file exists */ rc = _sqlite3OsAccess(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, SQLITE_ACCESS_EXISTS, bp+4) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 4)) != 0 { *(*int32)(unsafe.Pointer(bp + 8)) = 0 f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) - _ = libc.Int32FromInt32(0) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { rc = _sqlite3CantopenError(tls, int32(62419)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) @@ -39635,7 +37914,6 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { ** the journal before playing it back. */ if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) { - _ = libc.Int32FromInt32(0) rc = _pagerSyncHotJournal(tls, pPager) if rc == SQLITE_OK { rc = _pager_playback(tls, pPager, libc.BoolInt32(!((*TPager)(unsafe.Pointer(pPager)).FtempFile != 0))) @@ -39666,8 +37944,6 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { _pager_error(tls, pPager, rc) goto failed } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } if !((*TPager)(unsafe.Pointer(pPager)).FtempFile != 0) && (*TPager)(unsafe.Pointer(pPager)).FhasHeldSharedLock != 0 { rc = _sqlite3OsRead(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, bp+12, int32(16), int64(24)) @@ -39694,22 +37970,18 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { ** mode. Otherwise, the following function call is a no-op. */ rc = _pagerOpenWalIfPresent(tls, pPager) - _ = libc.Int32FromInt32(0) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { - _ = libc.Int32FromInt32(0) rc = _pagerBeginReadTransaction(tls, pPager) } - if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+28) } goto failed failed: ; if rc != SQLITE_OK { - _ = libc.Int32FromInt32(0) _pager_unlock(tls, pPager) - _ = libc.Int32FromInt32(0) } else { (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_READER) (*TPager)(unsafe.Pointer(pPager)).FhasHeldSharedLock = uint8(1) @@ -39729,7 +38001,7 @@ failed: // */ func _pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { if _sqlite3PcacheRefCount(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache) == 0 { - _ = libc.Int32FromInt32(0) /* because page1 is never memory mapped */ + /* because page1 is never memory mapped */ _pagerUnlockAndRollback(tls, pPager) } } @@ -39802,10 +38074,6 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f var _ /* pBase at bp+0 */ uintptr _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pgno == uint32(0) { return _sqlite3CorruptError(tls, int32(62632)) } @@ -39824,14 +38092,10 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f v1 = _sqlite3PcacheFetchFinish(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(ppPage)) = v1 pPg = v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) noContent = libc.BoolUint8(flags&int32(PAGER_GET_NOCONTENT) != 0) if (*TPgHdr)(unsafe.Pointer(pPg)).FpPager != 0 && !(noContent != 0) { /* In this case the pcache already contains an initialized copy of ** the page. Return without further ado. */ - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(pPager + 192))++ return SQLITE_OK } else { @@ -39846,7 +38110,6 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager - _ = libc.Int32FromInt32(0) if !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != libc.UintptrFromInt32(0)) || (*TPager)(unsafe.Pointer(pPager)).FdbSize < pgno || noContent != 0 { if pgno > (*TPager)(unsafe.Pointer(pPager)).FmxPgno { rc = int32(SQLITE_FULL) @@ -39870,9 +38133,8 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _addToSavepointBitvecs(tls, pPager, pgno) _sqlite3EndBenignMalloc(tls) } - libc.Xmemset(tls, (*TPgHdr)(unsafe.Pointer(pPg)).FpData, 0, uint32((*TPager)(unsafe.Pointer(pPager)).FpageSize)) + libc.Xmemset(tls, (*TPgHdr)(unsafe.Pointer(pPg)).FpData, 0, libc.Uint32FromInt64((*TPager)(unsafe.Pointer(pPager)).FpageSize)) } else { - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(pPager + 192 + 1*4))++ rc = _readDbPage(tls, pPg) if rc != SQLITE_OK { @@ -39884,7 +38146,6 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f goto pager_acquire_err pager_acquire_err: ; - _ = libc.Int32FromInt32(0) if pPg != 0 { _sqlite3PcacheDrop(tls, pPg) } @@ -39911,8 +38172,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** page 1 if there is no write-transaction open or the ACQUIRE_READONLY ** flag was specified by the caller. And so long as the db is not a ** temporary or in-memory database. */ - bMmapOk = libc.BoolInt32(pgno > uint32(1) && (int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_READER) || flags&int32(PAGER_GET_READONLY) != 0)) - _ = libc.Int32FromInt32(0) + bMmapOk = libc.BoolInt32(pgno > uint32(1) && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_READER) || flags&int32(PAGER_GET_READONLY) != 0)) /* Optimization note: Adding the "pgno<=1" term before "pgno==0" here ** allows the compiler optimizer to reuse the results of the "pgno>1" ** test in the previous statement, and avoid testing pgno==0 in the @@ -39920,10 +38180,6 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla if pgno <= uint32(1) && pgno == uint32(0) { return _sqlite3CorruptError(tls, int32(62747)) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+4) if rc != SQLITE_OK { @@ -39933,18 +38189,17 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla } if bMmapOk != 0 && *(*Tu32)(unsafe.Pointer(bp + 4)) == uint32(0) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - rc = _sqlite3OsFetch(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int64(pgno-libc.Uint32FromInt32(1))*(*TPager)(unsafe.Pointer(pPager)).FpageSize, int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), bp+8) + rc = _sqlite3OsFetch(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, libc.Int64FromUint32(pgno-libc.Uint32FromInt32(1))*(*TPager)(unsafe.Pointer(pPager)).FpageSize, int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), bp+8) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) > int32(PAGER_READER) || (*TPager)(unsafe.Pointer(pPager)).FtempFile != 0 { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) > int32(PAGER_READER) || (*TPager)(unsafe.Pointer(pPager)).FtempFile != 0 { *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PagerLookup(tls, pPager, pgno) } if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = _pagerAcquireMapPage(tls, pPager, pgno, *(*uintptr)(unsafe.Pointer(bp + 8)), bp) } else { - _sqlite3OsUnfetch(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int64(pgno-libc.Uint32FromInt32(1))*(*TPager)(unsafe.Pointer(pPager)).FpageSize, *(*uintptr)(unsafe.Pointer(bp + 8))) + _sqlite3OsUnfetch(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, libc.Int64FromUint32(pgno-libc.Uint32FromInt32(1))*(*TPager)(unsafe.Pointer(pPager)).FpageSize, *(*uintptr)(unsafe.Pointer(bp + 8))) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer(bp)) return SQLITE_OK } @@ -39963,7 +38218,6 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla func _getPageError(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, flags int32) (r int32) { _ = pgno _ = flags - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) return (*TPager)(unsafe.Pointer(pPager)).FerrCode } @@ -39993,11 +38247,7 @@ func _sqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, func _sqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno TPgno) (r uintptr) { var pPage uintptr _ = pPage - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pPage = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, 0) - _ = libc.Int32FromInt32(0) if pPage == uintptr(0) { return uintptr(0) } @@ -40021,15 +38271,14 @@ func _sqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno TPgno) (r uintptr) // ** pages reaches zero it drops the database lock. // */ func _sqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { - _ = libc.Int32FromInt32(0) - if int32((*TDbPage)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_MMAP) != 0 { - _ = libc.Int32FromInt32(0) /* Page1 is never memory mapped */ + if libc.Int32FromUint16((*TDbPage)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_MMAP) != 0 { + /* Page1 is never memory mapped */ _pagerReleaseMapPage(tls, pPg) } else { _sqlite3PcacheRelease(tls, pPg) } /* Do not use this routine to release the last reference to page1 */ - _ = libc.Int32FromInt32(0) /* tag-20230419-2 */ + /* tag-20230419-2 */ } func _sqlite3PagerUnref(tls *libc.TLS, pPg uintptr) { @@ -40041,9 +38290,7 @@ func _sqlite3PagerUnref(tls *libc.TLS, pPg uintptr) { func _sqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { var pPager uintptr _ = pPager - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Page1 is never memory mapped */ + /* Page1 is never memory mapped */ pPager = (*TDbPage)(unsafe.Pointer(pPg)).FpPager _sqlite3PcacheRelease(tls, pPg) _pagerUnlockIfUnused(tls, pPager) @@ -40079,23 +38326,20 @@ func _pager_open_journal(tls *libc.TLS, pPager uintptr) (r int32) { _, _, _, _ = flags, nSpill, pVfs, rc rc = SQLITE_OK /* Return code */ pVfs = (*TPager)(unsafe.Pointer(pPager)).FpVfs /* Local cache of vfs pointer */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If already in the error state, this function is a no-op. But on ** the other hand, this routine is never called if we are already in ** an error state. */ if (*TPager)(unsafe.Pointer(pPager)).FerrCode != 0 { return (*TPager)(unsafe.Pointer(pPager)).FerrCode } - if !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) && int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_OFF) { + if !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_OFF) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = _sqlite3BitvecCreate(tls, (*TPager)(unsafe.Pointer(pPager)).FdbSize) if (*TPager)(unsafe.Pointer(pPager)).FpInJournal == uintptr(0) { return int32(SQLITE_NOMEM) } /* Open the journal file if it is not already open. */ if !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != libc.UintptrFromInt32(0)) { - if int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_MEMORY) { _sqlite3MemJournalOpen(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } else { flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) @@ -40114,7 +38358,6 @@ func _pager_open_journal(tls *libc.TLS, pPager uintptr) (r int32) { rc = _sqlite3JournalOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, flags, nSpill) } } - _ = libc.Int32FromInt32(0) } /* Write the first journal header to the journal file and open ** the sub-journal if necessary. @@ -40133,7 +38376,6 @@ func _pager_open_journal(tls *libc.TLS, pPager uintptr) (r int32) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) (*TPager)(unsafe.Pointer(pPager)).FjournalOff = 0 } else { - _ = libc.Int32FromInt32(0) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_WRITER_CACHEMOD) } return rc @@ -40165,10 +38407,8 @@ func _sqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor if (*TPager)(unsafe.Pointer(pPager)).FerrCode != 0 { return (*TPager)(unsafe.Pointer(pPager)).FerrCode } - _ = libc.Int32FromInt32(0) - (*TPager)(unsafe.Pointer(pPager)).FsubjInMemory = uint8(subjInMemory) - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_READER) { - _ = libc.Int32FromInt32(0) + (*TPager)(unsafe.Pointer(pPager)).FsubjInMemory = libc.Uint8FromInt32(subjInMemory) + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_READER) { if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { /* If the pager is configured to use locking_mode=exclusive, and an ** exclusive lock on the database is not already held, obtain it now. @@ -40213,9 +38453,6 @@ func _sqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor (*TPager)(unsafe.Pointer(pPager)).FdbOrigSize = (*TPager)(unsafe.Pointer(pPager)).FdbSize (*TPager)(unsafe.Pointer(pPager)).FjournalOff = 0 } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } return rc } @@ -40236,8 +38473,6 @@ func _pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) (r int32) { /* We should never write to the journal file the page that ** contains the database locks. The following assert verifies ** that we do not. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pData2 = (*TPgHdr)(unsafe.Pointer(pPg)).FpData cksum = _pager_cksum(tls, pPager, pData2) /* Even if an IO or diskfull error occurs while journalling the @@ -40263,11 +38498,8 @@ func _pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) (r int32) { } *(*Ti64)(unsafe.Pointer(pPager + 76)) += int64(8) + (*TPager)(unsafe.Pointer(pPager)).FpageSize (*TPager)(unsafe.Pointer(pPager)).FnRec++ - _ = libc.Int32FromInt32(0) rc = _sqlite3BitvecSet(tls, (*TPager)(unsafe.Pointer(pPager)).FpInJournal, (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno) - _ = libc.Int32FromInt32(0) rc |= _addToSavepointBitvecs(tls, pPager, (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno) - _ = libc.Int32FromInt32(0) return rc } @@ -40290,10 +38522,6 @@ func _pager_write(tls *libc.TLS, pPg uintptr) (r int32) { ** been started. The journal file may or may not be open at this point. ** It is never called in the ERROR state. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The journal file needs to be opened. Higher level routines have already ** obtained the necessary locks to begin the write-transaction, but the ** rollback journal might not yet be open. Open it now if this is the case. @@ -40303,30 +38531,26 @@ func _pager_write(tls *libc.TLS, pPg uintptr) (r int32) { ** an error might occur and the pager would end up in WRITER_LOCKED state ** with pages marked as dirty in the cache. */ - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_WRITER_LOCKED) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_WRITER_LOCKED) { rc = _pager_open_journal(tls, pPager) if rc != SQLITE_OK { return rc } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Mark the page that is about to be modified as dirty. */ _sqlite3PcacheMakeDirty(tls, pPg) /* If a rollback journal is in use, them make sure the page that is about ** to change is in the rollback journal, or if the page is a new page off ** then end of the file, make sure it is marked as PGHDR_NEED_SYNC. */ - _ = libc.Int32FromInt32(0) if (*TPager)(unsafe.Pointer(pPager)).FpInJournal != uintptr(0) && _sqlite3BitvecTestNotNull(tls, (*TPager)(unsafe.Pointer(pPager)).FpInJournal, (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno) == 0 { - _ = libc.Int32FromInt32(0) if (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno <= (*TPager)(unsafe.Pointer(pPager)).FdbOrigSize { rc = _pagerAddPageToRollbackJournal(tls, pPg) if rc != SQLITE_OK { return rc } } else { - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) != int32(PAGER_WRITER_DBMOD) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) != int32(PAGER_WRITER_DBMOD) { p1 = pPg + 28 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(PGHDR_NEED_SYNC)) } @@ -40377,13 +38601,11 @@ func _pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) (r int32) { nPage = 0 /* Loop counter */ needSync = 0 /* True if any page has PGHDR_NEED_SYNC */ pPager = (*TPgHdr)(unsafe.Pointer(pPg)).FpPager /* The pager that owns pPg */ - nPagePerSector = uint32(int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize) / (*TPager)(unsafe.Pointer(pPager)).FpageSize) + nPagePerSector = libc.Uint32FromInt64(libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize) / (*TPager)(unsafe.Pointer(pPager)).FpageSize) /* Set the doNotSpill NOSYNC bit to 1. This is because we cannot allow ** a journal header to be written between the pages journaled by ** this function. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p1 = pPager + 21 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(SPILLFLAG_NOSYNC)) /* This trick assumes that both the page-size and sector-size are @@ -40393,29 +38615,26 @@ func _pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) (r int32) { pg1 = ((*TPgHdr)(unsafe.Pointer(pPg)).Fpgno-uint32(1)) & ^(nPagePerSector-libc.Uint32FromInt32(1)) + uint32(1) nPageCount = (*TPager)(unsafe.Pointer(pPager)).FdbSize if (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno > nPageCount { - nPage = int32((*TPgHdr)(unsafe.Pointer(pPg)).Fpgno - pg1 + uint32(1)) + nPage = libc.Int32FromUint32((*TPgHdr)(unsafe.Pointer(pPg)).Fpgno - pg1 + uint32(1)) } else { if pg1+nPagePerSector-uint32(1) > nPageCount { - nPage = int32(nPageCount + uint32(1) - pg1) + nPage = libc.Int32FromUint32(nPageCount + uint32(1) - pg1) } else { - nPage = int32(nPagePerSector) + nPage = libc.Int32FromUint32(nPagePerSector) } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) ii = 0 for { if !(ii < nPage && rc == SQLITE_OK) { break } - pg = pg1 + uint32(ii) + pg = pg1 + libc.Uint32FromInt32(ii) if pg == (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno || !(_sqlite3BitvecTest(tls, (*TPager)(unsafe.Pointer(pPager)).FpInJournal, pg) != 0) { if pg != (*TPager)(unsafe.Pointer(pPager)).FlckPgno { rc = _sqlite3PagerGet(tls, pPager, pg, bp, 0) if rc == SQLITE_OK { rc = _pager_write(tls, *(*uintptr)(unsafe.Pointer(bp))) - if int32((*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&int32(PGHDR_NEED_SYNC) != 0 { + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&int32(PGHDR_NEED_SYNC) != 0 { needSync = int32(1) } _sqlite3PagerUnrefNotNull(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -40425,7 +38644,7 @@ func _pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) (r int32) { v3 = _sqlite3PagerLookup(tls, pPager, pg) *(*uintptr)(unsafe.Pointer(bp)) = v3 if v3 != uintptr(0) { - if int32((*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&int32(PGHDR_NEED_SYNC) != 0 { + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&int32(PGHDR_NEED_SYNC) != 0 { needSync = int32(1) } _sqlite3PagerUnrefNotNull(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -40443,13 +38662,12 @@ func _pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) (r int32) { ** before any of them can be written out to the database file. */ if rc == SQLITE_OK && needSync != 0 { - _ = libc.Int32FromInt32(0) ii = 0 for { if !(ii < nPage) { break } - pPage1 = _sqlite3PagerLookup(tls, pPager, pg1+uint32(ii)) + pPage1 = _sqlite3PagerLookup(tls, pPager, pg1+libc.Uint32FromInt32(ii)) if pPage1 != 0 { p5 = pPage1 + 28 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -40461,7 +38679,6 @@ func _pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) (r int32) { ii++ } } - _ = libc.Int32FromInt32(0) p6 = pPager + 21 *(*Tu8)(unsafe.Pointer(p6)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p6))) & ^libc.Int32FromInt32(SPILLFLAG_NOSYNC)) return rc @@ -40487,10 +38704,7 @@ func _sqlite3PagerWrite(tls *libc.TLS, pPg uintptr) (r int32) { var pPager uintptr _ = pPager pPager = (*TPgHdr)(unsafe.Pointer(pPg)).FpPager - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_WRITEABLE) != 0 && (*TPager)(unsafe.Pointer(pPager)).FdbSize >= (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno { + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_WRITEABLE) != 0 && (*TPager)(unsafe.Pointer(pPager)).FdbSize >= (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno { if (*TPager)(unsafe.Pointer(pPager)).FnSavepoint != 0 { return _subjournalPageIfRequired(tls, pPg) } @@ -40499,8 +38713,7 @@ func _sqlite3PagerWrite(tls *libc.TLS, pPg uintptr) (r int32) { if (*TPager)(unsafe.Pointer(pPager)).FerrCode != 0 { return (*TPager)(unsafe.Pointer(pPager)).FerrCode } else { - if (*TPager)(unsafe.Pointer(pPager)).FsectorSize > uint32((*TPager)(unsafe.Pointer(pPager)).FpageSize) { - _ = libc.Int32FromInt32(0) + if (*TPager)(unsafe.Pointer(pPager)).FsectorSize > libc.Uint32FromInt64((*TPager)(unsafe.Pointer(pPager)).FpageSize) { return _pagerWriteLargeSector(tls, pPg) } else { return _pager_write(tls, pPg) @@ -40542,7 +38755,7 @@ func _sqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { var pPager, p1, p2 uintptr _, _, _ = pPager, p1, p2 pPager = (*TPgHdr)(unsafe.Pointer(pPg)).FpPager - if !((*TPager)(unsafe.Pointer(pPager)).FtempFile != 0) && int32((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_DIRTY) != 0 && (*TPager)(unsafe.Pointer(pPager)).FnSavepoint == 0 { + if !((*TPager)(unsafe.Pointer(pPager)).FtempFile != 0) && libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_DIRTY) != 0 && (*TPager)(unsafe.Pointer(pPager)).FnSavepoint == 0 { p1 = pPg + 28 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(PGHDR_DONT_WRITE)) p2 = pPg + 28 @@ -40582,8 +38795,6 @@ func _pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32 var _ /* pPgHdr at bp+0 */ uintptr _, _, _ = pCopy, rc, zBuf rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Declare and initialize constant integer 'isDirect'. If the ** atomic-write optimization is enabled in this build, then isDirect ** is initialized to the value passed as the isDirectMode parameter @@ -40594,13 +38805,10 @@ func _pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32 ** 'isDirect' below, as well as the block enclosed in the ** "if( isDirect )" condition. */ - _ = libc.Int32FromInt32(0) _ = isDirectMode if !((*TPager)(unsafe.Pointer(pPager)).FchangeCountDone != 0) && (*TPager)(unsafe.Pointer(pPager)).FdbSize > uint32(0) { /* Reference to page 1 */ - _ = libc.Int32FromInt32(0) /* Open page 1 of the file for writing. */ rc = _sqlite3PagerGet(tls, pPager, uint32(1), bp, 0) - _ = libc.Int32FromInt32(0) /* If page one was fetched successfully, and this function is not ** operating in direct-mode, make page 1 writable. When not in ** direct mode, page 1 is always held in cache and hence the PagerGet() @@ -40614,7 +38822,6 @@ func _pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32 _pager_write_changecounter(tls, *(*uintptr)(unsafe.Pointer(bp))) /* If running in direct mode, write the contents of page 1 to the file. */ if DIRECT_MODE != 0 { - _ = libc.Int32FromInt32(0) zBuf = (*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpData if rc == SQLITE_OK { rc = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, zBuf, int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), 0) @@ -40658,8 +38865,7 @@ func _sqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) rc = SQLITE_OK } if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FnoSync != 0) { - _ = libc.Int32FromInt32(0) - rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) + rc = _sqlite3OsSync(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsyncFlags)) } return rc } @@ -40681,10 +38887,7 @@ func _sqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) (r int32) { var rc int32 _ = rc rc = (*TPager)(unsafe.Pointer(pPager)).FerrCode - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if 0 == libc.BoolInt32((*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) { rc = _pager_wait_on_lock(tls, pPager, int32(EXCLUSIVE_LOCK)) } @@ -40729,8 +38932,6 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, var _ /* pPageOne at bp+0 */ uintptr _, _, _ = nNew, pList, rc rc = SQLITE_OK /* Return code */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If a prior error occurred, report that error again. */ if (*TPager)(unsafe.Pointer(pPager)).FerrCode != 0 { return (*TPager)(unsafe.Pointer(pPager)).FerrCode @@ -40740,11 +38941,9 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, return int32(SQLITE_IOERR) } /* If no database changes have been made, return early. */ - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) < int32(PAGER_WRITER_CACHEMOD) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) < int32(PAGER_WRITER_CACHEMOD) { return SQLITE_OK } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if 0 == _pagerFlushOnCommit(tls, pPager, int32(1)) { /* If this is an in-memory db, or no pages have been written to, or this ** function has already been called, it is mostly a no-op. However, any @@ -40761,7 +38960,6 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, pList = *(*uintptr)(unsafe.Pointer(bp)) (*TPgHdr)(unsafe.Pointer(pList)).FpDirty = uintptr(0) } - _ = libc.Int32FromInt32(0) if pList != 0 { rc = _pagerWalFrames(tls, pPager, pList, (*TPager)(unsafe.Pointer(pPager)).FdbSize, int32(1)) } @@ -40806,7 +39004,6 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, rc = _pager_write_pagelist(tls, pPager, pList) } if rc != SQLITE_OK { - _ = libc.Int32FromInt32(0) goto commit_phase_one_exit } _sqlite3PcacheCleanAll(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache) @@ -40818,7 +39015,6 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, ** undersized. Fix this now if it is the case. */ if (*TPager)(unsafe.Pointer(pPager)).FdbSize > (*TPager)(unsafe.Pointer(pPager)).FdbFileSize { nNew = (*TPager)(unsafe.Pointer(pPager)).FdbSize - libc.BoolUint32((*TPager)(unsafe.Pointer(pPager)).FdbSize == (*TPager)(unsafe.Pointer(pPager)).FlckPgno) - _ = libc.Int32FromInt32(0) rc = _pager_truncate(tls, pPager, nNew) if rc != SQLITE_OK { goto commit_phase_one_exit @@ -40867,8 +39063,6 @@ func _sqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) (r int32) { return (*TPager)(unsafe.Pointer(pPager)).FerrCode } (*TPager)(unsafe.Pointer(pPager)).FiDataVersion++ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* An optimization. If the database was not actually modified during ** this transaction, the pager is running in exclusive-mode and is ** using persistent journals, then this function is a no-op. @@ -40880,12 +39074,11 @@ func _sqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) (r int32) { ** header. Since the pager is in exclusive mode, there is no need ** to drop any locks either. */ - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_WRITER_LOCKED) && (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_PERSIST) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_WRITER_LOCKED) && (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_PERSIST) { (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_READER) return SQLITE_OK } - rc = _pager_end_transaction(tls, pPager, int32((*TPager)(unsafe.Pointer(pPager)).FsetSuper), int32(1)) + rc = _pager_end_transaction(tls, pPager, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsetSuper), int32(1)) return _pager_error(tls, pPager, rc) } @@ -40925,22 +39118,21 @@ func _sqlite3PagerRollback(tls *libc.TLS, pPager uintptr) (r int32) { ** the pager is already in the ERROR state, the rollback is not ** attempted here. Instead, the error code is returned to the caller. */ - _ = libc.Int32FromInt32(0) - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { return (*TPager)(unsafe.Pointer(pPager)).FerrCode } - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) <= int32(PAGER_READER) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) <= int32(PAGER_READER) { return SQLITE_OK } if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3PagerSavepoint(tls, pPager, int32(SAVEPOINT_ROLLBACK), -int32(1)) - rc2 = _pager_end_transaction(tls, pPager, int32((*TPager)(unsafe.Pointer(pPager)).FsetSuper), 0) + rc2 = _pager_end_transaction(tls, pPager, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FsetSuper), 0) if rc == SQLITE_OK { rc = rc2 } } else { - if !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != libc.UintptrFromInt32(0)) || int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_WRITER_LOCKED) { - eState = int32((*TPager)(unsafe.Pointer(pPager)).FeState) + if !((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != libc.UintptrFromInt32(0)) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_WRITER_LOCKED) { + eState = libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) rc = _pager_end_transaction(tls, pPager, 0, 0) if !((*TPager)(unsafe.Pointer(pPager)).FmemDb != 0) && eState > int32(PAGER_WRITER_LOCKED) { /* This can happen using journal_mode=off. Move the pager to the error @@ -40956,8 +39148,6 @@ func _sqlite3PagerRollback(tls *libc.TLS, pPager uintptr) (r int32) { rc = _pager_playback(tls, pPager, 0) } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If an error occurs during a ROLLBACK, we can no longer trust the pager ** cache. So call pager_error() on the way out to make any error persistent. */ @@ -40983,7 +39173,7 @@ func _sqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) (r Tu8) { func _sqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) (r int32) { var perPageSize int32 _ = perPageSize - perPageSize = int32((*TPager)(unsafe.Pointer(pPager)).FpageSize + int64((*TPager)(unsafe.Pointer(pPager)).FnExtra) + int64(int32(libc.Uint32FromInt64(48)+libc.Uint32FromInt32(5)*libc.Uint32FromInt64(4)))) + perPageSize = int32((*TPager)(unsafe.Pointer(pPager)).FpageSize + libc.Int64FromUint16((*TPager)(unsafe.Pointer(pPager)).FnExtra) + int64(libc.Int32FromUint32(libc.Uint32FromInt64(48)+libc.Uint32FromInt32(5)*libc.Uint32FromInt64(4)))) return int32(int64(perPageSize*_sqlite3PcachePagecount(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache)+_sqlite3MallocSize(tls, pPager)) + (*TPager)(unsafe.Pointer(pPager)).FpageSize) } @@ -41010,10 +39200,6 @@ func _sqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) (r int32) { // ** returning. // */ func _sqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) eStat -= int32(SQLITE_DBSTATUS_CACHE_HIT) *(*Tu64)(unsafe.Pointer(pnVal)) += uint64(*(*Tu32)(unsafe.Pointer(pPager + 192 + uintptr(eStat)*4))) if reset != 0 { @@ -41048,18 +39234,15 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int _, _, _, _ = aNew, ii, nCurrent, rc rc = SQLITE_OK /* Return code */ nCurrent = (*TPager)(unsafe.Pointer(pPager)).FnSavepoint /* New Pager.aSavepoint array */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Grow the Pager.aSavepoint array using realloc(). Return SQLITE_NOMEM ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint32(48)*uint32(nSavepoint))) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint32(48)*libc.Uint32FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, aNew+uintptr(nCurrent)*48, 0, uint32(nSavepoint-nCurrent)*uint32(48)) + libc.Xmemset(tls, aNew+uintptr(nCurrent)*48, 0, libc.Uint32FromInt32(nSavepoint-nCurrent)*uint32(48)) (*TPager)(unsafe.Pointer(pPager)).FaSavepoint = aNew /* Populate the PagerSavepoint structures just allocated. */ ii = nCurrent @@ -41071,7 +39254,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && (*TPager)(unsafe.Pointer(pPager)).FjournalOff > 0 { (*(*TPagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48))).FiOffset = (*TPager)(unsafe.Pointer(pPager)).FjournalOff } else { - (*(*TPagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48))).FiOffset = int64((*TPager)(unsafe.Pointer(pPager)).FsectorSize) + (*(*TPagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48))).FiOffset = libc.Int64FromUint32((*TPager)(unsafe.Pointer(pPager)).FsectorSize) } (*(*TPagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48))).FiSubRec = (*TPager)(unsafe.Pointer(pPager)).FnSubRec (*(*TPagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48))).FpInSavepoint = _sqlite3BitvecCreate(tls, (*TPager)(unsafe.Pointer(pPager)).FdbSize) @@ -41088,13 +39271,10 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ; ii++ } - _ = libc.Int32FromInt32(0) return rc } func _sqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if nSavepoint > (*TPager)(unsafe.Pointer(pPager)).FnSavepoint && (*TPager)(unsafe.Pointer(pPager)).FuseJournal != 0 { return _pagerOpenSavepoint(tls, pPager, nSavepoint) } else { @@ -41141,8 +39321,6 @@ func _sqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint var sz Ti64 _, _, _, _, _, _, _, _ = ii, nNew, pRel, pSavepoint, rc, sz, v1, v3 rc = (*TPager)(unsafe.Pointer(pPager)).FerrCode - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK && iSavepoint < (*TPager)(unsafe.Pointer(pPager)).FnSavepoint { /* Number of remaining savepoints after this op. */ /* Figure out how many savepoints will still be active after this ** operation. Store this value in nNew. Then free resources associated @@ -41173,9 +39351,8 @@ func _sqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint if (*TPagerSavepoint)(unsafe.Pointer(pRel)).FbTruncateOnRelease != 0 && (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fsjfd)).FpMethods != uintptr(0) { /* Only truncate if it is an in-memory sub-journal. */ if _sqlite3JournalIsInMemory(tls, (*TPager)(unsafe.Pointer(pPager)).Fsjfd) != 0 { - sz = ((*TPager)(unsafe.Pointer(pPager)).FpageSize + int64(4)) * int64((*TPagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec) + sz = ((*TPager)(unsafe.Pointer(pPager)).FpageSize + int64(4)) * libc.Int64FromUint32((*TPagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec) rc = _sqlite3OsTruncate(tls, (*TPager)(unsafe.Pointer(pPager)).Fsjfd, sz) - _ = libc.Int32FromInt32(0) } (*TPager)(unsafe.Pointer(pPager)).FnSubRec = (*TPagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec } @@ -41188,7 +39365,6 @@ func _sqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint } pSavepoint = v3 rc = _pagerPlaybackSavepoint(tls, pPager, pSavepoint) - _ = libc.Int32FromInt32(0) } } } @@ -41304,13 +39480,9 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn var _ /* pPgHdr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _ = needSyncPgno, origPgno, pPgOld, rc, v1, v2, p3, p4, p5 /* The page being overwritten. */ needSyncPgno = uint32(0) /* The original page number */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* In order to be able to rollback, an in-memory database must journal ** the page we are moving from. */ - _ = libc.Int32FromInt32(0) if (*TPager)(unsafe.Pointer(pPager)).FtempFile != 0 { rc = _sqlite3PagerWrite(tls, pPg) if rc != 0 { @@ -41335,7 +39507,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn ** one or more savepoint bitvecs. This is the reason this function ** may return SQLITE_NOMEM. */ - if v2 = int32((*TDbPage)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_DIRTY) != 0; v2 { + if v2 = libc.Int32FromUint16((*TDbPage)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_DIRTY) != 0; v2 { v1 = _subjournalPageIfRequired(tls, pPg) rc = v1 } @@ -41349,10 +39521,8 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn ** the journal needs to be sync()ed before database page pPg->pgno ** can be written to. The caller has already promised not to write to it. */ - if int32((*TDbPage)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_NEED_SYNC) != 0 && !(isCommit != 0) { + if libc.Int32FromUint16((*TDbPage)(unsafe.Pointer(pPg)).Fflags)&int32(PGHDR_NEED_SYNC) != 0 && !(isCommit != 0) { needSyncPgno = (*TDbPage)(unsafe.Pointer(pPg)).Fpgno - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } /* If the cache contains a page with page-number pgno, remove it ** from its hash chain. Also, if the PGHDR_NEED_SYNC flag was set for @@ -41362,14 +39532,13 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn p3 = pPg + 28 *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^libc.Int32FromInt32(PGHDR_NEED_SYNC)) pPgOld = _sqlite3PagerLookup(tls, pPager, pgno) - _ = libc.Int32FromInt32(0) if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) return _sqlite3CorruptError(tls, int32(64313)) } p4 = pPg + 28 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | int32((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) + *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) if (*TPager)(unsafe.Pointer(pPager)).FtempFile != 0 { /* Do not discard pages from an in-memory database since we might ** need to rollback later. Just move the page out of the way. */ @@ -41393,7 +39562,6 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn rc = _sqlite3PagerGet(tls, pPager, needSyncPgno, bp, 0) if rc != SQLITE_OK { if needSyncPgno <= (*TPager)(unsafe.Pointer(pPager)).FdbOrigSize { - _ = libc.Int32FromInt32(0) _sqlite3BitvecClear(tls, (*TPager)(unsafe.Pointer(pPager)).FpInJournal, needSyncPgno, (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace) } return rc @@ -41415,7 +39583,6 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn // ** the value passed as the third parameter. // */ func _sqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew TPgno, flags Tu16) { - _ = libc.Int32FromInt32(0) (*TDbPage)(unsafe.Pointer(pPg)).Fflags = flags _sqlite3PcacheMove(tls, pPg, iNew) } @@ -41426,7 +39593,6 @@ func _sqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew TPgno, flags Tu16) { // ** Return a pointer to the data for the specified page. // */ func _sqlite3PagerGetData(tls *libc.TLS, pPg uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) return (*TDbPage)(unsafe.Pointer(pPg)).FpData } @@ -41453,14 +39619,10 @@ func _sqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) (r uintptr) { // ** locking-mode. // */ func _sqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if eMode >= 0 && !((*TPager)(unsafe.Pointer(pPager)).FtempFile != 0) && !(_sqlite3WalHeapMemory(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) != 0) { - (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode = uint8(eMode) + (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode = libc.Uint8FromInt32(eMode) } - return int32((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode) + return libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode) } // C documentation @@ -41491,37 +39653,26 @@ func _sqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) (r _, _, _ = eOld, rc, state eOld = (*TPager)(unsafe.Pointer(pPager)).FjournalMode /* Prior journalmode */ /* The eMode parameter is always valid */ - _ = libc.Int32FromInt32(0) /* This routine is only called from the OP_JournalMode opcode, and ** the logic there will never allow a temporary file to be changed ** to WAL mode. */ - _ = libc.Int32FromInt32(0) /* Do allow the journalmode of an in-memory database to be set to ** anything other than MEMORY or OFF */ if (*TPager)(unsafe.Pointer(pPager)).FmemDb != 0 { - _ = libc.Int32FromInt32(0) if eMode != int32(PAGER_JOURNALMODE_MEMORY) && eMode != int32(PAGER_JOURNALMODE_OFF) { - eMode = int32(eOld) + eMode = libc.Int32FromUint8(eOld) } } - if eMode != int32(eOld) { + if eMode != libc.Int32FromUint8(eOld) { /* Change the journal mode. */ - _ = libc.Int32FromInt32(0) - (*TPager)(unsafe.Pointer(pPager)).FjournalMode = uint8(eMode) + (*TPager)(unsafe.Pointer(pPager)).FjournalMode = libc.Uint8FromInt32(eMode) /* When transitioning from TRUNCATE or PERSIST to any other journal ** mode except WAL, unless the pager is in locking_mode=exclusive mode, ** delete the journal file. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if !((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) && int32(eOld)&int32(5) == int32(1) && eMode&int32(1) == 0 { + if !((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) && libc.Int32FromUint8(eOld)&int32(5) == int32(1) && eMode&int32(1) == 0 { /* In this case we would like to delete the journal file. If it is ** not possible, then that is not a problem. Deleting the journal file ** here is an optimization only. @@ -41531,17 +39682,15 @@ func _sqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) (r ** while it is in use by some other client. */ _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) - if int32((*TPager)(unsafe.Pointer(pPager)).FeLock) >= int32(RESERVED_LOCK) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeLock) >= int32(RESERVED_LOCK) { _sqlite3OsDelete(tls, (*TPager)(unsafe.Pointer(pPager)).FpVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, 0) } else { rc = SQLITE_OK - state = int32((*TPager)(unsafe.Pointer(pPager)).FeState) - _ = libc.Int32FromInt32(0) + state = libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) if state == PAGER_OPEN { rc = _sqlite3PagerSharedLock(tls, pPager) } - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_READER) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_READER) { rc = _pagerLockDb(tls, pPager, int32(RESERVED_LOCK)) } if rc == SQLITE_OK { @@ -41554,7 +39703,6 @@ func _sqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) (r _pager_unlock(tls, pPager) } } - _ = libc.Int32FromInt32(0) } } else { if eMode == int32(PAGER_JOURNALMODE_OFF) || eMode == int32(PAGER_JOURNALMODE_MEMORY) { @@ -41563,7 +39711,7 @@ func _sqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) (r } } /* Return the new journal mode */ - return int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) + return libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) } // C documentation @@ -41572,7 +39720,7 @@ func _sqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) (r // ** Return the current journal mode. // */ func _sqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) (r int32) { - return int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) + return libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) } // C documentation @@ -41583,8 +39731,7 @@ func _sqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) (r int32) { // ** is unmodified. // */ func _sqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - if int32((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_CACHEMOD) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_CACHEMOD) { return 0 } if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && (*TPager)(unsafe.Pointer(pPager)).FjournalOff > 0 { @@ -41627,8 +39774,7 @@ func _sqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) (r uintptr) { // ** Unless this is an in-memory or temporary database, clear the pager cache. // */ func _sqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { - _ = libc.Int32FromInt32(0) - if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 { _pager_reset(tls, pPager) } } @@ -41647,7 +39793,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in var v1 uintptr _, _ = rc, v1 rc = SQLITE_OK - if (*TPager)(unsafe.Pointer(pPager)).FpWal == uintptr(0) && int32((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_WAL) { + if (*TPager)(unsafe.Pointer(pPager)).FpWal == uintptr(0) && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_WAL) { /* This only happens when a database file is zero bytes in size opened and ** then "PRAGMA journal_mode=WAL" is run and then sqlite3_wal_checkpoint() ** is invoked without any intervening transactions. We need to start @@ -41665,7 +39811,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in } else { v1 = (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler } - rc = _sqlite3WalCheckpoint(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, db, eMode, v1, (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg, int32((*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace, pnLog, pnCkpt) + rc = _sqlite3WalCheckpoint(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, db, eMode, v1, (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace, pnLog, pnCkpt) } return rc } @@ -41700,13 +39846,12 @@ func _pagerExclusiveLock(tls *libc.TLS, pPager uintptr) (r int32) { var eOrigLock Tu8 var rc int32 _, _ = eOrigLock, rc /* Original lock */ - _ = libc.Int32FromInt32(0) eOrigLock = (*TPager)(unsafe.Pointer(pPager)).FeLock rc = _pagerLockDb(tls, pPager, int32(EXCLUSIVE_LOCK)) if rc != SQLITE_OK { /* If the attempt to grab the exclusive lock failed, release the ** pending lock that may have been obtained instead. */ - _pagerUnlockDb(tls, pPager, int32(eOrigLock)) + _pagerUnlockDb(tls, pPager, libc.Int32FromUint8(eOrigLock)) } return rc } @@ -41723,8 +39868,6 @@ func _pagerOpenWal(tls *libc.TLS, pPager uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the pager is already in exclusive-mode, the WAL module will use ** heap-memory for the wal-index instead of the VFS shared-memory ** implementation. Take the exclusive lock now, before opening the WAL @@ -41737,7 +39880,7 @@ func _pagerOpenWal(tls *libc.TLS, pPager uintptr) (r int32) { ** (e.g. due to malloc() failure), return an error code. */ if rc == SQLITE_OK { - rc = _sqlite3WalOpen(tls, (*TPager)(unsafe.Pointer(pPager)).FpVfs, (*TPager)(unsafe.Pointer(pPager)).Ffd, (*TPager)(unsafe.Pointer(pPager)).FzWal, int32((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode), (*TPager)(unsafe.Pointer(pPager)).FjournalSizeLimit, pPager+224) + rc = _sqlite3WalOpen(tls, (*TPager)(unsafe.Pointer(pPager)).FpVfs, (*TPager)(unsafe.Pointer(pPager)).Ffd, (*TPager)(unsafe.Pointer(pPager)).FzWal, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode), (*TPager)(unsafe.Pointer(pPager)).FjournalSizeLimit, pPager+224) } _pagerFixMaplimit(tls, pPager) return rc @@ -41764,11 +39907,6 @@ func _sqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) (r int3 var rc int32 _ = rc rc = SQLITE_OK /* Return code */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if !((*TPager)(unsafe.Pointer(pPager)).FtempFile != 0) && !((*TPager)(unsafe.Pointer(pPager)).FpWal != 0) { if !(_sqlite3PagerWalSupported(tls, pPager) != 0) { return int32(SQLITE_CANTOPEN) @@ -41804,7 +39942,6 @@ func _sqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) (r int32) var _ /* logexists at bp+0 */ int32 _ = rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) /* If the log file is not already open, but does exist in the file-system, ** it may need to be checkpointed before the connection can switch to ** rollback mode. Open it now so this can happen. @@ -41825,7 +39962,7 @@ func _sqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) (r int32) if rc == SQLITE_OK && (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { rc = _pagerExclusiveLock(tls, pPager) if rc == SQLITE_OK { - rc = _sqlite3WalClose(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, db, int32((*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace) + rc = _sqlite3WalClose(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, db, libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*TPager)(unsafe.Pointer(pPager)).FpageSize), (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace) (*TPager)(unsafe.Pointer(pPager)).FpWal = uintptr(0) _pagerFixMaplimit(tls, pPager) if rc != 0 && !((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) { @@ -41920,7 +40057,6 @@ func _sqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr // ** sqlite3PagerSnapshotCheck(). // */ func _sqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { - _ = libc.Int32FromInt32(0) _sqlite3WalSnapshotUnlock(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) } @@ -42566,26 +40702,24 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = int64(uint32(4) * uint32(iPage+libc.Int32FromInt32(1))) - apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(4) * libc.Uint32FromInt32(iPage+libc.Int32FromInt32(1))) + apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, apNew+uintptr((*TWal)(unsafe.Pointer(pWal)).FnWiData)*4, 0, uint32(4)*uint32(iPage+libc.Int32FromInt32(1)-(*TWal)(unsafe.Pointer(pWal)).FnWiData)) + libc.Xmemset(tls, apNew+uintptr((*TWal)(unsafe.Pointer(pWal)).FnWiData)*4, 0, uint32(4)*libc.Uint32FromInt32(iPage+libc.Int32FromInt32(1)-(*TWal)(unsafe.Pointer(pWal)).FnWiData)) (*TWal)(unsafe.Pointer(pWal)).FapWiData = apNew (*TWal)(unsafe.Pointer(pWal)).FnWiData = iPage + int32(1) } /* Request a pointer to the required page from the VFS */ - _ = libc.Int32FromInt32(0) - if int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4)) = _sqlite3MallocZero(tls, uint64(libc.Uint32FromInt64(2)*uint32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4))) + if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4)) = _sqlite3MallocZero(tls, uint64(libc.Uint32FromInt64(2)*libc.Uint32FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4)) != 0) { rc = int32(SQLITE_NOMEM) } } else { - rc = _sqlite3OsShmMap(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, iPage, int32(libc.Uint32FromInt64(2)*uint32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4)), int32((*TWal)(unsafe.Pointer(pWal)).FwriteLock), (*TWal)(unsafe.Pointer(pWal)).FapWiData+uintptr(iPage)*4) - _ = libc.Int32FromInt32(0) + rc = _sqlite3OsShmMap(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, iPage, libc.Int32FromUint32(libc.Uint32FromInt64(2)*libc.Uint32FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4)), libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FwriteLock), (*TWal)(unsafe.Pointer(pWal)).FapWiData+uintptr(iPage)*4) if rc == SQLITE_OK { if iPage > 0 && _sqlite3FaultSim(tls, int32(600)) != 0 { rc = int32(SQLITE_NOMEM) @@ -42601,7 +40735,6 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } } *(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4)) - _ = libc.Int32FromInt32(0) return rc } @@ -42609,7 +40742,6 @@ func _walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) (r var v1 uintptr var v2 bool _, _ = v1, v2 - _ = libc.Int32FromInt32(0) if v2 = (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage; !v2 { v1 = *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4)) *(*uintptr)(unsafe.Pointer(ppPage)) = v1 @@ -42626,8 +40758,6 @@ func _walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) (r // ** Return a pointer to the WalCkptInfo structure in the wal-index. // */ func _walCkptInfo(tls *libc.TLS, pWal uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr(libc.Uint32FromInt64(48)/libc.Uint32FromInt32(2))*4 } @@ -42637,8 +40767,6 @@ func _walCkptInfo(tls *libc.TLS, pWal uintptr) (r uintptr) { // ** Return a pointer to the WalIndexHdr structure in the wal-index. // */ func _walIndexHdr(tls *libc.TLS, pWal uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData)) } @@ -42675,10 +40803,6 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<<int32(24) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0x0000FF00)<<int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0x00FF0000)>>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -42748,7 +40872,6 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, } } } - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(aOut)) = s1 *(*Tu32)(unsafe.Pointer(aOut + 1*4)) = s2 } @@ -42760,7 +40883,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, // ** from multiple threads and/or processes, then do a memory barrier. // */ func _walShmBarrier(tls *libc.TLS, pWal uintptr) { - if int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) != int32(WAL_HEAPMEMORY_MODE) { + if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) != int32(WAL_HEAPMEMORY_MODE) { _sqlite3OsShmBarrier(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd) } } @@ -42785,8 +40908,7 @@ func _walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { var nCksum int32 _, _ = aHdr, nCksum aHdr = _walIndexHdr(tls, pWal) - nCksum = int32(uint32(libc.UintptrFromInt32(0) + 40)) - _ = libc.Int32FromInt32(0) + nCksum = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0) + 40)) (*TWal)(unsafe.Pointer(pWal)).Fhdr.FisInit = uint8(1) (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = uint32(WALINDEX_MAX_VERSION) _walChecksumBytes(tls, int32(1), pWal+52, nCksum, uintptr(0), pWal+52+40) @@ -42816,14 +40938,13 @@ func _walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage Tu32, nTruncate Tu32, aD var nativeCksum int32 _, _ = aCksum, nativeCksum /* True for native byte-order checksums */ aCksum = pWal + 52 + 24 - _ = libc.Int32FromInt32(0) _sqlite3Put4byte(tls, aFrame, iPage) _sqlite3Put4byte(tls, aFrame+4, nTruncate) if (*TWal)(unsafe.Pointer(pWal)).FiReCksum == uint32(0) { libc.Xmemcpy(tls, aFrame+8, pWal+52+32, uint32(8)) - nativeCksum = libc.BoolInt32(int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN) + nativeCksum = libc.BoolInt32(libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN) _walChecksumBytes(tls, nativeCksum, aFrame, int32(8), aCksum, aCksum) - _walChecksumBytes(tls, nativeCksum, aData, int32((*TWal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum) + _walChecksumBytes(tls, nativeCksum, aData, libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum) _sqlite3Put4byte(tls, aFrame+16, *(*Tu32)(unsafe.Pointer(aCksum))) _sqlite3Put4byte(tls, aFrame+20, *(*Tu32)(unsafe.Pointer(aCksum + 1*4))) } else { @@ -42844,7 +40965,6 @@ func _walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uin var pgno Tu32 _, _, _ = aCksum, nativeCksum, pgno /* True for native byte-order checksums */ aCksum = pWal + 52 + 24 /* Page number of the frame */ - _ = libc.Int32FromInt32(0) /* A frame is only valid if the salt values in the frame-header ** match the salt values in the wal-header. */ @@ -42862,9 +40982,9 @@ func _walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uin ** and the frame-data matches the checksum in the last 8 ** bytes of this frame-header. */ - nativeCksum = libc.BoolInt32(int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN) + nativeCksum = libc.BoolInt32(libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN) _walChecksumBytes(tls, nativeCksum, aFrame, int32(8), aCksum, aCksum) - _walChecksumBytes(tls, nativeCksum, aData, int32((*TWal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum) + _walChecksumBytes(tls, nativeCksum, aData, libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum) if *(*Tu32)(unsafe.Pointer(aCksum)) != _sqlite3Get4byte(tls, aFrame+16) || *(*Tu32)(unsafe.Pointer(aCksum + 1*4)) != _sqlite3Get4byte(tls, aFrame+20) { /* Checksum failed. */ return 0 @@ -42928,9 +41048,7 @@ func _walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { // ** the hash to the next value in the event of a collision. // */ func _walHash(tls *libc.TLS, iPage Tu32) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - return int32(iPage * uint32(HASHTABLE_HASH_1) & uint32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2)-libc.Int32FromInt32(1))) + return libc.Int32FromUint32(iPage * uint32(HASHTABLE_HASH_1) & libc.Uint32FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2)-libc.Int32FromInt32(1))) } func _walNextHash(tls *libc.TLS, iPriorHash int32) (r int32) { @@ -42980,14 +41098,13 @@ func _walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) (r int3 var rc int32 _ = rc /* Return code */ rc = _walIndexPage(tls, pWal, iHash, pLoc+4) - _ = libc.Int32FromInt32(0) if (*TWalHashLoc)(unsafe.Pointer(pLoc)).FaPgno != 0 { (*TWalHashLoc)(unsafe.Pointer(pLoc)).FaHash = (*TWalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 4096*4 if iHash == 0 { (*TWalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = (*TWalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + uintptr((libc.Uint32FromInt64(48)*libc.Uint32FromInt32(2)+libc.Uint32FromInt64(40))/libc.Uint32FromInt64(4))*4 (*TWalHashLoc)(unsafe.Pointer(pLoc)).FiZero = uint32(0) } else { - (*TWalHashLoc)(unsafe.Pointer(pLoc)).FiZero = libc.Uint32FromInt32(HASHTABLE_NPAGE) - (libc.Uint32FromInt64(48)*libc.Uint32FromInt32(2)+libc.Uint32FromInt64(40))/libc.Uint32FromInt64(4) + uint32((iHash-int32(1))*int32(HASHTABLE_NPAGE)) + (*TWalHashLoc)(unsafe.Pointer(pLoc)).FiZero = libc.Uint32FromInt32(HASHTABLE_NPAGE) - (libc.Uint32FromInt64(48)*libc.Uint32FromInt32(2)+libc.Uint32FromInt64(40))/libc.Uint32FromInt64(4) + libc.Uint32FromInt32((iHash-int32(1))*int32(HASHTABLE_NPAGE)) } } else { if rc == SQLITE_OK { @@ -43008,9 +41125,7 @@ func _walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) (r int3 func _walFramePage(tls *libc.TLS, iFrame Tu32) (r int32) { var iHash int32 _ = iHash - iHash = int32((iFrame + uint32(HASHTABLE_NPAGE) - (libc.Uint32FromInt32(HASHTABLE_NPAGE) - (libc.Uint32FromInt64(48)*libc.Uint32FromInt32(2)+libc.Uint32FromInt64(40))/libc.Uint32FromInt64(4)) - uint32(1)) / uint32(HASHTABLE_NPAGE)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + iHash = libc.Int32FromUint32((iFrame + uint32(HASHTABLE_NPAGE) - (libc.Uint32FromInt32(HASHTABLE_NPAGE) - (libc.Uint32FromInt64(48)*libc.Uint32FromInt32(2)+libc.Uint32FromInt64(40))/libc.Uint32FromInt64(4)) - uint32(1)) / uint32(HASHTABLE_NPAGE)) return iHash } @@ -43023,7 +41138,6 @@ func _walFramePgno(tls *libc.TLS, pWal uintptr, iFrame Tu32) (r Tu32) { var iHash int32 _ = iHash iHash = _walFramePage(tls, iFrame) - _ = libc.Int32FromInt32(0) if iHash == 0 { return *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((libc.Uint32FromInt64(48)*libc.Uint32FromInt32(2)+libc.Uint32FromInt64(40))/libc.Uint32FromInt64(4)+iFrame-uint32(1))*4)) } @@ -43051,7 +41165,6 @@ func _walCleanupHash(tls *libc.TLS, pWal uintptr) { var _ /* sLoc at bp+0 */ TWalHashLoc _, _, _ = i, iLimit, nByte /* Hash table location */ iLimit = 0 /* Used to iterate through aHash[] */ - _ = libc.Int32FromInt32(0) if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == uint32(0) { return } @@ -43059,8 +41172,6 @@ func _walCleanupHash(tls *libc.TLS, pWal uintptr) { ** the entry that corresponds to frame pWal->hdr.mxFrame. It is guaranteed ** that the page said hash-table and array reside on is already mapped.(1) */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) i = _walHashGet(tls, pWal, _walFramePage(tls, (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame), bp) if i != 0 { return @@ -43068,14 +41179,13 @@ func _walCleanupHash(tls *libc.TLS, pWal uintptr) { /* Zero all hash-table entries that correspond to frame numbers greater ** than pWal->hdr.mxFrame. */ - iLimit = int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame - (*(*TWalHashLoc)(unsafe.Pointer(bp))).FiZero) - _ = libc.Int32FromInt32(0) + iLimit = libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame - (*(*TWalHashLoc)(unsafe.Pointer(bp))).FiZero) i = 0 for { if !(i < libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2)) { break } - if int32(*(*Tht_slot)(unsafe.Pointer((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash + uintptr(i)*2))) > iLimit { + if libc.Int32FromUint16(*(*Tht_slot)(unsafe.Pointer((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash + uintptr(i)*2))) > iLimit { *(*Tht_slot)(unsafe.Pointer((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash + uintptr(i)*2)) = uint16(0) } goto _1 @@ -43087,8 +41197,7 @@ func _walCleanupHash(tls *libc.TLS, pWal uintptr) { ** frame numbers greater than pWal->hdr.mxFrame. */ nByte = int32((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash) - int32((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno+uintptr(iLimit)*4) - _ = libc.Int32FromInt32(0) - libc.Xmemset(tls, (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno+uintptr(iLimit)*4, 0, uint32(nByte)) + libc.Xmemset(tls, (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno+uintptr(iLimit)*4, 0, libc.Uint32FromInt32(nByte)) } // C documentation @@ -43108,15 +41217,13 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in ** page number array and hash table entry. */ if rc == SQLITE_OK { /* Number of hash collisions */ - idx = int32(iFrame - (*(*TWalHashLoc)(unsafe.Pointer(bp))).FiZero) - _ = libc.Int32FromInt32(0) + idx = libc.Int32FromUint32(iFrame - (*(*TWalHashLoc)(unsafe.Pointer(bp))).FiZero) /* If this is the first entry to be added to this hash-table, zero the ** entire hash table and aPgno[] array before proceeding. */ if idx == int32(1) { nByte = int32((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash+uintptr(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))*2) - int32((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno) - _ = libc.Int32FromInt32(0) - libc.Xmemset(tls, (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno, 0, uint32(nByte)) + libc.Xmemset(tls, (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno, 0, libc.Uint32FromInt32(nByte)) } /* If the entry in aPgno[] is already set, then the previous writer ** must have exited unexpectedly in the middle of a transaction (after @@ -43126,7 +41233,6 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in */ if *(*Tu32)(unsafe.Pointer((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno + uintptr(idx-int32(1))*4)) != 0 { _walCleanupHash(tls, pWal) - _ = libc.Int32FromInt32(0) } /* Write the aPgno[] array entry and the hash-table slot. */ nCollide = idx @@ -43146,7 +41252,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in iKey = _walNextHash(tls, iKey) } *(*Tu32)(unsafe.Pointer((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno + uintptr(idx-int32(1))*4)) = iPage - libc.AtomicStoreNUint16((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash+uintptr(iKey)*2, uint16(idx), libc.Int32FromInt32(__ATOMIC_RELAXED)) + libc.AtomicStoreNUint16((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash+uintptr(iKey)*2, libc.Uint16FromInt32(idx), libc.Int32FromInt32(__ATOMIC_RELAXED)) } return rc } @@ -43185,11 +41291,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** If successful, the same bytes that are locked here are unlocked before ** this function returns. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - iLock = int32(WAL_ALL_BUT_WRITE) + int32((*TWal)(unsafe.Pointer(pWal)).FckptLock) + iLock = int32(WAL_ALL_BUT_WRITE) + libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FckptLock) rc = _walLockExclusive(tls, pWal, iLock, libc.Int32FromInt32(3)+libc.Int32FromInt32(0)-iLock) if rc != 0 { return rc @@ -43213,16 +41315,16 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** WAL file. */ magic = _sqlite3Get4byte(tls, bp+8) - szPage = int32(_sqlite3Get4byte(tls, bp+8+8)) + szPage = libc.Int32FromUint32(_sqlite3Get4byte(tls, bp+8+8)) if magic&uint32(0xFFFFFFFE) != uint32(WAL_MAGIC) || szPage&(szPage-int32(1)) != 0 || szPage > int32(SQLITE_MAX_PAGE_SIZE) || szPage < int32(512) { goto finished } (*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = uint8(magic & libc.Uint32FromInt32(0x00000001)) - (*TWal)(unsafe.Pointer(pWal)).FszPage = uint32(szPage) + (*TWal)(unsafe.Pointer(pWal)).FszPage = libc.Uint32FromInt32(szPage) (*TWal)(unsafe.Pointer(pWal)).FnCkpt = _sqlite3Get4byte(tls, bp+8+12) libc.Xmemcpy(tls, pWal+52+32, bp+8+16, uint32(8)) /* Verify that the WAL header checksum is correct */ - _walChecksumBytes(tls, libc.BoolInt32(int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN), bp+8, libc.Int32FromInt32(WAL_HDRSIZE)-libc.Int32FromInt32(2)*libc.Int32FromInt32(4), uintptr(0), pWal+52+24) + _walChecksumBytes(tls, libc.BoolInt32(libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN), bp+8, libc.Int32FromInt32(WAL_HDRSIZE)-libc.Int32FromInt32(2)*libc.Int32FromInt32(4), uintptr(0), pWal+52+24) if *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) != _sqlite3Get4byte(tls, bp+8+24) || *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) != _sqlite3Get4byte(tls, bp+8+28) { goto finished } @@ -43235,7 +41337,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, uint64(uint32(szFrame)+(libc.Uint32FromInt64(2)*uint32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4)))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint32FromInt32(szFrame)+(libc.Uint32FromInt64(2)*libc.Uint32FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -43243,10 +41345,10 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { aData = aFrame + 24 aPrivate = aData + uintptr(szPage) /* Read all frames from the log file. */ - iLastFrame = uint32((*(*Ti64)(unsafe.Pointer(bp)) - int64(WAL_HDRSIZE)) / int64(szFrame)) + iLastFrame = libc.Uint32FromInt64((*(*Ti64)(unsafe.Pointer(bp)) - int64(WAL_HDRSIZE)) / int64(szFrame)) iPg = uint32(0) for { - if !(iPg <= uint32(_walFramePage(tls, iLastFrame))) { + if !(iPg <= libc.Uint32FromInt32(_walFramePage(tls, iLastFrame))) { break } if iLastFrame < libc.Uint32FromInt32(HASHTABLE_NPAGE)-(libc.Uint32FromInt64(48)*libc.Uint32FromInt32(2)+libc.Uint32FromInt64(40))/libc.Uint32FromInt64(4)+iPg*uint32(HASHTABLE_NPAGE) { @@ -43261,8 +41363,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { v3 = libc.Uint32FromInt32(HASHTABLE_NPAGE) - (libc.Uint32FromInt64(48)*libc.Uint32FromInt32(2)+libc.Uint32FromInt64(40))/libc.Uint32FromInt64(4) + (iPg-uint32(1))*uint32(HASHTABLE_NPAGE) } iFirst = uint32(1) + v3 - rc = _walIndexPage(tls, pWal, int32(iPg), bp+40) - _ = libc.Int32FromInt32(0) + rc = _walIndexPage(tls, pWal, libc.Int32FromUint32(iPg), bp+40) if *(*uintptr)(unsafe.Pointer(bp + 40)) == uintptr(0) { break } @@ -43272,7 +41373,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { if !(iFrame <= iLast) { break } - iOffset = libc.Int64FromInt32(WAL_HDRSIZE) + int64(iFrame-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) /* dbsize field from frame header */ + iOffset = libc.Int64FromInt32(WAL_HDRSIZE) + libc.Int64FromUint32(iFrame-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) /* dbsize field from frame header */ /* Read and decode the next log frame. */ rc = _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd, aFrame, szFrame, iOffset) if rc != SQLITE_OK { @@ -43290,7 +41391,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { if *(*Tu32)(unsafe.Pointer(bp + 48)) != 0 { (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = iFrame (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage = *(*Tu32)(unsafe.Pointer(bp + 48)) - (*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage = uint16(szPage&libc.Int32FromInt32(0xff00) | szPage>>libc.Int32FromInt32(16)) + (*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage = libc.Uint16FromInt32(szPage&libc.Int32FromInt32(0xff00) | szPage>>libc.Int32FromInt32(16)) aFrameCksum[0] = *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) aFrameCksum[int32(1)] = *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) } @@ -43315,8 +41416,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** we know of actually does that, which is why we say that memcpy() ** is safe for this. Memcpy() is certainly a lot faster. */ - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 40))+uintptr(nHdr32)*4, aPrivate+uintptr(nHdr32)*4, libc.Uint32FromInt64(2)*uint32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4)-nHdr) - _ = libc.Int32FromInt32(0) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 40))+uintptr(nHdr32)*4, aPrivate+uintptr(nHdr32)*4, libc.Uint32FromInt64(2)*libc.Uint32FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4)-nHdr) if iFrame <= iLast { break } @@ -43354,7 +41454,6 @@ finished: } else { *(*Tu32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) = uint32(READMARK_NOT_USED) } - _ = libc.Int32FromInt32(0) _walUnlockExclusive(tls, pWal, int32(3)+i, int32(1)) } else { if rc != int32(SQLITE_BUSY) { @@ -43390,7 +41489,7 @@ recovery_error: func _walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { var i int32 _ = i - if int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) || (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { + if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) || (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { i = 0 for { if !(i < (*TWal)(unsafe.Pointer(pWal)).FnWiData) { @@ -43404,7 +41503,7 @@ func _walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { i++ } } - if int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) != int32(WAL_HEAPMEMORY_MODE) { + if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) != int32(WAL_HEAPMEMORY_MODE) { _sqlite3OsShmUnmap(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, isDelete) } } @@ -43433,8 +41532,6 @@ func _sqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt var pRet uintptr var _ /* flags at bp+0 */ int32 _, _, _, _ = iDC, pRet, rc, v1 /* Flags passed to OsOpen() */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Verify the values of various constants. Any changes to the values ** of these constants would result in an incompatible on-disk format ** for the -shm file. Any change that causes one of these asserts to @@ -43444,37 +41541,15 @@ func _sqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt ** This table also serves as a helpful cross-reference when trying to ** interpret hex dumps of the -shm file. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* In the amalgamation, the os_unix.c and os_win.c source files come before ** this source file. Verify that the #defines of the locking byte offsets ** in os_unix.c and os_win.c agree with the WALINDEX_LOCK_OFFSET value. ** For that matter, if the lock offset ever changes from its initial design ** value of 120, we need to know that so there is an assert() to check it. */ - _ = libc.Int32FromInt32(0) /* Allocate an instance of struct Wal to return. */ *(*uintptr)(unsafe.Pointer(ppWal)) = uintptr(0) - pRet = _sqlite3MallocZero(tls, uint64(uint32(120)+uint32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) + pRet = _sqlite3MallocZero(tls, uint64(uint32(120)+libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pRet != 0) { return int32(SQLITE_NOMEM) } @@ -43491,7 +41566,7 @@ func _sqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt } else { v1 = WAL_NORMAL_MODE } - (*TWal)(unsafe.Pointer(pRet)).FexclusiveMode = uint8(v1) + (*TWal)(unsafe.Pointer(pRet)).FexclusiveMode = libc.Uint8FromInt32(v1) /* Open file handle on the write-ahead log file. */ *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_WAL) rc = _sqlite3OsOpen(tls, pVfs, zWalName, (*TWal)(unsafe.Pointer(pRet)).FpWalFd, *(*int32)(unsafe.Pointer(bp)), bp) @@ -43545,7 +41620,6 @@ func _walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) _, _, _, _, _, _ = i, iMin, iPg, iRet, pSegment, v2 /* Result pgno must be greater than iMin */ iRet = uint32(0xFFFFFFFF) /* For looping through segments */ iMin = (*TWalIterator)(unsafe.Pointer(p)).FiPrior - _ = libc.Int32FromInt32(0) i = (*TWalIterator)(unsafe.Pointer(p)).FnSegment - int32(1) for { if !(i >= 0) { @@ -43557,7 +41631,7 @@ func _walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) if iPg > iMin { if iPg < iRet { iRet = iPg - *(*Tu32)(unsafe.Pointer(piFrame)) = uint32((*TWalSegment)(unsafe.Pointer(pSegment)).FiZero + int32(*(*Tht_slot)(unsafe.Pointer((*TWalSegment)(unsafe.Pointer(pSegment)).FaIndex + uintptr((*TWalSegment)(unsafe.Pointer(pSegment)).FiNext)*2)))) + *(*Tu32)(unsafe.Pointer(piFrame)) = libc.Uint32FromInt32((*TWalSegment)(unsafe.Pointer(pSegment)).FiZero + libc.Int32FromUint16(*(*Tht_slot)(unsafe.Pointer((*TWalSegment)(unsafe.Pointer(pSegment)).FaIndex + uintptr((*TWalSegment)(unsafe.Pointer(pSegment)).FiNext)*2)))) } break } @@ -43610,7 +41684,6 @@ func _walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRi iOut = 0 /* Current index in output buffer */ nRight = *(*int32)(unsafe.Pointer(pnRight)) aRight = *(*uintptr)(unsafe.Pointer(paRight)) - _ = libc.Int32FromInt32(0) for iRight < nRight || iLeft < nLeft { if iLeft < nLeft && (iRight >= nRight || *(*Tu32)(unsafe.Pointer(aContent + uintptr(*(*Tht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) < *(*Tu32)(unsafe.Pointer(aContent + uintptr(*(*Tht_slot)(unsafe.Pointer(aRight + uintptr(iRight)*2)))*4))) { v1 = iLeft @@ -43628,12 +41701,10 @@ func _walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRi if iLeft < nLeft && *(*Tu32)(unsafe.Pointer(aContent + uintptr(*(*Tht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) == dbpage { iLeft++ } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } *(*uintptr)(unsafe.Pointer(paRight)) = aLeft *(*int32)(unsafe.Pointer(pnRight)) = iOut - libc.Xmemcpy(tls, aLeft, aTmp, uint32(2)*uint32(iOut)) + libc.Xmemcpy(tls, aLeft, aTmp, uint32(2)*libc.Uint32FromInt32(iOut)) } // C documentation @@ -43673,8 +41744,6 @@ func _walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintp *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* Index into input list */ iSub = uint32(0) /* Array of sub-lists */ libc.Xmemset(tls, bp+8, 0, uint32(104)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iList = 0 for { if !(iList < nList) { @@ -43687,10 +41756,7 @@ func _walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintp if !(iList&(int32(1)<<iSub) != 0) { break } - _ = libc.Int32FromInt32(0) p = bp + 8 + uintptr(iSub)*8 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _walMerge(tls, aContent, (*struct { FnList int32 FaList uintptr @@ -43718,14 +41784,11 @@ func _walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintp } iSub++ for { - if !(iSub < uint32(int32(libc.Uint32FromInt64(104)/libc.Uint32FromInt64(8)))) { + if !(iSub < libc.Uint32FromInt32(libc.Int32FromUint32(libc.Uint32FromInt64(104)/libc.Uint32FromInt64(8)))) { break } if nList&(int32(1)<<iSub) != 0 { - _ = libc.Int32FromInt32(0) p1 = bp + 8 + uintptr(iSub)*8 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _walMerge(tls, aContent, (*struct { FnList int32 FaList uintptr @@ -43739,7 +41802,6 @@ func _walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintp ; iSub++ } - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pnList)) = *(*int32)(unsafe.Pointer(bp)) } @@ -43782,21 +41844,20 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( /* This routine only runs while holding the checkpoint lock. And ** it only runs if there is actually content in the log (mxFrame>0). */ - _ = libc.Int32FromInt32(0) iLast = (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame /* Allocate space for the WalIterator object. */ nSegment = _walFramePage(tls, iLast) + int32(1) - nByte = int64(uint32(28) + uint32(nSegment-libc.Int32FromInt32(1))*uint32(20) + iLast*uint32(2)) + nByte = libc.Int64FromUint32(uint32(28) + libc.Uint32FromInt32(nSegment-libc.Int32FromInt32(1))*uint32(20) + iLast*uint32(2)) if iLast > uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { v1 = iLast } - p = Xsqlite3_malloc64(tls, uint64(nByte+int64(uint32(2)*v1))) + p = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte+libc.Int64FromUint32(uint32(2)*v1))) if !(p != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, p, 0, uint32(nByte)) + libc.Xmemset(tls, p, 0, libc.Uint32FromInt64(nByte)) (*TWalIterator)(unsafe.Pointer(p)).FnSegment = nSegment aTmp = p + uintptr(nByte) i = _walFramePage(tls, nBackfill+uint32(1)) @@ -43807,7 +41868,7 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( rc = _walHashGet(tls, pWal, i, bp) if rc == SQLITE_OK { /* Sorted index for this segment */ if i+int32(1) == nSegment { - *(*int32)(unsafe.Pointer(bp + 12)) = int32(iLast - (*(*TWalHashLoc)(unsafe.Pointer(bp))).FiZero) + *(*int32)(unsafe.Pointer(bp + 12)) = libc.Int32FromUint32(iLast - (*(*TWalHashLoc)(unsafe.Pointer(bp))).FiZero) } else { *(*int32)(unsafe.Pointer(bp + 12)) = (int32((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash) - int32((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno)) / 4 } @@ -43818,14 +41879,14 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( if !(j < *(*int32)(unsafe.Pointer(bp + 12))) { break } - *(*Tht_slot)(unsafe.Pointer(aIndex + uintptr(j)*2)) = uint16(j) + *(*Tht_slot)(unsafe.Pointer(aIndex + uintptr(j)*2)) = libc.Uint16FromInt32(j) goto _3 _3: ; j++ } _walMergesort(tls, (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno, aTmp, aIndex, bp+12) - (*(*TWalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*20))).FiZero = int32((*(*TWalHashLoc)(unsafe.Pointer(bp))).FiZero) + (*(*TWalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*20))).FiZero = libc.Int32FromUint32((*(*TWalHashLoc)(unsafe.Pointer(bp))).FiZero) (*(*TWalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*20))).FnEntry = *(*int32)(unsafe.Pointer(bp + 12)) (*(*TWalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*20))).FaIndex = aIndex (*(*TWalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*20))).FaPgno = (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno @@ -43867,7 +41928,7 @@ func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, // ** Return the page-size in bytes used by the database. // */ func _walPagesize(tls *libc.TLS, pWal uintptr) (r int32) { - return int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&int32(0xfe00) + int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&int32(0x0001)<<int32(16) + return libc.Int32FromUint16((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&int32(0xfe00) + libc.Int32FromUint16((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&int32(0x0001)<<int32(16) } // C documentation @@ -43903,7 +41964,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { _sqlite3Put4byte(tls, aSalt, uint32(1)+_sqlite3Get4byte(tls, aSalt)) libc.Xmemcpy(tls, pWal+52+32+1*4, bp, uint32(4)) _walIndexWriteHdr(tls, pWal) - libc.AtomicStoreNUint32(pInfo, uint32(libc.Int32FromInt32(0)), libc.Int32FromInt32(__ATOMIC_RELAXED)) + libc.AtomicStoreNUint32(pInfo, libc.Uint32FromInt32(libc.Int32FromInt32(0)), libc.Int32FromInt32(__ATOMIC_RELAXED)) (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = uint32(0) *(*Tu32)(unsafe.Pointer(pInfo + 4 + 1*4)) = uint32(0) i = int32(2) @@ -43917,7 +41978,6 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { ; i++ } - _ = libc.Int32FromInt32(0) } // C documentation @@ -43978,7 +42038,6 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy if (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill < (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ - _ = libc.Int32FromInt32(0) /* Compute in mxSafeFrame the index of the last frame of the WAL that is ** safe to write into the database. Frames beyond mxSafeFrame might ** overwrite database pages that are in use by active readers and thus @@ -43992,9 +42051,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy break } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) - _ = libc.Int32FromInt32(0) if mxSafeFrame > y { - _ = libc.Int32FromInt32(0) rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { @@ -44004,7 +42061,6 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } iMark = v2 libc.AtomicStoreNUint32(pInfo+4+uintptr(i)*4, iMark, libc.Int32FromInt32(__ATOMIC_RELAXED)) - _ = libc.Int32FromInt32(0) _walUnlockExclusive(tls, pWal, int32(3)+i, int32(1)) } else { if rc == int32(SQLITE_BUSY) { @@ -44023,7 +42079,6 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy /* Allocate the iterator */ if (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill < mxSafeFrame { rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) - _ = libc.Int32FromInt32(0) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) @@ -44032,18 +42087,17 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy if v4 && v3 == SQLITE_OK { nBackfill = (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = mxSafeFrame - _ = libc.Int32FromInt32(0) /* Sync the WAL to disk */ rc = _sqlite3OsSync(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd, sync_flags>>int32(2)&int32(0x03)) /* If the database may grow as a result of this checkpoint, hint ** about the eventual size of the db file to the VFS layer. */ if rc == SQLITE_OK { - *(*Ti64)(unsafe.Pointer(bp + 16)) = int64(mxPage) * int64(szPage) /* Current size of database file */ + *(*Ti64)(unsafe.Pointer(bp + 16)) = libc.Int64FromUint32(mxPage) * int64(szPage) /* Current size of database file */ _sqlite3OsFileControl(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_CKPT_START), uintptr(0)) rc = _sqlite3OsFileSize(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, bp+24) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 24)) < *(*Ti64)(unsafe.Pointer(bp + 16)) { - if *(*Ti64)(unsafe.Pointer(bp + 24))+int64(65536)+int64((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)*int64(szPage) < *(*Ti64)(unsafe.Pointer(bp + 16)) { + if *(*Ti64)(unsafe.Pointer(bp + 24))+int64(65536)+libc.Int64FromUint32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)*int64(szPage) < *(*Ti64)(unsafe.Pointer(bp + 16)) { /* If the size of the final database is larger than the current ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then @@ -44056,8 +42110,6 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } /* Iterate through the contents of the WAL, copying data to the db file */ for rc == SQLITE_OK && 0 == _walIteratorNext(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+4, bp+8) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if libc.AtomicLoadNInt32(db+304, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { v5 = int32(SQLITE_NOMEM) @@ -44070,13 +42122,13 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy if *(*Tu32)(unsafe.Pointer(bp + 8)) <= nBackfill || *(*Tu32)(unsafe.Pointer(bp + 8)) > mxSafeFrame || *(*Tu32)(unsafe.Pointer(bp + 4)) > mxPage { continue } - iOffset = int64(WAL_HDRSIZE) + int64(*(*Tu32)(unsafe.Pointer(bp + 8))-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE) + iOffset = int64(WAL_HDRSIZE) + libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 8))-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE) /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL file */ rc = _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd, zBuf, szPage, iOffset) if rc != SQLITE_OK { break } - iOffset = int64(*(*Tu32)(unsafe.Pointer(bp + 4))-libc.Uint32FromInt32(1)) * int64(szPage) + iOffset = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))-libc.Uint32FromInt32(1)) * int64(szPage) rc = _sqlite3OsWrite(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, zBuf, szPage, iOffset) if rc != SQLITE_OK { break @@ -44086,7 +42138,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy /* If work was actually accomplished... */ if rc == SQLITE_OK { if mxSafeFrame == (*TWalIndexHdr)(unsafe.Pointer(_walIndexHdr(tls, pWal))).FmxFrame { - szDb = int64((*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage) * int64(szPage) + szDb = libc.Int64FromUint32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage) * int64(szPage) rc = _sqlite3OsTruncate(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, szDb) if rc == SQLITE_OK { rc = _sqlite3OsSync(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, sync_flags>>int32(2)&int32(0x03)) @@ -44094,7 +42146,6 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } if rc == SQLITE_OK { libc.AtomicStoreNUint32(pInfo, mxSafeFrame, libc.Int32FromInt32(__ATOMIC_RELAXED)) - _ = libc.Int32FromInt32(0) } } /* Release the reader lock held while backfilling */ @@ -44112,14 +42163,11 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** the next process to write to the database restarts the wal file. */ if rc == SQLITE_OK && eMode != SQLITE_CHECKPOINT_PASSIVE { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill < (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { rc = int32(SQLITE_BUSY) } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - _ = libc.Int32FromInt32(0) rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { @@ -44189,7 +42237,6 @@ func _sqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, rc = SQLITE_OK if pWal != 0 { isDelete = 0 /* True to unlink wal and wal-index files */ - _ = libc.Int32FromInt32(0) /* If an EXCLUSIVE lock can be obtained on the database file (using the ** ordinary, rollback-mode locking methods, this guarantees that the ** connection associated with this log file is the only connection to @@ -44203,7 +42250,7 @@ func _sqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, rc = v1 } if v2 && SQLITE_OK == v1 { - if int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE { + if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE { (*TWal)(unsafe.Pointer(pWal)).FexclusiveMode = uint8(WAL_EXCLUSIVE_MODE) } rc = _sqlite3WalCheckpoint(tls, pWal, db, SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0), sync_flags, nBuf, zBuf, uintptr(0), uintptr(0)) @@ -44269,7 +42316,6 @@ func _walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { var _ /* h2 at bp+56 */ TWalIndexHdr _ = aHdr /* Header in shared memory */ /* The first page of the wal-index must be mapped at this point. */ - _ = libc.Int32FromInt32(0) /* Read the header. This might happen concurrently with a write to the ** same area of shared memory on a different CPU in a SMP, ** meaning it is possible that an inconsistent snapshot is read @@ -44293,17 +42339,17 @@ func _walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { if libc.Xmemcmp(tls, bp+8, bp+56, uint32(48)) != 0 { return int32(1) /* Dirty read */ } - if int32((*(*TWalIndexHdr)(unsafe.Pointer(bp + 8))).FisInit) == 0 { + if libc.Int32FromUint8((*(*TWalIndexHdr)(unsafe.Pointer(bp + 8))).FisInit) == 0 { return int32(1) /* Malformed header - probably all zeros */ } - _walChecksumBytes(tls, int32(1), bp+8, int32(libc.Uint32FromInt64(48)-libc.Uint32FromInt64(8)), uintptr(0), bp) + _walChecksumBytes(tls, int32(1), bp+8, libc.Int32FromUint32(libc.Uint32FromInt64(48)-libc.Uint32FromInt64(8)), uintptr(0), bp) if (*(*[2]Tu32)(unsafe.Pointer(bp)))[0] != *(*Tu32)(unsafe.Pointer(bp + 8 + 40)) || (*(*[2]Tu32)(unsafe.Pointer(bp)))[int32(1)] != *(*Tu32)(unsafe.Pointer(bp + 8 + 40 + 1*4)) { return int32(1) /* Checksum does not match */ } if libc.Xmemcmp(tls, pWal+52, bp+8, uint32(48)) != 0 { *(*int32)(unsafe.Pointer(pChanged)) = int32(1) libc.Xmemcpy(tls, pWal+52, bp+8, uint32(48)) - (*TWal)(unsafe.Pointer(pWal)).FszPage = uint32(int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&int32(0xfe00) + int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&int32(0x0001)<<int32(16)) + (*TWal)(unsafe.Pointer(pWal)).FszPage = libc.Uint32FromInt32(libc.Int32FromUint16((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&int32(0xfe00) + libc.Int32FromUint16((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&int32(0x0001)<<int32(16)) } /* The header was successfully read. Return zero. */ return 0 @@ -44338,10 +42384,9 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { /* Ensure that page 0 of the wal-index (the page that contains the ** wal-index header) is mapped. Return early if an error occurs here. */ - _ = libc.Int32FromInt32(0) rc = _walIndexPage(tls, pWal, 0, bp) if rc != SQLITE_OK { - _ = libc.Int32FromInt32(0) /* READONLY changed to OK in walIndexPage */ + /* READONLY changed to OK in walIndexPage */ if rc == libc.Int32FromInt32(SQLITE_READONLY)|libc.Int32FromInt32(5)<<libc.Int32FromInt32(8) { /* The SQLITE_READONLY_CANTINIT return means that the shared-memory ** was openable but is not writable, and this thread is unable to @@ -44349,9 +42394,6 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** open, and hence the content of the shared-memory is unreliable, ** since the shared-memory might be inconsistent with the WAL file ** and there is no writer on hand to fix it. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable = uint8(1) (*TWal)(unsafe.Pointer(pWal)).FexclusiveMode = uint8(WAL_HEAPMEMORY_MODE) *(*int32)(unsafe.Pointer(pChanged)) = int32(1) @@ -44362,7 +42404,6 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { /* page0 can be NULL if the SHM is zero bytes in size and pWal->writeLock ** is zero, which prevents the SHM from growing */ } - _ = libc.Int32FromInt32(0) /* If the first page of the wal-index has been mapped, try to read the ** wal-index header immediately, without holding any lock. This usually ** works, but may fail if the wal-index header is corrupt or currently @@ -44378,7 +42419,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** with a writer. So get a WRITE lock and try again. */ if badHdr != 0 { - if int32((*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 && int32((*TWal)(unsafe.Pointer(pWal)).FreadOnly)&int32(WAL_SHM_RDONLY) != 0 { + if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 && libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FreadOnly)&int32(WAL_SHM_RDONLY) != 0 { v2 = _walLockShared(tls, pWal, WAL_WRITE_LOCK) rc = v2 if SQLITE_OK == v2 { @@ -44386,7 +42427,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = libc.Int32FromInt32(SQLITE_READONLY) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } } else { - bWriteLock = int32((*TWal)(unsafe.Pointer(pWal)).FwriteLock) + bWriteLock = libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FwriteLock) if v4 = bWriteLock != 0; !v4 { v3 = _walLockExclusive(tls, pWal, WAL_WRITE_LOCK, int32(1)) rc = v3 @@ -44424,7 +42465,6 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { if rc != SQLITE_OK { _walIndexClose(tls, pWal, 0) (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable = uint8(0) - _ = libc.Int32FromInt32(0) /* walIndexRecover() might have returned SHORT_READ if a concurrent ** writer truncated the WAL out from under it. If that happens, it ** indicates that a writer has fixed the SHM file for us, so retry */ @@ -44480,9 +42520,6 @@ func _walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r in var _ /* szWal at bp+0 */ Ti64 _, _, _, _, _, _, _, _, _ = aData, aFrame, aSaveCksum, i, iOffset, rc, szFrame, v1, v2 /* Buffer to load WAL header into */ aFrame = uintptr(0) /* Saved copy of pWal->hdr.aFrameCksum */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Take WAL_READ_LOCK(0). This has the effect of preventing any ** writers from running a checkpoint, but does not stop them ** from running recovery. */ @@ -44516,8 +42553,8 @@ func _walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r in ** writable by us, until sqlite3OsShmUnmap() has been called. ** This is a requirement on the VFS implementation. */ - rc = _sqlite3OsShmMap(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, int32(libc.Uint32FromInt64(2)*uint32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4)), 0, bp+40) - _ = libc.Int32FromInt32(0) /* SQLITE_OK not possible for read-only connection */ + rc = _sqlite3OsShmMap(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, libc.Int32FromUint32(libc.Uint32FromInt64(2)*libc.Uint32FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint32FromInt32(HASHTABLE_NPAGE)*libc.Uint32FromInt64(4)), 0, bp+40) + /* SQLITE_OK not possible for read-only connection */ if rc != libc.Int32FromInt32(SQLITE_READONLY)|libc.Int32FromInt32(5)<<libc.Int32FromInt32(8) { if rc == int32(SQLITE_READONLY) { v1 = -int32(1) @@ -44568,10 +42605,8 @@ func _walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r in goto begin_unreliable_shm_out } /* Allocate a buffer to read frames into */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - szFrame = int32((*TWal)(unsafe.Pointer(pWal)).FszPage + uint32(WAL_FRAME_HDRSIZE)) - aFrame = Xsqlite3_malloc64(tls, uint64(szFrame)) + szFrame = libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage + uint32(WAL_FRAME_HDRSIZE)) + aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)) if aFrame == uintptr(0) { rc = int32(SQLITE_NOMEM) goto begin_unreliable_shm_out @@ -44583,7 +42618,7 @@ func _walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r in ** the caller. */ aSaveCksum[0] = *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) aSaveCksum[int32(1)] = *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) - iOffset = libc.Int64FromInt32(WAL_HDRSIZE) + int64((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64((*TWal)(unsafe.Pointer(pWal)).FszPage+libc.Uint32FromInt32(WAL_FRAME_HDRSIZE)) + iOffset = libc.Int64FromInt32(WAL_HDRSIZE) + libc.Int64FromUint32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*libc.Int64FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage+libc.Uint32FromInt32(WAL_FRAME_HDRSIZE)) for { if !(iOffset+int64(szFrame) <= *(*Ti64)(unsafe.Pointer(bp))) { break @@ -44717,9 +42752,8 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 var pInfo uintptr _, _, _, _, _, _, _, _, _, _, _, _ = cnt, i, mxFrame, mxI, mxReadMark, nDelay, pInfo, rc, thisMark, v1, v4, v5 /* Loop counter */ rc = SQLITE_OK /* Wal frame to lock to */ - _ = libc.Int32FromInt32(0) /* Not currently locked */ + /* Not currently locked */ /* useWal may only be set for read/write connections */ - _ = libc.Int32FromInt32(0) /* Take steps to avoid spinning forever if there is a protocol error. ** ** Circumstances that cause a RETRY should only last for the briefest @@ -44751,8 +42785,7 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 *(*int32)(unsafe.Pointer(pCnt)) &= ^libc.Int32FromInt32(WAL_RETRY_BLOCKED_MASK) } if !(useWal != 0) { - _ = libc.Int32FromInt32(0) - if int32((*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 { + if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 { rc = _walIndexReadHdr(tls, pWal, pChanged) } if rc == int32(SQLITE_BUSY) { @@ -44794,10 +42827,7 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 } } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pInfo = _walCkptInfo(tls, pWal) - _ = libc.Int32FromInt32(0) if !(useWal != 0) && libc.AtomicLoadNUint32(pInfo, libc.Int32FromInt32(__ATOMIC_RELAXED)) == (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame && ((*TWal)(unsafe.Pointer(pWal)).FpSnapshot == uintptr(0) || (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == uint32(0)) { /* The WAL has been completely backfilled (or it is empty). ** and can be safely ignored. @@ -44847,9 +42877,7 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 break } thisMark = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) - _ = libc.Int32FromInt32(0) if mxReadMark <= thisMark && thisMark <= mxFrame { - _ = libc.Int32FromInt32(0) mxReadMark = thisMark mxI = i } @@ -44858,7 +42886,7 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 ; i++ } - if int32((*TWal)(unsafe.Pointer(pWal)).FreadOnly)&int32(WAL_SHM_RDONLY) == 0 && (mxReadMark < mxFrame || mxI == 0) { + if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FreadOnly)&int32(WAL_SHM_RDONLY) == 0 && (mxReadMark < mxFrame || mxI == 0) { i = int32(1) for { if !(i < libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)) { @@ -44883,7 +42911,6 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 } } if mxI == 0 { - _ = libc.Int32FromInt32(0) if rc == int32(SQLITE_BUSY) { v4 = -int32(1) } else { @@ -44893,8 +42920,6 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 } rc = _walLockShared(tls, pWal, int32(3)+mxI) if rc != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if rc&int32(0xFF) == int32(SQLITE_BUSY) { v5 = -int32(1) } else { @@ -44936,14 +42961,12 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 ** we can guarantee that the checkpointer that set nBackfill could not ** see any pages past pWal->hdr.mxFrame, this problem does not come up. */ - (*TWal)(unsafe.Pointer(pWal)).FminFrame = uint32(int32(libc.AtomicLoadNUint32(pInfo, libc.Int32FromInt32(__ATOMIC_RELAXED))) + int32(1)) - _ = libc.Int32FromInt32(0) + (*TWal)(unsafe.Pointer(pWal)).FminFrame = libc.Uint32FromInt32(libc.Int32FromUint32(libc.AtomicLoadNUint32(pInfo, libc.Int32FromInt32(__ATOMIC_RELAXED))) + int32(1)) _walShmBarrier(tls, pWal) if libc.AtomicLoadNUint32(pInfo+4+uintptr(mxI)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) != mxReadMark || libc.Xmemcmp(tls, _walIndexHdr(tls, pWal), pWal+52, uint32(48)) != 0 { _walUnlockShared(tls, pWal, int32(3)+mxI) return -int32(1) } else { - _ = libc.Int32FromInt32(0) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(mxI) } return rc @@ -44964,7 +42987,7 @@ func _walSnapshotRecover(tls *libc.TLS, pWal uintptr, pBuf1 uintptr, pBuf2 uintp var _ /* sLoc at bp+8 */ TWalHashLoc var _ /* szDb at bp+0 */ Ti64 _, _, _, _, _, _, _ = i, iDbOff, iWalOff, pInfo, pgno, rc, szPage - szPage = int32((*TWal)(unsafe.Pointer(pWal)).FszPage) /* Size of db file in bytes */ + szPage = libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) /* Size of db file in bytes */ rc = _sqlite3OsFileSize(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, bp) if rc == SQLITE_OK { pInfo = _walCkptInfo(tls, pWal) @@ -44978,16 +43001,15 @@ func _walSnapshotRecover(tls *libc.TLS, pWal uintptr, pBuf1 uintptr, pBuf2 uintp if rc != SQLITE_OK { break } - _ = libc.Int32FromInt32(0) pgno = *(*Tu32)(unsafe.Pointer((*(*TWalHashLoc)(unsafe.Pointer(bp + 8))).FaPgno + uintptr(i-(*(*TWalHashLoc)(unsafe.Pointer(bp + 8))).FiZero-uint32(1))*4)) - iDbOff = int64(pgno-libc.Uint32FromInt32(1)) * int64(szPage) + iDbOff = libc.Int64FromUint32(pgno-libc.Uint32FromInt32(1)) * int64(szPage) if iDbOff+int64(szPage) <= *(*Ti64)(unsafe.Pointer(bp)) { - iWalOff = int64(WAL_HDRSIZE) + int64(i-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE) + iWalOff = int64(WAL_HDRSIZE) + libc.Int64FromUint32(i-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE) rc = _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd, pBuf1, szPage, iWalOff) if rc == SQLITE_OK { rc = _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, pBuf2, szPage, iDbOff) } - if rc != SQLITE_OK || 0 == libc.Xmemcmp(tls, pBuf1, pBuf2, uint32(szPage)) { + if rc != SQLITE_OK || 0 == libc.Xmemcmp(tls, pBuf1, pBuf2, libc.Uint32FromInt32(szPage)) { break } } @@ -45026,17 +43048,15 @@ func _sqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) (r int32) { var pBuf1, pBuf2 uintptr var rc int32 _, _, _ = pBuf1, pBuf2, rc - _ = libc.Int32FromInt32(0) rc = _walLockExclusive(tls, pWal, int32(WAL_CKPT_LOCK), int32(1)) if rc == SQLITE_OK { - pBuf1 = Xsqlite3_malloc(tls, int32((*TWal)(unsafe.Pointer(pWal)).FszPage)) - pBuf2 = Xsqlite3_malloc(tls, int32((*TWal)(unsafe.Pointer(pWal)).FszPage)) + pBuf1 = Xsqlite3_malloc(tls, libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage)) + pBuf2 = Xsqlite3_malloc(tls, libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage)) if pBuf1 == uintptr(0) || pBuf2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { (*TWal)(unsafe.Pointer(pWal)).FckptLock = uint8(1) rc = _walSnapshotRecover(tls, pWal, pBuf1, pBuf2) - _ = libc.Int32FromInt32(0) (*TWal)(unsafe.Pointer(pWal)).FckptLock = uint8(0) } Xsqlite3_free(tls, pBuf1) @@ -45063,8 +43083,6 @@ func _walBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r ckptLock = 0 bChanged = 0 pSnapshot = (*TWal)(unsafe.Pointer(pWal)).FpSnapshot - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pSnapshot != 0 { if libc.Xmemcmp(tls, pSnapshot, pWal+52, uint32(48)) != 0 { bChanged = int32(1) @@ -45102,8 +43120,6 @@ func _walBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r ** checkpoint need not have completed for this to cause problems. */ pInfo = _walCkptInfo(tls, pWal) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Check that the wal file has not been wrapped. Assuming that it has ** not, also check that no checkpointer has attempted to checkpoint any ** frames beyond pSnapshot->mxFrame. If either of these conditions are @@ -45111,7 +43127,6 @@ func _walBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r ** with *pSnapshot and set *pChanged as appropriate for opening the ** snapshot. */ if !(libc.Xmemcmp(tls, pSnapshot+32, pWal+52+32, uint32(8)) != 0) && (*TWalIndexHdr)(unsafe.Pointer(pSnapshot)).FmxFrame >= (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted { - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, pWal+52, pSnapshot, uint32(48)) *(*int32)(unsafe.Pointer(pChanged)) = bChanged } else { @@ -45131,7 +43146,6 @@ func _walBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r } /* Release the shared CKPT lock obtained above. */ if ckptLock != 0 { - _ = libc.Int32FromInt32(0) _walUnlockShared(tls, pWal, int32(WAL_CKPT_LOCK)) } return rc @@ -45157,7 +43171,6 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp var rc int32 _ = rc rc = _walBeginReadTransaction(tls, pWal, pChanged) - _ = libc.Int32FromInt32(0) return rc } @@ -45195,14 +43208,13 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i iRead = uint32(0) /* If !=0, WAL frame to return data from */ iLast = (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame /* This routine is only be called from within a read transaction. */ - _ = libc.Int32FromInt32(0) /* If the "last page" field of the wal-index header snapshot is 0, then ** no data will be read from the wal under any circumstances. Return early ** in this case as an optimization. Likewise, if pWal->readLock==0, ** then the WAL is ignored by the reader so return early, as if the ** WAL were empty. */ - if iLast == uint32(0) || int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) == 0 && int32((*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 { + if iLast == uint32(0) || int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) == 0 && libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) return SQLITE_OK } @@ -45243,7 +43255,6 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i } nCollide = libc.Int32FromInt32(HASHTABLE_NPAGE) * libc.Int32FromInt32(2) iKey = _walHash(tls, pgno) - _ = libc.Int32FromInt32(0) for { v2 = uint32(libc.AtomicLoadNUint16((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash+uintptr(iKey)*2, libc.Int32FromInt32(__ATOMIC_RELAXED))) iH = v2 @@ -45252,7 +43263,6 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i } iFrame = iH + (*(*TWalHashLoc)(unsafe.Pointer(bp))).FiZero if iFrame <= iLast && iFrame >= (*TWal)(unsafe.Pointer(pWal)).FminFrame && *(*Tu32)(unsafe.Pointer((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno + uintptr(iH-uint32(1))*4)) == pgno { - _ = libc.Int32FromInt32(0) iRead = iFrame } v3 = nCollide @@ -45292,7 +43302,6 @@ func _sqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintpt var rc int32 _ = rc rc = _walFindFrame(tls, pWal, pgno, piRead) - _ = libc.Int32FromInt32(0) return rc } @@ -45307,9 +43316,9 @@ func _sqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead Tu32, nOut int32, p var iOffset Ti64 var sz, v1 int32 _, _, _ = iOffset, sz, v1 - sz = int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage) + sz = libc.Int32FromUint16((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage) sz = sz&int32(0xfe00) + sz&int32(0x0001)<<int32(16) - iOffset = int64(WAL_HDRSIZE) + int64(iRead-libc.Uint32FromInt32(1))*int64(sz+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE) + iOffset = int64(WAL_HDRSIZE) + libc.Int64FromUint32(iRead-libc.Uint32FromInt32(1))*int64(sz+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE) /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */ if nOut > sz { v1 = sz @@ -45351,8 +43360,6 @@ func _sqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { _ = rc /* Cannot start a write transaction without first holding a read ** transaction. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { return int32(SQLITE_READONLY) } @@ -45371,7 +43378,6 @@ func _sqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { if libc.Xmemcmp(tls, pWal+52, _walIndexHdr(tls, pWal), uint32(48)) != 0 { rc = libc.Int32FromInt32(SQLITE_BUSY) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) } - _ = libc.Int32FromInt32(0) if rc != SQLITE_OK { _walUnlockExclusive(tls, pWal, WAL_WRITE_LOCK, int32(1)) (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(0) @@ -45436,7 +43442,6 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - _ = libc.Int32FromInt32(0) rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: @@ -45446,7 +43451,6 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } - _ = libc.Int32FromInt32(0) } return rc } @@ -45460,7 +43464,6 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt // ** point in the event of a savepoint rollback (via WalSavepointUndo()). // */ func _sqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(aWalData)) = (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) = *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) = *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) @@ -45479,8 +43482,6 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r var rc int32 _ = rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*Tu32)(unsafe.Pointer(aWalData + 3*4)) != (*TWal)(unsafe.Pointer(pWal)).FnCkpt { /* This savepoint was opened immediately after the write-transaction ** was started. Right after that, the writer decided to wrap around @@ -45494,7 +43495,6 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) - _ = libc.Int32FromInt32(0) } return rc } @@ -45525,7 +43525,6 @@ func _walRestartLog(tls *libc.TLS, pWal uintptr) (r int32) { rc = SQLITE_OK if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) == 0 { pInfo = _walCkptInfo(tls, pWal) - _ = libc.Int32FromInt32(0) if (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill > uint32(0) { Xsqlite3_randomness(tls, int32(4), bp+4) rc = _walLockExclusive(tls, pWal, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) @@ -45553,7 +43552,7 @@ func _walRestartLog(tls *libc.TLS, pWal uintptr) (r int32) { for cond := true; cond; cond = rc == -int32(1) { rc = _walTryBeginRead(tls, pWal, bp+8, int32(1), bp) } - _ = libc.Int32FromInt32(0) /* BUSY not possible when useWal==1 */ + /* BUSY not possible when useWal==1 */ } return rc } @@ -45597,7 +43596,6 @@ func _walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOff iOffset += int64(iFirstAmt) iAmt -= iFirstAmt pContent = uintptr(iFirstAmt) + pContent - _ = libc.Int32FromInt32(0) rc = _sqlite3OsSync(tls, (*TWalWriter)(unsafe.Pointer(p)).FpFd, (*TWalWriter)(unsafe.Pointer(p)).FsyncFlags&int32(0x03)) if iAmt == 0 || rc != 0 { return rc @@ -45620,7 +43618,7 @@ func _walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, var _ /* aFrame at bp+0 */ [24]Tu8 _, _ = pData, rc /* Buffer to assemble frame-header in */ pData = (*TPgHdr)(unsafe.Pointer(pPage)).FpData - _walEncodeFrame(tls, (*TWalWriter)(unsafe.Pointer(p)).FpWal, (*TPgHdr)(unsafe.Pointer(pPage)).Fpgno, uint32(nTruncate), pData, bp) + _walEncodeFrame(tls, (*TWalWriter)(unsafe.Pointer(p)).FpWal, (*TPgHdr)(unsafe.Pointer(pPage)).Fpgno, libc.Uint32FromInt32(nTruncate), pData, bp) rc = _walWriteToLog(tls, p, bp, int32(24), iOffset) if rc != 0 { return rc @@ -45649,7 +43647,7 @@ func _walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast Tu32) (r int32) { var rc, szPage int32 var _ /* aFrame at bp+0 */ [24]Tu8 _, _, _, _, _, _, _, _ = aBuf, iCksumOff, iOff, iPgno, iRead, nDbSize, rc, szPage - szPage = int32((*TWal)(unsafe.Pointer(pWal)).FszPage) /* Database page size */ + szPage = libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) /* Database page size */ rc = SQLITE_OK aBuf = Xsqlite3_malloc(tls, szPage+int32(WAL_FRAME_HDRSIZE)) if aBuf == uintptr(0) { @@ -45660,13 +43658,12 @@ func _walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast Tu32) (r int32) { ** transaction restarted the wal file), these values must be read from the ** wal-file header. Otherwise, read them from the frame header of the ** previous frame. */ - _ = libc.Int32FromInt32(0) if (*TWal)(unsafe.Pointer(pWal)).FiReCksum == uint32(1) { iCksumOff = int64(24) } else { - iCksumOff = int64(WAL_HDRSIZE) + int64((*TWal)(unsafe.Pointer(pWal)).FiReCksum-libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(16) + iCksumOff = int64(WAL_HDRSIZE) + libc.Int64FromUint32((*TWal)(unsafe.Pointer(pWal)).FiReCksum-libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(16) } - rc = _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, int32(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2)), iCksumOff) + rc = _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, libc.Int32FromUint32(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2)), iCksumOff) *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) = _sqlite3Get4byte(tls, aBuf) *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = _sqlite3Get4byte(tls, aBuf+uintptr(4)) iRead = (*TWal)(unsafe.Pointer(pWal)).FiReCksum @@ -45675,7 +43672,7 @@ func _walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast Tu32) (r int32) { if !(rc == SQLITE_OK && iRead <= iLast) { break } - iOff = libc.Int64FromInt32(WAL_HDRSIZE) + int64(iRead-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + iOff = libc.Int64FromInt32(WAL_HDRSIZE) + libc.Int64FromUint32(iRead-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) rc = _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, szPage+int32(WAL_FRAME_HDRSIZE), iOff) if rc == SQLITE_OK { iPgno = _sqlite3Get4byte(tls, aBuf) @@ -45714,11 +43711,8 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc pLast = uintptr(0) /* Last frame in list */ nExtra = 0 /* The writer */ iFirst = uint32(0) /* Pointer to shared header */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If this frame set completes a transaction, then nTruncate>0. If ** nTruncate==0 then this frame set does not complete the transaction. */ - _ = libc.Int32FromInt32(0) pLive = _walIndexHdr(tls, pWal) if libc.Xmemcmp(tls, pWal+52, pLive, uint32(48)) != 0 { iFirst = (*TWalIndexHdr)(unsafe.Pointer(pLive)).FmxFrame + uint32(1) @@ -45737,9 +43731,9 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc */ iFrame = (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame if iFrame == uint32(0) { /* Checksum for wal-header */ - _sqlite3Put4byte(tls, bp+24, uint32(libc.Int32FromInt32(WAL_MAGIC)|libc.Int32FromInt32(SQLITE_BIGENDIAN))) + _sqlite3Put4byte(tls, bp+24, libc.Uint32FromInt32(libc.Int32FromInt32(WAL_MAGIC)|libc.Int32FromInt32(SQLITE_BIGENDIAN))) _sqlite3Put4byte(tls, bp+24+4, uint32(WAL_MAX_VERSION)) - _sqlite3Put4byte(tls, bp+24+8, uint32(szPage)) + _sqlite3Put4byte(tls, bp+24+8, libc.Uint32FromInt32(szPage)) _sqlite3Put4byte(tls, bp+24+12, (*TWal)(unsafe.Pointer(pWal)).FnCkpt) if (*TWal)(unsafe.Pointer(pWal)).FnCkpt == uint32(0) { Xsqlite3_randomness(tls, int32(8), pWal+52+32) @@ -45748,7 +43742,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc _walChecksumBytes(tls, int32(1), bp+24, libc.Int32FromInt32(WAL_HDRSIZE)-libc.Int32FromInt32(2)*libc.Int32FromInt32(4), uintptr(0), bp+56) _sqlite3Put4byte(tls, bp+24+24, (*(*[2]Tu32)(unsafe.Pointer(bp + 56)))[0]) _sqlite3Put4byte(tls, bp+24+28, (*(*[2]Tu32)(unsafe.Pointer(bp + 56)))[int32(1)]) - (*TWal)(unsafe.Pointer(pWal)).FszPage = uint32(szPage) + (*TWal)(unsafe.Pointer(pWal)).FszPage = libc.Uint32FromInt32(szPage) (*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = uint8(SQLITE_BIGENDIAN) *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) = (*(*[2]Tu32)(unsafe.Pointer(bp + 56)))[0] *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = (*(*[2]Tu32)(unsafe.Pointer(bp + 56)))[int32(1)] @@ -45771,7 +43765,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } } - if int32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { + if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { return _sqlite3CorruptError(tls, int32(68992)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ @@ -45780,7 +43774,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc (*(*TWalWriter)(unsafe.Pointer(bp))).FiSyncPoint = 0 (*(*TWalWriter)(unsafe.Pointer(bp))).FsyncFlags = sync_flags (*(*TWalWriter)(unsafe.Pointer(bp))).FszPage = szPage - iOffset = libc.Int64FromInt32(WAL_HDRSIZE) + int64(iFrame+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + iOffset = libc.Int64FromInt32(WAL_HDRSIZE) + libc.Int64FromUint32(iFrame+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) szFrame = szPage + int32(WAL_FRAME_HDRSIZE) /* Write all frames into the log file exactly once */ p = pList @@ -45795,9 +43789,8 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc if iFirst != 0 && ((*TPgHdr)(unsafe.Pointer(p)).FpDirty != 0 || isCommit == 0) { *(*Tu32)(unsafe.Pointer(bp + 64)) = uint32(0) _walFindFrame(tls, pWal, (*TPgHdr)(unsafe.Pointer(p)).Fpgno, bp+64) - _ = libc.Int32FromInt32(0) if *(*Tu32)(unsafe.Pointer(bp + 64)) >= iFirst { - iOff = int64(WAL_HDRSIZE) + int64(*(*Tu32)(unsafe.Pointer(bp + 64))-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE) + iOff = int64(WAL_HDRSIZE) + libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 64))-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE) if (*TWal)(unsafe.Pointer(pWal)).FiReCksum == uint32(0) || *(*Tu32)(unsafe.Pointer(bp + 64)) < (*TWal)(unsafe.Pointer(pWal)).FiReCksum { (*TWal)(unsafe.Pointer(pWal)).FiReCksum = *(*Tu32)(unsafe.Pointer(bp + 64)) } @@ -45812,13 +43805,12 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } iFrame++ - _ = libc.Int32FromInt32(0) if isCommit != 0 && (*TPgHdr)(unsafe.Pointer(p)).FpDirty == uintptr(0) { v4 = nTruncate } else { v4 = uint32(0) } - nDbSize = int32(v4) + nDbSize = libc.Int32FromUint32(v4) rc = _walWriteOneFrame(tls, bp, p, nDbSize, iOffset) if rc != 0 { return rc @@ -45860,17 +43852,15 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc (*(*TWalWriter)(unsafe.Pointer(bp))).FiSyncPoint = (iOffset + int64(sectorSize) - int64(1)) / int64(sectorSize) * int64(sectorSize) bSync = libc.BoolInt32((*(*TWalWriter)(unsafe.Pointer(bp))).FiSyncPoint == iOffset) for iOffset < (*(*TWalWriter)(unsafe.Pointer(bp))).FiSyncPoint { - rc = _walWriteOneFrame(tls, bp, pLast, int32(nTruncate), iOffset) + rc = _walWriteOneFrame(tls, bp, pLast, libc.Int32FromUint32(nTruncate), iOffset) if rc != 0 { return rc } iOffset += int64(szFrame) nExtra++ - _ = libc.Int32FromInt32(0) } } if bSync != 0 { - _ = libc.Int32FromInt32(0) rc = _sqlite3OsSync(tls, (*(*TWalWriter)(unsafe.Pointer(bp))).FpFd, sync_flags&int32(0x03)) } } @@ -45880,8 +43870,8 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc */ if isCommit != 0 && (*TWal)(unsafe.Pointer(pWal)).FtruncateOnCommit != 0 && (*TWal)(unsafe.Pointer(pWal)).FmxWalSize >= 0 { sz = (*TWal)(unsafe.Pointer(pWal)).FmxWalSize - if int64(WAL_HDRSIZE)+int64(iFrame+uint32(nExtra)+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) > (*TWal)(unsafe.Pointer(pWal)).FmxWalSize { - sz = libc.Int64FromInt32(WAL_HDRSIZE) + int64(iFrame+uint32(nExtra)+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + if int64(WAL_HDRSIZE)+libc.Int64FromUint32(iFrame+libc.Uint32FromInt32(nExtra)+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) > (*TWal)(unsafe.Pointer(pWal)).FmxWalSize { + sz = libc.Int64FromInt32(WAL_HDRSIZE) + libc.Int64FromUint32(iFrame+libc.Uint32FromInt32(nExtra)+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) } _walLimitSize(tls, pWal, sz) (*TWal)(unsafe.Pointer(pWal)).FtruncateOnCommit = uint8(0) @@ -45897,7 +43887,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc if !(p != 0 && rc == SQLITE_OK) { break } - if int32((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_WAL_APPEND) == 0 { + if libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(p)).Fflags)&int32(PGHDR_WAL_APPEND) == 0 { goto _6 } iFrame++ @@ -45907,7 +43897,6 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc ; p = (*TPgHdr)(unsafe.Pointer(p)).FpDirty } - _ = libc.Int32FromInt32(0) for rc == SQLITE_OK && nExtra > 0 { iFrame++ nExtra-- @@ -45915,7 +43904,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } if rc == SQLITE_OK { /* Update the private copy of the header. */ - (*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage = uint16(szPage&libc.Int32FromInt32(0xff00) | szPage>>libc.Int32FromInt32(16)) + (*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage = libc.Uint16FromInt32(szPage&libc.Int32FromInt32(0xff00) | szPage>>libc.Int32FromInt32(16)) (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = iFrame if isCommit != 0 { (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiChange++ @@ -45943,7 +43932,6 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, var rc int32 _ = rc rc = _walFrames(tls, pWal, szPage, pList, nTruncate, isCommit, sync_flags) - _ = libc.Int32FromInt32(0) return rc } @@ -45969,11 +43957,8 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ xBusy2 = xBusy /* Busy handler for eMode2 */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ - _ = libc.Int32FromInt32(0) if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { return int32(SQLITE_READONLY) } @@ -46037,15 +44022,13 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* If no error occurred, set the output variables. */ if rc == SQLITE_OK || rc == int32(SQLITE_BUSY) { if pnLog != 0 { - *(*int32)(unsafe.Pointer(pnLog)) = int32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame) + *(*int32)(unsafe.Pointer(pnLog)) = libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame) } - _ = libc.Int32FromInt32(0) if pnCkpt != 0 { - *(*int32)(unsafe.Pointer(pnCkpt)) = int32((*TWalCkptInfo)(unsafe.Pointer(_walCkptInfo(tls, pWal))).FnBackfill) + *(*int32)(unsafe.Pointer(pnCkpt)) = libc.Int32FromUint32((*TWalCkptInfo)(unsafe.Pointer(_walCkptInfo(tls, pWal))).FnBackfill) } } } - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) != 0 { /* If a new wal-index header was loaded before the checkpoint was ** performed, then the pager-cache associated with pWal is now @@ -46084,7 +44067,7 @@ func _sqlite3WalCallback(tls *libc.TLS, pWal uintptr) (r int32) { ret = (*TWal)(unsafe.Pointer(pWal)).FiCallback (*TWal)(unsafe.Pointer(pWal)).FiCallback = uint32(0) } - return int32(ret) + return libc.Int32FromUint32(ret) } // C documentation @@ -46116,36 +44099,30 @@ func _sqlite3WalCallback(tls *libc.TLS, pWal uintptr) (r int32) { func _sqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) (r int32) { var rc int32 _ = rc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* pWal->readLock is usually set, but might be -1 if there was a ** prior error while attempting to acquire are read-lock. This cannot ** happen if the connection is actually in exclusive mode (as no xShmLock ** locks are taken in this case). Nor should the pager attempt to ** upgrade to exclusive-mode following such an error. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if op == 0 { - if int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_NORMAL_MODE { + if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_NORMAL_MODE { (*TWal)(unsafe.Pointer(pWal)).FexclusiveMode = uint8(WAL_NORMAL_MODE) if _walLockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) != SQLITE_OK { (*TWal)(unsafe.Pointer(pWal)).FexclusiveMode = uint8(WAL_EXCLUSIVE_MODE) } - rc = libc.BoolInt32(int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE) + rc = libc.BoolInt32(libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE) } else { /* Already in locking_mode=NORMAL */ rc = 0 } } else { if op > 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FexclusiveMode = uint8(WAL_EXCLUSIVE_MODE) rc = int32(1) } else { - rc = libc.BoolInt32(int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE) + rc = libc.BoolInt32(libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE) } } return rc @@ -46159,7 +44136,7 @@ func _sqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) (r int32) { // ** WAL module is using shared-memory, return false. // */ func _sqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) (r int32) { - return libc.BoolInt32(pWal != 0 && int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE)) + return libc.BoolInt32(pWal != 0 && libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE)) } // C documentation @@ -46173,7 +44150,6 @@ func _sqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) (r var rc int32 _, _ = pRet, rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if libc.Xmemcmp(tls, pWal+52+24, uintptr(unsafe.Pointer(&_aZero)), uint32(16)) == 0 { *(*uintptr)(unsafe.Pointer(ppSnapshot)) = uintptr(0) return int32(SQLITE_ERROR) @@ -46251,7 +44227,6 @@ func _sqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) (r _walUnlockShared(tls, pWal, int32(WAL_CKPT_LOCK)) } } - _ = libc.Int32FromInt32(0) return rc } @@ -46262,7 +44237,6 @@ func _sqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) (r // ** sqlite3WalSnapshotCheck(). // */ func _sqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr) { - _ = libc.Int32FromInt32(0) _walUnlockShared(tls, pWal, int32(WAL_CKPT_LOCK)) } @@ -47025,9 +44999,6 @@ type IntegrityCk1 = TIntegrityCk1 // ** p->locked boolean to true. // */ func _lockBtreeMutex(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).Fmutex) (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).Fdb = (*TBtree)(unsafe.Pointer(p)).Fdb (*TBtree)(unsafe.Pointer(p)).Flocked = uint8(1) @@ -47043,10 +45014,6 @@ func _unlockBtreeMutex(tls *libc.TLS, p uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fmutex) (*TBtree)(unsafe.Pointer(p)).Flocked = uint8(0) } @@ -47074,19 +45041,10 @@ func _sqlite3BtreeEnter(tls *libc.TLS, p uintptr) { ** connected by pNext and pPrev should be in sorted order by ** Btree.pBt value. All elements of the list should belong to ** the same connection. Only shared Btrees are on the list. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Check for locking consistency */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* We should already hold a lock on the database connection */ - _ = libc.Int32FromInt32(0) /* Unless the database is sharable and unlocked, then BtShared.db ** should already be set correctly. */ - _ = libc.Int32FromInt32(0) if !((*TBtree)(unsafe.Pointer(p)).Fsharable != 0) { return } @@ -47127,9 +45085,6 @@ func _btreeLockCarefully(tls *libc.TLS, p uintptr) { if !(pLater != 0) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TBtree)(unsafe.Pointer(pLater)).Flocked != 0 { _unlockBtreeMutex(tls, pLater) } @@ -47160,9 +45115,7 @@ func _btreeLockCarefully(tls *libc.TLS, p uintptr) { // ** Exit the recursive mutex on a Btree. // */ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) if (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { - _ = libc.Int32FromInt32(0) (*TBtree)(unsafe.Pointer(p)).FwantToLock-- if (*TBtree)(unsafe.Pointer(p)).FwantToLock == 0 { _unlockBtreeMutex(tls, p) @@ -47191,7 +45144,6 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { var p uintptr _, _, _ = i, p, skipOk skipOk = int32(1) - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -47207,11 +45159,11 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { - if int32((*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 { _btreeEnterAll(tls, db) } } @@ -47220,7 +45172,6 @@ func _btreeLeaveAll(tls *libc.TLS, db uintptr) { var i int32 var p uintptr _, _ = i, p - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -47238,7 +45189,7 @@ func _btreeLeaveAll(tls *libc.TLS, db uintptr) { } func _sqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { - if int32((*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 { _btreeLeaveAll(tls, db) } } @@ -47366,16 +45317,10 @@ func _querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab TPgno, eLock Tu8) var pBt, pIter, p2 uintptr _, _, _ = pBt, pIter, p2 pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If requesting a write-lock, then the Btree must have an open write ** transaction on this file. And, obviously, for this to be so there ** must be an open write transaction on the file itself. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* This routine is a no-op if the shared-cache is not enabled */ if !((*TBtree)(unsafe.Pointer(p)).Fsharable != 0) { return SQLITE_OK @@ -47383,7 +45328,7 @@ func _querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab TPgno, eLock Tu8) /* If some other connection is holding an exclusive lock, the ** requested lock may not be obtained. */ - if (*TBtShared)(unsafe.Pointer(pBt)).FpWriter != p && int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_EXCLUSIVE) != 0 { + if (*TBtShared)(unsafe.Pointer(pBt)).FpWriter != p && libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_EXCLUSIVE) != 0 { _sqlite3ConnectionBlocked(tls, (*TBtree)(unsafe.Pointer(p)).Fdb, (*TBtree)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpWriter)).Fdb) return libc.Int32FromInt32(SQLITE_LOCKED) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } @@ -47401,12 +45346,9 @@ func _querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab TPgno, eLock Tu8) ** may hold a WRITE_LOCK on any table in this file (since there can ** only be a single writer). */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TBtLock)(unsafe.Pointer(pIter)).FpBtree != p && (*TBtLock)(unsafe.Pointer(pIter)).FiTable == iTab && int32((*TBtLock)(unsafe.Pointer(pIter)).FeLock) != int32(eLock) { + if (*TBtLock)(unsafe.Pointer(pIter)).FpBtree != p && (*TBtLock)(unsafe.Pointer(pIter)).FiTable == iTab && libc.Int32FromUint8((*TBtLock)(unsafe.Pointer(pIter)).FeLock) != libc.Int32FromUint8(eLock) { _sqlite3ConnectionBlocked(tls, (*TBtree)(unsafe.Pointer(p)).Fdb, (*TBtree)(unsafe.Pointer((*TBtLock)(unsafe.Pointer(pIter)).FpBtree)).Fdb) - if int32(eLock) == int32(WRITE_LOCK) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(eLock) == int32(WRITE_LOCK) { p2 = pBt + 24 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_PENDING)) } @@ -47444,18 +45386,12 @@ func _setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable TPgno, eLock Tu8) _, _, _ = pBt, pIter, pLock pBt = (*TBtree)(unsafe.Pointer(p)).FpBt pLock = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* A connection with the read-uncommitted flag set will never try to ** obtain a read-lock using this function. The only read-lock obtained ** by a connection in read-uncommitted mode is on the sqlite_schema ** table, and that lock is obtained in BtreeBeginTrans(). */ - _ = libc.Int32FromInt32(0) /* This function should only be called on a sharable b-tree after it ** has been determined that no other b-tree holds a conflicting lock. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* First search the list for an existing lock on this table. */ pIter = (*TBtShared)(unsafe.Pointer(pBt)).FpLock for { @@ -47488,8 +45424,7 @@ func _setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable TPgno, eLock Tu8) ** and the requested lock. This means if a write-lock was already held ** and a read-lock requested, we don't incorrectly downgrade the lock. */ - _ = libc.Int32FromInt32(0) - if int32(eLock) > int32((*TBtLock)(unsafe.Pointer(pLock)).FeLock) { + if libc.Int32FromUint8(eLock) > libc.Int32FromUint8((*TBtLock)(unsafe.Pointer(pLock)).FeLock) { (*TBtLock)(unsafe.Pointer(pLock)).FeLock = eLock } return SQLITE_OK @@ -47510,16 +45445,10 @@ func _clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { _, _, _, _, _ = pBt, pLock, ppIter, p1, p2 pBt = (*TBtree)(unsafe.Pointer(p)).FpBt ppIter = pBt + 76 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for *(*uintptr)(unsafe.Pointer(ppIter)) != 0 { pLock = *(*uintptr)(unsafe.Pointer(ppIter)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TBtLock)(unsafe.Pointer(pLock)).FpBtree == p { *(*uintptr)(unsafe.Pointer(ppIter)) = (*TBtLock)(unsafe.Pointer(pLock)).FpNext - _ = libc.Int32FromInt32(0) if (*TBtLock)(unsafe.Pointer(pLock)).FiTable != uint32(1) { Xsqlite3_free(tls, pLock) } @@ -47527,7 +45456,6 @@ func _clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { ppIter = pLock + 12 } } - _ = libc.Int32FromInt32(0) if (*TBtShared)(unsafe.Pointer(pBt)).FpWriter == p { (*TBtShared)(unsafe.Pointer(pBt)).FpWriter = uintptr(0) p1 = pBt + 24 @@ -47567,7 +45495,6 @@ func _downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { if !(pLock != 0) { break } - _ = libc.Int32FromInt32(0) (*TBtLock)(unsafe.Pointer(pLock)).FeLock = uint8(READ_LOCK) goto _2 _2: @@ -47599,7 +45526,6 @@ func _downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { func _invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { var p, p2 uintptr _, _ = p, p2 - _ = libc.Int32FromInt32(0) p = (*TBtShared)(unsafe.Pointer(pBt)).FpCursor for { if !(p != 0) { @@ -47632,15 +45558,13 @@ func _invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { func _invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot TPgno, iRow Ti64, isClearTable int32) { var p uintptr _ = p - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TBtree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = uint8(0) p = (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(pBtree)).FpBt)).FpCursor for { if !(p != 0) { break } - if int32((*TBtCursor)(unsafe.Pointer(p)).FcurFlags)&int32(BTCF_Incrblob) != 0 { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(p)).FcurFlags)&int32(BTCF_Incrblob) != 0 { (*TBtree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = uint8(1) if (*TBtCursor)(unsafe.Pointer(p)).FpgnoRoot == pgnoRoot && (isClearTable != 0 || (*TBtCursor)(unsafe.Pointer(p)).Finfo.FnKey == iRow) { (*TBtCursor)(unsafe.Pointer(p)).FeState = uint8(CURSOR_INVALID) @@ -47695,7 +45619,6 @@ func _btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno TPgno) (r int32) { _ = rc rc = SQLITE_OK if !((*TBtShared)(unsafe.Pointer(pBt)).FpHasContent != 0) { - _ = libc.Int32FromInt32(0) (*TBtShared)(unsafe.Pointer(pBt)).FpHasContent = _sqlite3BitvecCreate(tls, (*TBtShared)(unsafe.Pointer(pBt)).FnPage) if !((*TBtShared)(unsafe.Pointer(pBt)).FpHasContent != 0) { rc = int32(SQLITE_NOMEM) @@ -47779,19 +45702,16 @@ func _saveCursorKey(tls *libc.TLS, pCur uintptr) (r int32) { var rc int32 _, _ = pKey, rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey != 0 { /* Only the rowid is required for a table btree */ (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = _sqlite3BtreeIntegerKey(tls, pCur) } else { - (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = int64(_sqlite3BtreePayloadSize(tls, pCur)) - pKey = _sqlite3Malloc(tls, uint64((*TBtCursor)(unsafe.Pointer(pCur)).FnKey+int64(9)+int64(8))) + (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = libc.Int64FromUint32(_sqlite3BtreePayloadSize(tls, pCur)) + pKey = _sqlite3Malloc(tls, libc.Uint64FromInt64((*TBtCursor)(unsafe.Pointer(pCur)).FnKey+int64(9)+int64(8))) if pKey != 0 { - rc = _sqlite3BtreePayload(tls, pCur, uint32(0), uint32(int32((*TBtCursor)(unsafe.Pointer(pCur)).FnKey)), pKey) + rc = _sqlite3BtreePayload(tls, pCur, uint32(0), libc.Uint32FromInt32(int32((*TBtCursor)(unsafe.Pointer(pCur)).FnKey)), pKey) if rc == SQLITE_OK { - libc.Xmemset(tls, pKey+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FnKey), 0, uint32(libc.Int32FromInt32(9)+libc.Int32FromInt32(8))) + libc.Xmemset(tls, pKey+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FnKey), 0, libc.Uint32FromInt32(libc.Int32FromInt32(9)+libc.Int32FromInt32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FpKey = pKey } else { Xsqlite3_free(tls, pKey) @@ -47800,7 +45720,6 @@ func _saveCursorKey(tls *libc.TLS, pCur uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } } - _ = libc.Int32FromInt32(0) return rc } @@ -47817,13 +45736,10 @@ func _saveCursorPosition(tls *libc.TLS, pCur uintptr) (r int32) { var rc int32 var p1 uintptr _, _ = rc, p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_Pinned) != 0 { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_Pinned) != 0 { return libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(11)<<libc.Int32FromInt32(8) } - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_SKIPNEXT) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_SKIPNEXT) { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) } else { (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext = 0 @@ -47864,8 +45780,6 @@ func _saveCursorPosition(tls *libc.TLS, pCur uintptr) (r int32) { func _saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot TPgno, pExcept uintptr) (r int32) { var p, p2 uintptr _, _ = p, p2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p = (*TBtShared)(unsafe.Pointer(pBt)).FpCursor for { if !(p != 0) { @@ -47901,7 +45815,7 @@ func _saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot TPgno, pExcept uintptr) _ = rc for cond := true; cond; cond = p != 0 { if p != pExcept && (uint32(0) == iRoot || (*TBtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot) { - if int32((*TBtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID || int32((*TBtCursor)(unsafe.Pointer(p)).FeState) == int32(CURSOR_SKIPNEXT) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID || libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(p)).FeState) == int32(CURSOR_SKIPNEXT) { rc = _saveCursorPosition(tls, p) if SQLITE_OK != rc { return rc @@ -47921,7 +45835,6 @@ func _saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot TPgno, pExcept uintptr) // ** Clear the current cursor position. // */ func _sqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { - _ = libc.Int32FromInt32(0) Xsqlite3_free(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpKey) (*TBtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_INVALID) @@ -47940,13 +45853,12 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int _, _, _ = pIdxKey, pKeyInfo, rc /* Unpacked index key */ if pKey != 0 { pKeyInfo = (*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo - _ = libc.Int32FromInt32(0) pIdxKey = _sqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo) if pIdxKey == uintptr(0) { return int32(SQLITE_NOMEM) } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) - if int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { + if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { rc = _sqlite3CorruptError(tls, int32(71421)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) @@ -47975,9 +45887,7 @@ func _btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) (r int32) { var _ /* skipNext at bp+0 */ int32 _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_FAULT) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_FAULT) { return (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext } (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_INVALID) @@ -47989,11 +45899,10 @@ func _btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) (r int32) { if rc == SQLITE_OK { Xsqlite3_free(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpKey) (*TBtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) != 0 { (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext = *(*int32)(unsafe.Pointer(bp)) } - if (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext != 0 && int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID { + if (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext != 0 && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_SKIPNEXT) } } @@ -48015,10 +45924,7 @@ func _btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) (r int32) { // ** back to where it ought to be if this routine returns true. // */ func _sqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - return libc.BoolInt32(CURSOR_VALID != int32(*(*Tu8)(unsafe.Pointer(pCur)))) + return libc.BoolInt32(CURSOR_VALID != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCur)))) } // C documentation @@ -48029,7 +45935,6 @@ func _sqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) (r int32) { // ** cursor returned must not be used with any other Btree interface. // */ func _sqlite3BtreeFakeValidCursor(tls *libc.TLS) (r uintptr) { - _ = libc.Int32FromInt32(0) return uintptr(unsafe.Pointer(&_fakeCursor)) } @@ -48053,9 +45958,7 @@ var _fakeCursor Tu8 func _sqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) (r int32) { var rc, v1 int32 _, _ = rc, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { v1 = _btreeRestoreCursorPosition(tls, pCur) } else { v1 = SQLITE_OK @@ -48065,7 +45968,7 @@ func _sqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintp *(*int32)(unsafe.Pointer(pDifferentRow)) = int32(1) return rc } - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { *(*int32)(unsafe.Pointer(pDifferentRow)) = int32(1) } else { *(*int32)(unsafe.Pointer(pDifferentRow)) = 0 @@ -48079,7 +45982,6 @@ func _sqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintp // ** Provide flag hints to the cursor. // */ func _sqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { - _ = libc.Int32FromInt32(0) (*TBtCursor)(unsafe.Pointer(pCur)).Fhints = uint8(x) } @@ -48098,14 +46000,13 @@ func _ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno TPgno) (r TPgno) { var iPtrMap, ret TPgno var nPagesPerMapPage int32 _, _, _ = iPtrMap, nPagesPerMapPage, ret - _ = libc.Int32FromInt32(0) if pgno < uint32(2) { return uint32(0) } - nPagesPerMapPage = int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(5) + uint32(1)) - iPtrMap = (pgno - uint32(2)) / uint32(nPagesPerMapPage) - ret = iPtrMap*uint32(nPagesPerMapPage) + uint32(2) - if ret == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + nPagesPerMapPage = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(5) + uint32(1)) + iPtrMap = (pgno - uint32(2)) / libc.Uint32FromInt32(nPagesPerMapPage) + ret = iPtrMap*libc.Uint32FromInt32(nPagesPerMapPage) + uint32(2) + if ret == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { ret++ } return ret @@ -48134,10 +46035,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, if *(*int32)(unsafe.Pointer(pRC)) != 0 { return } - _ = libc.Int32FromInt32(0) /* The super-journal page number must never be used as a pointer map page */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if key == uint32(0) { *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71619)) return @@ -48155,14 +46053,13 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71632)) goto ptrmap_exit } - offset = int32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) + offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71637)) goto ptrmap_exit } - _ = libc.Int32FromInt32(0) pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) - if int32(eType) != int32(*(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset)))) || _sqlite3Get4byte(tls, pPtrmap+uintptr(offset+int32(1))) != parent { + if libc.Int32FromUint8(eType) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset)))) || _sqlite3Get4byte(tls, pPtrmap+uintptr(offset+int32(1))) != parent { v1 = _sqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = v1 *(*int32)(unsafe.Pointer(pRC)) = v1 @@ -48193,26 +46090,23 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin var pPtrmap uintptr var _ /* pDbPage at bp+0 */ uintptr _, _, _, _ = iPtrmap, offset, pPtrmap, rc - _ = libc.Int32FromInt32(0) - iPtrmap = int32(_ptrmapPageno(tls, pBt, key)) - rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, uint32(iPtrmap), bp, 0) + iPtrmap = libc.Int32FromUint32(_ptrmapPageno(tls, pBt, key)) + rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, libc.Uint32FromInt32(iPtrmap), bp, 0) if rc != 0 { return rc } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) - offset = int32(libc.Uint32FromInt32(5) * (key - uint32(iPtrmap) - libc.Uint32FromInt32(1))) + offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) return _sqlite3CorruptError(tls, int32(71682)) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { *(*TPgno)(unsafe.Pointer(pPgno)) = _sqlite3Get4byte(tls, pPtrmap+uintptr(offset+int32(1))) } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - if int32(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || int32(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { return _sqlite3CorruptError(tls, int32(71690)) } return SQLITE_OK @@ -48240,15 +46134,15 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin func _btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { var maxLocal, minLocal, surplus int32 _, _, _ = maxLocal, minLocal, surplus /* Overflow payload available for local storage */ - minLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - maxLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) - surplus = int32(uint32(minLocal) + ((*TCellInfo)(unsafe.Pointer(pInfo)).FnPayload-uint32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4))) + minLocal = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) + maxLocal = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) + surplus = libc.Int32FromUint32(libc.Uint32FromInt32(minLocal) + ((*TCellInfo)(unsafe.Pointer(pInfo)).FnPayload-libc.Uint32FromInt32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4))) if surplus <= maxLocal { - (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = uint16(surplus) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = libc.Uint16FromInt32(surplus) } else { - (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = uint16(minLocal) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = libc.Uint16FromInt32(minLocal) } - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(int32(uint16(t__predefined_ptrdiff_t((*TCellInfo)(unsafe.Pointer(pInfo)).FpPayload+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal))-int32(pCell))) + int32(4)) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(t__predefined_ptrdiff_t((*TCellInfo)(unsafe.Pointer(pInfo)).FpPayload+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal))-int32(pCell))) + int32(4)) } // C documentation @@ -48260,12 +46154,12 @@ func _btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell ui func _btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload Ti64) (r int32) { var maxLocal, minLocal, surplus, v1 int32 _, _, _, _ = maxLocal, minLocal, surplus, v1 /* Maximum amount of payload held locally */ - maxLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) + maxLocal = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) if nPayload <= int64(maxLocal) { return int32(nPayload) } else { /* Overflow payload available for local storage */ - minLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - surplus = int32(int64(minLocal) + (nPayload-int64(minLocal))%int64((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-libc.Uint32FromInt32(4))) + minLocal = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) + surplus = int32(int64(minLocal) + (nPayload-int64(minLocal))%libc.Int64FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-libc.Uint32FromInt32(4))) if surplus <= maxLocal { v1 = surplus } else { @@ -48293,11 +46187,8 @@ func _btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload Ti64) (r int32) // ** by pointer. // */ func _btreeParseCellPtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _ = pPage - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(int32(4) + int32(_sqlite3GetVarint(tls, pCell+4, pInfo))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(int32(4) + libc.Int32FromUint8(_sqlite3GetVarint(tls, pCell+4, pInfo))) (*TCellInfo)(unsafe.Pointer(pInfo)).FnPayload = uint32(0) (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = uint16(0) (*TCellInfo)(unsafe.Pointer(pInfo)).FpPayload = uintptr(0) @@ -48312,10 +46203,6 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp var x, v10, v12, v14, v2, v4, v6, v8 Tu8 var _ /* iKey at bp+0 */ Tu64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = nPayload, pEnd, pIter, x, v1, v10, v11, v12, v13, v14, v15, v16, v2, v3, v4, v5, v6, v7, v8, v9 /* Extracted Key value */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pIter = pCell /* The next block of code is equivalent to: ** @@ -48327,10 +46214,10 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp if nPayload >= uint32(0x80) { pEnd = pIter + 8 nPayload &= uint32(0x7f) - for cond := true; cond; cond = int32(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { + for cond := true; cond; cond = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { pIter++ v1 = pIter - nPayload = nPayload<<libc.Int32FromInt32(7) | uint32(int32(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) + nPayload = nPayload<<libc.Int32FromInt32(7) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) } } pIter++ @@ -48348,43 +46235,43 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp v2 = *(*Tu8)(unsafe.Pointer(v3)) x = v2 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(7) ^ uint64(v2) - if int32(x) >= int32(0x80) { + if libc.Int32FromUint8(x) >= int32(0x80) { pIter++ v5 = pIter v4 = *(*Tu8)(unsafe.Pointer(v5)) x = v4 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(7) ^ uint64(v4) - if int32(x) >= int32(0x80) { + if libc.Int32FromUint8(x) >= int32(0x80) { pIter++ v7 = pIter v6 = *(*Tu8)(unsafe.Pointer(v7)) x = v6 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(7) ^ uint64(0x10204000) ^ uint64(v6) - if int32(x) >= int32(0x80) { + if libc.Int32FromUint8(x) >= int32(0x80) { pIter++ v9 = pIter v8 = *(*Tu8)(unsafe.Pointer(v9)) x = v8 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(7) ^ uint64(0x4000) ^ uint64(v8) - if int32(x) >= int32(0x80) { + if libc.Int32FromUint8(x) >= int32(0x80) { pIter++ v11 = pIter v10 = *(*Tu8)(unsafe.Pointer(v11)) x = v10 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(7) ^ uint64(0x4000) ^ uint64(v10) - if int32(x) >= int32(0x80) { + if libc.Int32FromUint8(x) >= int32(0x80) { pIter++ v13 = pIter v12 = *(*Tu8)(unsafe.Pointer(v13)) x = v12 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(7) ^ uint64(0x4000) ^ uint64(v12) - if int32(x) >= int32(0x80) { + if libc.Int32FromUint8(x) >= int32(0x80) { pIter++ v15 = pIter v14 = *(*Tu8)(unsafe.Pointer(v15)) x = v14 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(7) ^ uint64(0x4000) ^ uint64(v14) - if int32(x) >= int32(0x80) { + if libc.Int32FromUint8(x) >= int32(0x80) { pIter++ v16 = pIter *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(8) ^ uint64(0x8000) ^ uint64(*(*Tu8)(unsafe.Pointer(v16))) @@ -48408,8 +46295,8 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(uint16(int32(pIter)-int32(pCell)))) - if int32((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) + if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = uint16(nPayload) @@ -48422,30 +46309,27 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo var nPayload Tu32 var pEnd, pIter, v1 uintptr _, _, _, _ = nPayload, pEnd, pIter, v1 /* Number of bytes of cell payload */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pIter = pCell + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) nPayload = uint32(*(*Tu8)(unsafe.Pointer(pIter))) if nPayload >= uint32(0x80) { pEnd = pIter + 8 nPayload &= uint32(0x7f) - for cond := true; cond; cond = int32(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { + for cond := true; cond; cond = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { pIter++ v1 = pIter - nPayload = nPayload<<libc.Int32FromInt32(7) | uint32(int32(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) + nPayload = nPayload<<libc.Int32FromInt32(7) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) } } pIter++ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnKey = int64(nPayload) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnKey = libc.Int64FromUint32(nPayload) (*TCellInfo)(unsafe.Pointer(pInfo)).FnPayload = nPayload (*TCellInfo)(unsafe.Pointer(pInfo)).FpPayload = pIter if nPayload <= uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(uint16(int32(pIter)-int32(pCell)))) - if int32((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) + if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = uint16(nPayload) @@ -48455,7 +46339,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo } func _btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCell)))))), pInfo) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCell)))))), pInfo) } // C documentation @@ -48480,30 +46364,27 @@ func _cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) { var pEnd, pIter, v1 uintptr _, _, _, _, _ = minLocal, nSize, pEnd, pIter, v1 pIter = pCell + uintptr(4) /* Size value to return */ - _ = libc.Int32FromInt32(0) nSize = uint32(*(*Tu8)(unsafe.Pointer(pIter))) if nSize >= uint32(0x80) { pEnd = pIter + 8 nSize &= uint32(0x7f) - for cond := true; cond; cond = int32(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { + for cond := true; cond; cond = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { pIter++ v1 = pIter - nSize = nSize<<libc.Int32FromInt32(7) | uint32(int32(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) + nSize = nSize<<libc.Int32FromInt32(7) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) } } pIter++ if nSize <= uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize += uint32(int32(pIter) - int32(pCell)) - _ = libc.Int32FromInt32(0) + nSize += libc.Uint32FromInt32(int32(pIter) - int32(pCell)) } else { - minLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - nSize = uint32(minLocal) + (nSize-uint32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) + minLocal = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) + nSize = libc.Uint32FromInt32(minLocal) + (nSize-libc.Uint32FromInt32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) if nSize > uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize = uint32(minLocal) + nSize = libc.Uint32FromInt32(minLocal) } - nSize += uint32(int32(4) + int32(uint16(int32(pIter)-int32(pCell)))) + nSize += libc.Uint32FromInt32(int32(4) + libc.Int32FromUint16(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) } - _ = libc.Int32FromInt32(0) return uint16(nSize) } @@ -48513,32 +46394,30 @@ func _cellSizePtrIdxLeaf(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) { var pEnd, pIter, v1 uintptr _, _, _, _, _ = minLocal, nSize, pEnd, pIter, v1 pIter = pCell /* Size value to return */ - _ = libc.Int32FromInt32(0) nSize = uint32(*(*Tu8)(unsafe.Pointer(pIter))) if nSize >= uint32(0x80) { pEnd = pIter + 8 nSize &= uint32(0x7f) - for cond := true; cond; cond = int32(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { + for cond := true; cond; cond = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { pIter++ v1 = pIter - nSize = nSize<<libc.Int32FromInt32(7) | uint32(int32(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) + nSize = nSize<<libc.Int32FromInt32(7) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) } } pIter++ if nSize <= uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize += uint32(int32(pIter) - int32(pCell)) + nSize += libc.Uint32FromInt32(int32(pIter) - int32(pCell)) if nSize < uint32(4) { nSize = uint32(4) } } else { - minLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - nSize = uint32(minLocal) + (nSize-uint32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) + minLocal = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) + nSize = libc.Uint32FromInt32(minLocal) + (nSize-libc.Uint32FromInt32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) if nSize > uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize = uint32(minLocal) + nSize = libc.Uint32FromInt32(minLocal) } - nSize += uint32(int32(4) + int32(uint16(int32(pIter)-int32(pCell)))) + nSize += libc.Uint32FromInt32(int32(4) + libc.Int32FromUint16(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) } - _ = libc.Int32FromInt32(0) return uint16(nSize) } @@ -48547,17 +46426,15 @@ func _cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) _, _, _ = pEnd, pIter, v1 pIter = pCell + uintptr(4) /* End mark for a varint */ _ = pPage - _ = libc.Int32FromInt32(0) pEnd = pIter + uintptr(9) for { v1 = pIter pIter++ - if !(int32(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0 && pIter < pEnd) { + if !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0 && pIter < pEnd) { break } } - _ = libc.Int32FromInt32(0) - return uint16(int32(pIter) - int32(pCell)) + return libc.Uint16FromInt32(int32(pIter) - int32(pCell)) } func _cellSizePtrTableLeaf(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) { @@ -48571,10 +46448,10 @@ func _cellSizePtrTableLeaf(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) if nSize >= uint32(0x80) { pEnd = pIter + 8 nSize &= uint32(0x7f) - for cond := true; cond; cond = int32(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { + for cond := true; cond; cond = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pIter))) >= int32(0x80) && pIter < pEnd { pIter++ v1 = pIter - nSize = nSize<<libc.Int32FromInt32(7) | uint32(int32(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) + nSize = nSize<<libc.Int32FromInt32(7) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&libc.Int32FromInt32(0x7f)) } } pIter++ @@ -48583,51 +46460,50 @@ func _cellSizePtrTableLeaf(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) ** past the end of the key value. */ v2 = pIter pIter++ - if v4 = int32(*(*Tu8)(unsafe.Pointer(v2)))&int32(0x80) != 0; v4 { + if v4 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v2)))&int32(0x80) != 0; v4 { v3 = pIter pIter++ } - if v6 = v4 && int32(*(*Tu8)(unsafe.Pointer(v3)))&int32(0x80) != 0; v6 { + if v6 = v4 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v3)))&int32(0x80) != 0; v6 { v5 = pIter pIter++ } - if v8 = v6 && int32(*(*Tu8)(unsafe.Pointer(v5)))&int32(0x80) != 0; v8 { + if v8 = v6 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v5)))&int32(0x80) != 0; v8 { v7 = pIter pIter++ } - if v10 = v8 && int32(*(*Tu8)(unsafe.Pointer(v7)))&int32(0x80) != 0; v10 { + if v10 = v8 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v7)))&int32(0x80) != 0; v10 { v9 = pIter pIter++ } - if v12 = v10 && int32(*(*Tu8)(unsafe.Pointer(v9)))&int32(0x80) != 0; v12 { + if v12 = v10 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v9)))&int32(0x80) != 0; v12 { v11 = pIter pIter++ } - if v14 = v12 && int32(*(*Tu8)(unsafe.Pointer(v11)))&int32(0x80) != 0; v14 { + if v14 = v12 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v11)))&int32(0x80) != 0; v14 { v13 = pIter pIter++ } - if v16 = v14 && int32(*(*Tu8)(unsafe.Pointer(v13)))&int32(0x80) != 0; v16 { + if v16 = v14 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v13)))&int32(0x80) != 0; v16 { v15 = pIter pIter++ } - if v16 && int32(*(*Tu8)(unsafe.Pointer(v15)))&int32(0x80) != 0 { + if v16 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v15)))&int32(0x80) != 0 { pIter++ } if nSize <= uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize += uint32(int32(pIter) - int32(pCell)) + nSize += libc.Uint32FromInt32(int32(pIter) - int32(pCell)) if nSize < uint32(4) { nSize = uint32(4) } } else { - minLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - nSize = uint32(minLocal) + (nSize-uint32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) + minLocal = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) + nSize = libc.Uint32FromInt32(minLocal) + (nSize-libc.Uint32FromInt32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) if nSize > uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize = uint32(minLocal) + nSize = libc.Uint32FromInt32(minLocal) } - nSize += uint32(int32(4) + int32(uint16(int32(pIter)-int32(pCell)))) + nSize += libc.Uint32FromInt32(int32(4) + libc.Int32FromUint16(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) } - _ = libc.Int32FromInt32(0) return uint16(nSize) } @@ -48648,14 +46524,13 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr if *(*int32)(unsafe.Pointer(pRC)) != 0 { return } - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint32(pCell) < uint32((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint32(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint32((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72130)) return } - ovfl = _sqlite3Get4byte(tls, pCell+uintptr(int32((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) + ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) _ptrmapPut(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*TMemPage)(unsafe.Pointer(pPage)).Fpgno, pRC) } } @@ -48678,38 +46553,32 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { var cbrk, cellOffset, hdr, i, iCellFirst, iCellLast, iCellStart, iFree, iFree2, nCell, pc, size, sz, sz2, top, usableSize int32 var data, pAddr, pAddr1, pEnd, src, temp uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cbrk, cellOffset, data, hdr, i, iCellFirst, iCellLast, iCellStart, iFree, iFree2, nCell, pAddr, pAddr1, pEnd, pc, size, src, sz, sz2, temp, top, usableSize /* First cell offset in input */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) data = (*TMemPage)(unsafe.Pointer(pPage)).FaData - hdr = int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) - cellOffset = int32((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) - nCell = int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - _ = libc.Int32FromInt32(0) + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + cellOffset = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) + nCell = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) iCellFirst = cellOffset + int32(2)*nCell - usableSize = int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) + usableSize = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) /* This block handles pages with two or fewer free blocks and nMaxFrag ** or fewer fragmented bytes. In this case it is faster to move the ** two (or one) blocks of cells using memmove() and add the required ** offsets to each pointer in the cell-pointer array than it is to ** reconstruct the entire page. */ - if int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { - iFree = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))<<int32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)) + 1))) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { + iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)) + 1))) if iFree > usableSize-int32(4) { return _sqlite3CorruptError(tls, int32(72188)) } if iFree != 0 { - iFree2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))<<int32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree) + 1))) + iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree) + 1))) if iFree2 > usableSize-int32(4) { return _sqlite3CorruptError(tls, int32(72191)) } - if 0 == iFree2 || int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { + if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) sz2 = 0 - sz = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<<int32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)) + 1))) - top = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<int32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1))) + sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)) + 1))) + top = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1))) if top >= iFree { return _sqlite3CorruptError(tls, int32(72199)) } @@ -48717,11 +46586,11 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if iFree+sz > iFree2 { return _sqlite3CorruptError(tls, int32(72202)) } - sz2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))<<int32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)) + 1))) + sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)) + 1))) if iFree2+sz2 > usableSize { return _sqlite3CorruptError(tls, int32(72204)) } - libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), uint32(iFree2-(iFree+sz))) + libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint32FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { @@ -48729,21 +46598,20 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { } } cbrk = top + sz - _ = libc.Int32FromInt32(0) - libc.Xmemmove(tls, data+uintptr(cbrk), data+uintptr(top), uint32(iFree-top)) + libc.Xmemmove(tls, data+uintptr(cbrk), data+uintptr(top), libc.Uint32FromInt32(iFree-top)) pAddr = data + uintptr(cellOffset) for { if !(pAddr < pEnd) { break } - pc = int32(*(*Tu8)(unsafe.Pointer(pAddr)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(pAddr + 1))) + pc = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pAddr)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pAddr + 1))) if pc < iFree { - *(*Tu8)(unsafe.Pointer(pAddr)) = uint8((pc + sz) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(pAddr + 1)) = uint8(pc + sz) + *(*Tu8)(unsafe.Pointer(pAddr)) = libc.Uint8FromInt32((pc + sz) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(pAddr + 1)) = libc.Uint8FromInt32(pc + sz) } else { if pc < iFree2 { - *(*Tu8)(unsafe.Pointer(pAddr)) = uint8((pc + sz2) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(pAddr + 1)) = uint8(pc + sz2) + *(*Tu8)(unsafe.Pointer(pAddr)) = libc.Uint8FromInt32((pc + sz2) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(pAddr + 1)) = libc.Uint8FromInt32(pc + sz2) } } goto _1 @@ -48757,10 +46625,10 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { } cbrk = usableSize iCellLast = usableSize - int32(4) - iCellStart = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<int32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1))) + iCellStart = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1))) if nCell > 0 { temp = _sqlite3PagerTempSpace(tls, (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FpPager) - libc.Xmemcpy(tls, temp, data, uint32(usableSize)) + libc.Xmemcpy(tls, temp, data, libc.Uint32FromInt32(usableSize)) src = temp i = 0 for { @@ -48768,23 +46636,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { break } /* The i-th cell pointer */ pAddr1 = data + uintptr(cellOffset+i*int32(2)) - pc = int32(*(*Tu8)(unsafe.Pointer(pAddr1)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(pAddr1 + 1))) + pc = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pAddr1)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pAddr1 + 1))) /* These conditions have already been verified in btreeInitPage() ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { return _sqlite3CorruptError(tls, int32(72241)) } - _ = libc.Int32FromInt32(0) - size = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) + size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { return _sqlite3CorruptError(tls, int32(72247)) } - _ = libc.Int32FromInt32(0) - *(*Tu8)(unsafe.Pointer(pAddr1)) = uint8(cbrk >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = uint8(cbrk) - libc.Xmemcpy(tls, data+uintptr(cbrk), src+uintptr(pc), uint32(size)) + *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) + libc.Xmemcpy(tls, data+uintptr(cbrk), src+uintptr(pc), libc.Uint32FromInt32(size)) goto _2 _2: ; @@ -48795,17 +46661,14 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { goto defragment_out defragment_out: ; - _ = libc.Int32FromInt32(0) - if int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { return _sqlite3CorruptError(tls, int32(72261)) } - _ = libc.Int32FromInt32(0) - *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8(cbrk >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8(cbrk) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))) = uint8(0) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(2)))) = uint8(0) - libc.Xmemset(tls, data+uintptr(iCellFirst), 0, uint32(cbrk-iCellFirst)) - _ = libc.Int32FromInt32(0) + libc.Xmemset(tls, data+uintptr(iCellFirst), 0, libc.Uint32FromInt32(cbrk-iCellFirst)) return SQLITE_OK } @@ -48829,33 +46692,32 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint var aData, pTmp, p2 uintptr var hdr, iAddr, maxPC, pc, size, x, v1 int32 _, _, _, _, _, _, _, _, _, _ = aData, hdr, iAddr, maxPC, pTmp, pc, size, x, v1, p2 - hdr = int32((*TMemPage)(unsafe.Pointer(pPg)).FhdrOffset) /* Offset to page header */ - aData = (*TMemPage)(unsafe.Pointer(pPg)).FaData /* Page data */ - iAddr = hdr + int32(1) /* Address of ptr to pc */ - pTmp = aData + uintptr(iAddr) /* Temporary ptr into aData[] */ - pc = int32(*(*Tu8)(unsafe.Pointer(pTmp)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(pTmp + 1))) /* Excess size of the slot */ - maxPC = int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize - uint32(nByte)) /* Size of the free slot */ - _ = libc.Int32FromInt32(0) + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPg)).FhdrOffset) /* Offset to page header */ + aData = (*TMemPage)(unsafe.Pointer(pPg)).FaData /* Page data */ + iAddr = hdr + int32(1) /* Address of ptr to pc */ + pTmp = aData + uintptr(iAddr) /* Temporary ptr into aData[] */ + pc = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp + 1))) /* Excess size of the slot */ + maxPC = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize - libc.Uint32FromInt32(nByte)) /* Size of the free slot */ for pc <= maxPC { /* EVIDENCE-OF: R-22710-53328 The third and fourth bytes of each ** freeblock form a big-endian integer which is the size of the freeblock ** in bytes, including the 4-byte header. */ pTmp = aData + uintptr(pc+int32(2)) - size = int32(*(*Tu8)(unsafe.Pointer(pTmp)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(pTmp + 1))) + size = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp + 1))) v1 = size - nByte x = v1 if v1 >= 0 { if x < int32(4) { /* EVIDENCE-OF: R-11498-58022 In a well-formed b-tree page, the total ** number of bytes in fragments may not exceed 60. */ - if int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(7))))) > int32(57) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(7))))) > int32(57) { return uintptr(0) } /* Remove the slot from the free-list. Update the number of ** fragmented bytes within the page. */ libc.Xmemcpy(tls, aData+uintptr(iAddr), aData+uintptr(pc), uint32(2)) p2 = aData + uintptr(hdr+int32(7)) - *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) + int32(uint8(x))) + *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) + libc.Int32FromUint8(libc.Uint8FromInt32(x))) return aData + uintptr(pc) } else { if x+pc > maxPC { @@ -48865,15 +46727,15 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { /* The slot remains on the free-list. Reduce its size to account ** for the portion used by the new allocation. */ - *(*Tu8)(unsafe.Pointer(aData + uintptr(pc+int32(2)))) = uint8(x >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(aData + uintptr(pc+int32(2)) + 1)) = uint8(x) + *(*Tu8)(unsafe.Pointer(aData + uintptr(pc+int32(2)))) = libc.Uint8FromInt32(x >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(pc+int32(2)) + 1)) = libc.Uint8FromInt32(x) } } return aData + uintptr(pc+x) } iAddr = pc pTmp = aData + uintptr(pc) - pc = int32(*(*Tu8)(unsafe.Pointer(pTmp)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(pTmp + 1))) + pc = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp + 1))) if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ @@ -48911,26 +46773,18 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r var g2, gap, hdr, top, v1, v2 int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _ = data, g2, gap, hdr, pSpace, pTmp, top, v1, v2 - hdr = int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) /* Local cache of pPage->hdrOffset */ - data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* First byte of cell content area */ - *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK /* First byte of gap between cell pointers and cell content */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Minimum cell size is 4 */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - gap = int32((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) + int32(2)*int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - _ = libc.Int32FromInt32(0) + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) /* Local cache of pPage->hdrOffset */ + data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* First byte of cell content area */ + *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK /* First byte of gap between cell pointers and cell content */ + /* Minimum cell size is 4 */ + gap = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) + int32(2)*libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) /* EVIDENCE-OF: R-29356-02391 If the database uses a 65536-byte page size ** and the reserved space is zero (the usual value for reserved space) ** then the cell content offset of an empty page wants to be 65536. ** However, that integer is too large to be stored in a 2-byte unsigned ** integer, so a value of 0 is used in its place. */ pTmp = data + uintptr(hdr+int32(5)) - top = int32(*(*Tu8)(unsafe.Pointer(pTmp)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(pTmp + 1))) + top = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp + 1))) if gap > top { if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) @@ -48938,7 +46792,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r return _sqlite3CorruptError(tls, int32(72388)) } } else { - if top > int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { return _sqlite3CorruptError(tls, int32(72391)) } } @@ -48949,7 +46803,6 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if (*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(2)))) != 0 || *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))) != 0) && gap+int32(2) <= top { pSpace = _pageFindSlot(tls, pPage, nByte, bp) if pSpace != 0 { - _ = libc.Int32FromInt32(0) v1 = int32(pSpace) - int32(data) g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 @@ -48968,8 +46821,6 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r ** to see if defragmentation is necessary. */ if gap+int32(2)+nByte > top { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(4) < (*TMemPage)(unsafe.Pointer(pPage)).FnFree-(int32(2)+nByte) { v2 = int32(4) } else { @@ -48979,8 +46830,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if *(*int32)(unsafe.Pointer(bp)) != 0 { return *(*int32)(unsafe.Pointer(bp)) } - top = (int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<libc.Int32FromInt32(8)|int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)))-int32(1))&int32(0xffff) + int32(1) - _ = libc.Int32FromInt32(0) + top = (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<libc.Int32FromInt32(8)|libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)))-int32(1))&int32(0xffff) + int32(1) } /* Allocate memory from the gap in between the cell pointer array ** and the cell content area. The btreeComputeFreeSpace() call has already @@ -48989,9 +46839,8 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r ** The assert() below verifies the previous sentence. */ top -= nByte - *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8(top >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8(top) - _ = libc.Int32FromInt32(0) + *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(top >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(top) *(*int32)(unsafe.Pointer(pIdx)) = top return SQLITE_OK } @@ -49020,31 +46869,25 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ nFrag = uint8(0) /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = uint32(int32(iStart) + int32(iSize)) /* First byte past the iStart buffer */ + iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Minimum cell size is 4 */ - _ = libc.Int32FromInt32(0) + /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = uint16(int32(hdr) + int32(1)) - if int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+int32(1))))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = uint16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))<<libc.Int32FromInt32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)))) + v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)))) iFreeBlk = v1 - if !(int32(v1) < int32(iStart)) { + if !(libc.Int32FromUint16(v1) < libc.Int32FromUint16(iStart)) { break } - if int32(iFreeBlk) <= int32(iPtr) { - if int32(iFreeBlk) == 0 { + if libc.Int32FromUint16(iFreeBlk) <= libc.Int32FromUint16(iPtr) { + if libc.Int32FromUint16(iFreeBlk) == 0 { break } /* TH3: corrupt082.100 */ return _sqlite3CorruptError(tls, int32(72487)) @@ -49054,7 +46897,6 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) if uint32(iFreeBlk) > (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ return _sqlite3CorruptError(tls, int32(72492)) } - _ = libc.Int32FromInt32(0) /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none ** iPtr: The address of a pointer to iFreeBlk @@ -49066,65 +46908,65 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) if iEnd > uint32(iFreeBlk) { return _sqlite3CorruptError(tls, int32(72504)) } - iEnd = uint32(int32(iFreeBlk) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iFreeBlk)+int32(2)))))<<int32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iFreeBlk)+int32(2)) + 1))))) + iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)) + 1))))) if iEnd > (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { return _sqlite3CorruptError(tls, int32(72507)) } iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = uint16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))<<libc.Int32FromInt32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk) + 1)))) + iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk) + 1)))) } /* If iPtr is another freeblock (that is, if iPtr is not the freelist ** pointer in the page header) then check to see if iStart should be ** coalesced onto the end of iPtr. */ - if int32(iPtr) > int32(hdr)+int32(1) { - iPtrEnd = int32(iPtr) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+int32(2)))))<<int32(8) | int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+int32(2)) + 1)))) - if iPtrEnd+int32(3) >= int32(iStart) { - if iPtrEnd > int32(iStart) { + if libc.Int32FromUint16(iPtr) > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)) + 1)))) + if iPtrEnd+int32(3) >= libc.Int32FromUint16(iStart) { + if iPtrEnd > libc.Int32FromUint16(iStart) { return _sqlite3CorruptError(tls, int32(72520)) } - nFrag = Tu8(int32(nFrag) + (int32(iStart) - iPtrEnd)) + nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) iSize = uint16(iEnd - uint32(iPtr)) iStart = iPtr } } - if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7))))) { + if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { return _sqlite3CorruptError(tls, int32(72526)) } - p2 = data + uintptr(int32(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - int32(nFrag)) + p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) } - pTmp = data + uintptr(int32(hdr)+int32(5)) - x = uint16(int32(*(*Tu8)(unsafe.Pointer(pTmp)))<<libc.Int32FromInt32(8) | int32(*(*Tu8)(unsafe.Pointer(pTmp + 1)))) - if int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { + pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp + 1)))) + if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { /* Overwrite deleted information with zeros when the secure_delete ** option is enabled */ libc.Xmemset(tls, data+uintptr(iStart), 0, uint32(iSize)) } - if int32(iStart) <= int32(x) { + if libc.Int32FromUint16(iStart) <= libc.Int32FromUint16(x) { /* The new freeblock is at the beginning of the cell content area, ** so just extend the cell content area rather than create another ** freelist entry */ - if int32(iStart) < int32(x) { + if libc.Int32FromUint16(iStart) < libc.Int32FromUint16(x) { return _sqlite3CorruptError(tls, int32(72540)) } - if int32(iPtr) != int32(hdr)+int32(1) { + if libc.Int32FromUint16(iPtr) != libc.Int32FromUint8(hdr)+int32(1) { return _sqlite3CorruptError(tls, int32(72541)) } - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(1)))) = uint8(int32(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = uint8(int32(iStart) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = uint8(int32(iFreeBlk) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+int32(2)))) = uint8(int32(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+int32(2)) + 1)) = uint8(iSize) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) } - *(*int32)(unsafe.Pointer(pPage + 20)) += int32(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) return SQLITE_OK } @@ -49145,8 +46987,6 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { var pBt uintptr _ = pBt /* A copy of pPage->pBt */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt (*TMemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload = (*TBtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload if flagByte >= libc.Int32FromInt32(PTF_ZERODATA)|libc.Int32FromInt32(PTF_LEAF) { @@ -49217,29 +47057,21 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { var iCellFirst, iCellLast, nFree, pc, top, usableSize int32 var next, size Tu32 _, _, _, _, _, _, _, _, _, _ = data, hdr, iCellFirst, iCellLast, nFree, next, pc, size, top, usableSize /* Last possible cell or freeblock offset */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - usableSize = int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) + usableSize = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* EVIDENCE-OF: R-58015-48175 The two-byte integer at offset 5 designates ** the start of the cell content area. A zero value for this integer is ** interpreted as 65536. */ - top = (int32(*(*Tu8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))))<<libc.Int32FromInt32(8)|int32(*(*Tu8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)) + 1)))-int32(1))&int32(0xffff) + int32(1) - iCellFirst = int32(hdr) + int32(8) + int32((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + int32(2)*int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) + top = (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))))<<libc.Int32FromInt32(8)|libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)))-int32(1))&int32(0xffff) + int32(1) + iCellFirst = libc.Int32FromUint8(hdr) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + int32(2)*libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) iCellLast = usableSize - int32(4) /* Compute the total free space on the page ** EVIDENCE-OF: R-23588-34450 The two-byte integer at offset 1 gives the ** start of the first freeblock on the page, or is zero if there are no ** freeblocks. */ - pc = int32(*(*Tu8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(1)))))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(1)) + 1))) - nFree = int32(*(*Tu8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7))))) + top /* Init nFree to non-freeblock free space */ + pc = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1))) + nFree = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) + top /* Init nFree to non-freeblock free space */ if pc > 0 { if pc < top { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will @@ -49252,19 +47084,19 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* Freeblock off the end of the page */ return _sqlite3CorruptError(tls, int32(72675)) } - next = uint32(int32(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))<<libc.Int32FromInt32(8) | int32(*(*Tu8)(unsafe.Pointer(data + uintptr(pc) + 1)))) - size = uint32(int32(*(*Tu8)(unsafe.Pointer(data + uintptr(pc+int32(2)))))<<libc.Int32FromInt32(8) | int32(*(*Tu8)(unsafe.Pointer(data + uintptr(pc+int32(2)) + 1)))) - nFree = int32(uint32(nFree) + size) - if next <= uint32(pc)+size+uint32(3) { + next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc) + 1)))) + size = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc+int32(2)))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc+int32(2)) + 1)))) + nFree = libc.Int32FromUint32(libc.Uint32FromInt32(nFree) + size) + if next <= libc.Uint32FromInt32(pc)+size+uint32(3) { break } - pc = int32(next) + pc = libc.Int32FromUint32(next) } if next > uint32(0) { /* Freeblock not in ascending order */ return _sqlite3CorruptError(tls, int32(72685)) } - if uint32(pc)+size > uint32(usableSize) { + if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ return _sqlite3CorruptError(tls, int32(72689)) } @@ -49279,7 +47111,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { if nFree > usableSize || nFree < iCellFirst { return _sqlite3CorruptError(tls, int32(72701)) } - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16(nFree - iCellFirst)) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK } @@ -49293,24 +47125,24 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { var cellOffset, i, iCellFirst, iCellLast, pc, sz, usableSize int32 var data uintptr _, _, _, _, _, _, _, _ = cellOffset, data, i, iCellFirst, iCellLast, pc, sz, usableSize /* Start of cell content area */ - iCellFirst = int32((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) + int32(2)*int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - usableSize = int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) + iCellFirst = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) + int32(2)*libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) + usableSize = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) iCellLast = usableSize - int32(4) data = (*TMemPage)(unsafe.Pointer(pPage)).FaData - cellOffset = int32((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) + cellOffset = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { iCellLast-- } i = 0 for { - if !(i < int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell)) { + if !(i < libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell)) { break } - pc = int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) + pc = libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { return _sqlite3CorruptError(tls, int32(72732)) } - sz = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) + sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { return _sqlite3CorruptError(tls, int32(72737)) } @@ -49336,30 +47168,22 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { var data, pBt uintptr _, _ = data, pBt /* The main btree structure */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt data = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ - if _decodeFlags(tls, pPage, int32(*(*Tu8)(unsafe.Pointer(data)))) != 0 { + if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { return _sqlite3CorruptError(tls, int32(72769)) } - _ = libc.Int32FromInt32(0) (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = uint16(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + int32((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) /* EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the ** number of cells on the page. */ - (*TMemPage)(unsafe.Pointer(pPage)).FnCell = uint16(int32(*(*Tu8)(unsafe.Pointer(data + 3)))<<libc.Int32FromInt32(8) | int32(*(*Tu8)(unsafe.Pointer(data + 3 + 1)))) + (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3 + 1)))) if uint32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) > ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ return _sqlite3CorruptError(tls, int32(72783)) @@ -49368,7 +47192,6 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { ** possible for a root page of a table that contains no rows) then the ** offset to the cell content area will equal the page size minus the ** bytes of reserved space. */ - _ = libc.Int32FromInt32(0) (*TMemPage)(unsafe.Pointer(pPage)).FnFree = -int32(1) /* Indicate that this value is yet uncomputed */ (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(1) if (*Tsqlite3)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags&uint64(SQLITE_CellSizeCk) != 0 { @@ -49392,33 +47215,27 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { + if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { libc.Xmemset(tls, data+uintptr(hdr), 0, (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr)) } - *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(int8(flags)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt8(int8(flags)) if flags&int32(PTF_LEAF) == 0 { v1 = int32(12) } else { v1 = int32(8) } - first = uint16(int32(hdr) + v1) - libc.Xmemset(tls, data+uintptr(int32(hdr)+int32(1)), 0, uint32(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) + libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint32(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) _decodeFlags(tls, pPage, flags) (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - _ = libc.Int32FromInt32(0) (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnCell = uint16(0) (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(1) @@ -49445,9 +47262,8 @@ func _btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno TPgno, pBt uintpt } else { v1 = 0 } - (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset = uint8(v1) + (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset = libc.Uint8FromInt32(v1) } - _ = libc.Int32FromInt32(0) return pPage } @@ -49470,8 +47286,6 @@ func _btreeGetPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, flags var rc int32 var _ /* pDbPage at bp+0 */ uintptr _ = rc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, flags) if rc != 0 { return rc @@ -49490,7 +47304,6 @@ func _btreeGetPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, flags func _btreePageLookup(tls *libc.TLS, pBt uintptr, pgno TPgno) (r uintptr) { var pDbPage uintptr _ = pDbPage - _ = libc.Int32FromInt32(0) pDbPage = _sqlite3PagerLookup(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno) if pDbPage != 0 { return _btreePageFromDbPage(tls, pDbPage, pgno, pBt) @@ -49509,7 +47322,6 @@ func _btreePagecount(tls *libc.TLS, pBt uintptr) (r TPgno) { } func _sqlite3BtreeLastPage(tls *libc.TLS, p uintptr) (r TPgno) { - _ = libc.Int32FromInt32(0) return _btreePagecount(tls, (*TBtree)(unsafe.Pointer(p)).FpBt) } @@ -49525,7 +47337,6 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe var rc int32 var _ /* pDbPage at bp+0 */ uintptr _, _ = pPage, rc - _ = libc.Int32FromInt32(0) if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) return _sqlite3CorruptError(tls, int32(72926)) @@ -49536,7 +47347,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe return rc } pPage = _sqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp))) - if int32((*TMemPage)(unsafe.Pointer(pPage)).FisInit) == 0 { + if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FisInit) == 0 { _btreePageFromDbPage(tls, *(*uintptr)(unsafe.Pointer(bp)), pgno, pBt) rc = _btreeInitPage(tls, pPage) if rc != SQLITE_OK { @@ -49545,8 +47356,6 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe return rc } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(ppPage)) = pPage return SQLITE_OK } @@ -49560,12 +47369,6 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe // ** Page1 is a special case and must be released using releasePageOne(). // */ func _releasePageNotNull(tls *libc.TLS, pPage uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3PagerUnrefNotNull(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) } @@ -49576,13 +47379,6 @@ func _releasePage(tls *libc.TLS, pPage uintptr) { } func _releasePageOne(tls *libc.TLS, pPage uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3PagerUnrefPageOne(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) } @@ -49628,9 +47424,7 @@ func _pageReinit(tls *libc.TLS, pData uintptr) { var pPage uintptr _ = pPage pPage = _sqlite3PagerGetExtra(tls, pData) - _ = libc.Int32FromInt32(0) if (*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0 { - _ = libc.Int32FromInt32(0) (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) if _sqlite3PagerPageRefcount(tls, pData) > int32(1) { /* pPage might not be a btree page; it might be an overflow page @@ -49653,8 +47447,6 @@ func _btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) (r int32) { var pBt uintptr _ = pBt pBt = pArg - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return _sqlite3InvokeBusyHandler(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb+456) } @@ -49698,14 +47490,9 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt ** false for a file-based database. */ isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4254) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* flags fit in 8 bits */ + /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ - _ = libc.Int32FromInt32(0) /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ - _ = libc.Int32FromInt32(0) if isMemdb != 0 { flags |= int32(BTREE_MEMORY) } @@ -49733,14 +47520,14 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt } else { v1 = nFilename } - zFullPathname = _sqlite3Malloc(tls, uint64(v1)) + zFullPathname = _sqlite3Malloc(tls, libc.Uint64FromInt32(v1)) (*TBtree)(unsafe.Pointer(p)).Fsharable = uint8(1) if !(zFullPathname != 0) { Xsqlite3_free(tls, p) return int32(SQLITE_NOMEM) } if isMemdb != 0 { - libc.Xmemcpy(tls, zFullPathname, zFilename, uint32(nFilename)) + libc.Xmemcpy(tls, zFullPathname, zFilename, libc.Uint32FromInt32(nFilename)) } else { rc = _sqlite3OsFullPathname(tls, pVfs, zFilename, nFullPathname, zFullPathname) if rc != 0 { @@ -49762,7 +47549,6 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt if !(pBt != 0) { break } - _ = libc.Int32FromInt32(0) if 0 == libc.Xstrcmp(tls, zFullPathname, _sqlite3PagerFilename(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, 0)) && _sqlite3PagerVfs(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager) == pVfs { iDb = (*Tsqlite3)(unsafe.Pointer(db)).FnDb - int32(1) for { @@ -49801,11 +47587,6 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt ** the right size. This is to guard against size changes that result ** when compiling on a different architecture. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Suppress false-positive compiler warning from PVS-Studio */ libc.Xmemset(tls, bp+16, 0, uint32(8)) pBt = _sqlite3MallocZero(tls, uint64(92)) @@ -49821,7 +47602,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt if rc != SQLITE_OK { goto btree_open_out } - (*TBtShared)(unsafe.Pointer(pBt)).FopenFlags = uint8(flags) + (*TBtShared)(unsafe.Pointer(pBt)).FopenFlags = libc.Uint8FromInt32(flags) (*TBtShared)(unsafe.Pointer(pBt)).Fdb = db _sqlite3PagerSetBusyHandler(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, __ccgo_fp(_btreeInvokeBusyHandler), pBt) (*TBtree)(unsafe.Pointer(p)).FpBt = pBt @@ -49834,7 +47615,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* EVIDENCE-OF: R-51873-39618 The page size for a database file is ** determined by the 2-byte integer located at an offset of 16 bytes from ** the beginning of the database file. */ - (*TBtShared)(unsafe.Pointer(pBt)).FpageSize = uint32(int32((*(*[100]uint8)(unsafe.Pointer(bp)))[int32(16)])<<int32(8) | int32((*(*[100]uint8)(unsafe.Pointer(bp)))[int32(17)])<<int32(16)) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize = libc.Uint32FromInt32(libc.Int32FromUint8((*(*[100]uint8)(unsafe.Pointer(bp)))[int32(16)])<<int32(8) | libc.Int32FromUint8((*(*[100]uint8)(unsafe.Pointer(bp)))[int32(17)])<<int32(16)) if (*TBtShared)(unsafe.Pointer(pBt)).FpageSize < uint32(512) || (*TBtShared)(unsafe.Pointer(pBt)).FpageSize > uint32(SQLITE_MAX_PAGE_SIZE) || ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(1))&(*TBtShared)(unsafe.Pointer(pBt)).FpageSize != uint32(0) { (*TBtShared)(unsafe.Pointer(pBt)).FpageSize = uint32(0) /* If the magic name ":memory:" will create an in-memory database, then @@ -49844,8 +47625,8 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt ** regular file-name. In this case the auto-vacuum applies as per normal. */ if zFilename != 0 && !(isMemdb != 0) { - (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum = uint8(libc.Int32FromInt32(0)) - (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = uint8(libc.Int32FromInt32(0)) + (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum = libc.Uint8FromInt32(libc.Int32FromInt32(0)) + (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = libc.Uint8FromInt32(libc.Int32FromInt32(0)) } nReserve = uint8(0) } else { @@ -49860,20 +47641,20 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt } else { v6 = 0 } - (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum = uint8(v6) + (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum = libc.Uint8FromInt32(v6) if _sqlite3Get4byte(tls, bp+uintptr(libc.Int32FromInt32(36)+libc.Int32FromInt32(7)*libc.Int32FromInt32(4))) != 0 { v7 = int32(1) } else { v7 = 0 } - (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = uint8(v7) + (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = libc.Uint8FromInt32(v7) } - rc = _sqlite3PagerSetPagesize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pBt+36, int32(nReserve)) + rc = _sqlite3PagerSetPagesize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pBt+36, libc.Int32FromUint8(nReserve)) if rc != 0 { goto btree_open_out } (*TBtShared)(unsafe.Pointer(pBt)).FusableSize = (*TBtShared)(unsafe.Pointer(pBt)).FpageSize - uint32(nReserve) - _ = libc.Int32FromInt32(0) /* 8-byte alignment of pageSize */ + /* 8-byte alignment of pageSize */ /* Add the new BtShared object to the linked list sharable BtShareds. */ (*TBtShared)(unsafe.Pointer(pBt)).FnRef = int32(1) @@ -49956,10 +47737,8 @@ btree_open_out: } } if mutexOpen != 0 { - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, mutexOpen) } - _ = libc.Int32FromInt32(0) return rc } @@ -49976,7 +47755,6 @@ func _removeFromSharingList(tls *libc.TLS, pBt uintptr) (r int32) { var removed int32 _, _, _ = pList, pMainMtx, removed removed = 0 - _ = libc.Int32FromInt32(0) pMainMtx = _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN)) Xsqlite3_mutex_enter(tls, pMainMtx) (*TBtShared)(unsafe.Pointer(pBt)).FnRef-- @@ -50011,12 +47789,9 @@ func _removeFromSharingList(tls *libc.TLS, pBt uintptr) (r int32) { func _allocateTempSpace(tls *libc.TLS, pBt uintptr) (r int32) { var pCur uintptr _ = pCur - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* This routine is called only by btreeCursor() when allocating the ** first write cursor for the BtShared object */ - _ = libc.Int32FromInt32(0) - (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace = _sqlite3PageMalloc(tls, int32((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) + (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace = _sqlite3PageMalloc(tls, libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) if (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace == uintptr(0) { pCur = (*TBtShared)(unsafe.Pointer(pBt)).FpCursor (*TBtShared)(unsafe.Pointer(pBt)).FpCursor = (*TBtCursor)(unsafe.Pointer(pCur)).FpNext /* Unlink the cursor */ @@ -50066,7 +47841,6 @@ func _sqlite3BtreeClose(tls *libc.TLS, p uintptr) (r int32) { _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt /* Close all cursors opened via this handle. */ - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) /* Verify that no other cursors have this Btree open */ /* Rollback any active transaction and free the handle structure. @@ -50079,14 +47853,12 @@ func _sqlite3BtreeClose(tls *libc.TLS, p uintptr) (r int32) { ** structure, return now. The remainder of this procedure cleans ** up the shared-btree. */ - _ = libc.Int32FromInt32(0) if !((*TBtree)(unsafe.Pointer(p)).Fsharable != 0) || _removeFromSharingList(tls, pBt) != 0 { /* The pBt is no longer on the sharing list, so we can access ** it without having to hold the mutex. ** ** Clean out and delete the BtShared object. */ - _ = libc.Int32FromInt32(0) _sqlite3PagerClose(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, (*TBtree)(unsafe.Pointer(p)).Fdb) if (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema != 0 && (*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema})))(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpSchema) @@ -50095,8 +47867,6 @@ func _sqlite3BtreeClose(tls *libc.TLS, p uintptr) (r int32) { _freeTempSpace(tls, pBt) Xsqlite3_free(tls, pBt) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TBtree)(unsafe.Pointer(p)).FpPrev != 0 { (*TBtree)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpPrev)).FpNext = (*TBtree)(unsafe.Pointer(p)).FpNext } @@ -50120,7 +47890,6 @@ func _sqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) (r int32) var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) _sqlite3PagerSetCachesize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, mxPage) _sqlite3BtreeLeave(tls, p) @@ -50144,7 +47913,6 @@ func _sqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) (r int32) var res int32 _, _ = pBt, res pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) res = _sqlite3PagerSetSpillsize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, mxPage) _sqlite3BtreeLeave(tls, p) @@ -50161,7 +47929,6 @@ func _sqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Tsqlite3_int64) var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) _sqlite3PagerSetMmapLimit(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, szMmap) _sqlite3BtreeLeave(tls, p) @@ -50182,7 +47949,6 @@ func _sqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) (r int var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) _sqlite3PagerSetFlags(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgFlags) _sqlite3BtreeLeave(tls, p) @@ -50217,29 +47983,25 @@ func _sqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve _, _, _, _ = pBt, rc, x, p1 rc = SQLITE_OK pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) - (*TBtShared)(unsafe.Pointer(pBt)).FnReserveWanted = uint8(nReserve) - x = int32((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - (*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TBtShared)(unsafe.Pointer(pBt)).FnReserveWanted = libc.Uint8FromInt32(nReserve) + x = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - (*TBtShared)(unsafe.Pointer(pBt)).FusableSize) if nReserve < x { nReserve = x } - if int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_PAGESIZE_FIXED) != 0 { + if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_PAGESIZE_FIXED) != 0 { _sqlite3BtreeLeave(tls, p) return int32(SQLITE_READONLY) } - _ = libc.Int32FromInt32(0) if pageSize >= int32(512) && pageSize <= int32(SQLITE_MAX_PAGE_SIZE) && (pageSize-int32(1))&pageSize == 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if nReserve > int32(32) && pageSize == int32(512) { pageSize = int32(1024) } - (*TBtShared)(unsafe.Pointer(pBt)).FpageSize = uint32(pageSize) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize = libc.Uint32FromInt32(pageSize) _freeTempSpace(tls, pBt) } rc = _sqlite3PagerSetPagesize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pBt+36, nReserve) - (*TBtShared)(unsafe.Pointer(pBt)).FusableSize = (*TBtShared)(unsafe.Pointer(pBt)).FpageSize - uint32(uint16(nReserve)) + (*TBtShared)(unsafe.Pointer(pBt)).FusableSize = (*TBtShared)(unsafe.Pointer(pBt)).FpageSize - uint32(libc.Uint16FromInt32(nReserve)) if iFix != 0 { p1 = pBt + 24 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(BTS_PAGESIZE_FIXED)) @@ -50254,7 +48016,7 @@ func _sqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve // ** Return the currently defined page size // */ func _sqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) (r int32) { - return int32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FpageSize) + return libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FpageSize) } // C documentation @@ -50273,8 +48035,7 @@ func _sqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) (r int32) { var n int32 _ = n - _ = libc.Int32FromInt32(0) - n = int32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FpageSize - (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FusableSize) + n = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FpageSize - (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FusableSize) return n } @@ -50293,7 +48054,7 @@ func _sqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) (r int32) { var n1, n2, v1 int32 _, _, _ = n1, n2, v1 _sqlite3BtreeEnter(tls, p) - n1 = int32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnReserveWanted) + n1 = libc.Int32FromUint8((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnReserveWanted) n2 = _sqlite3BtreeGetReserveNoMutex(tls, p) _sqlite3BtreeLeave(tls, p) if n1 > n2 { @@ -50348,15 +48109,13 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 return 0 } _sqlite3BtreeEnter(tls, p) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if newFlag >= 0 { p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 24 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 24 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) } - b = int32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) + b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) return b } @@ -50377,16 +48136,16 @@ func _sqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) (r i _, _, _, _, _, _, _ = av, pBt, rc, v1, v2, v3, v4 pBt = (*TBtree)(unsafe.Pointer(p)).FpBt rc = SQLITE_OK - av = uint8(autoVacuum) + av = libc.Uint8FromInt32(autoVacuum) _sqlite3BtreeEnter(tls, p) - if v2 = int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_PAGESIZE_FIXED) != 0; v2 { + if v2 = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_PAGESIZE_FIXED) != 0; v2 { if av != 0 { v1 = int32(1) } else { v1 = 0 } } - if v2 && v1 != int32((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum) { + if v2 && v1 != libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum) { rc = int32(SQLITE_READONLY) } else { if av != 0 { @@ -50394,13 +48153,13 @@ func _sqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) (r i } else { v3 = 0 } - (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum = uint8(v3) - if int32(av) == int32(2) { + (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum = libc.Uint8FromInt32(v3) + if libc.Int32FromUint8(av) == int32(2) { v4 = int32(1) } else { v4 = 0 } - (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = uint8(v4) + (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = libc.Uint8FromInt32(v4) } _sqlite3BtreeLeave(tls, p) return rc @@ -50453,8 +48212,6 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { var _ /* pPage1 at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _ = nPage, page1, pageSize, rc, usableSize, v4, v5, p1, p2, p3 /* Number of pages in the database */ *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(0) /* Number of pages in the database file */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3PagerSharedLock(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager) if rc != SQLITE_OK { return rc @@ -50483,11 +48240,11 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { if libc.Xmemcmp(tls, page1, uintptr(unsafe.Pointer(&_zMagicHeader)), uint32(16)) != 0 { goto page1_init_failed } - if int32(*(*Tu8)(unsafe.Pointer(page1 + 18))) > int32(2) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(page1 + 18))) > int32(2) { p1 = pBt + 24 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(BTS_READ_ONLY)) } - if int32(*(*Tu8)(unsafe.Pointer(page1 + 19))) > int32(2) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(page1 + 19))) > int32(2) { goto page1_init_failed } /* If the read version is set to 2, this database should be accessed @@ -50498,7 +48255,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** may not be the latest version - there may be a newer one in the log ** file. */ - if int32(*(*Tu8)(unsafe.Pointer(page1 + 19))) == int32(2) && int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_NO_WAL) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(page1 + 19))) == int32(2) && libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_NO_WAL) == 0 { *(*int32)(unsafe.Pointer(bp + 8)) = 0 rc = _sqlite3PagerOpenWal(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, bp+8) if rc != SQLITE_OK { @@ -50524,13 +48281,12 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { /* EVIDENCE-OF: R-51873-39618 The page size for a database file is ** determined by the 2-byte integer located at an offset of 16 bytes from ** the beginning of the database file. */ - pageSize = uint32(int32(*(*Tu8)(unsafe.Pointer(page1 + 16)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(page1 + 17)))<<int32(16)) + pageSize = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(page1 + 16)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(page1 + 17)))<<int32(16)) /* EVIDENCE-OF: R-25008-21688 The size of a page is a power of two ** between 512 and 65536 inclusive. */ if (pageSize-uint32(1))&pageSize != uint32(0) || pageSize > uint32(SQLITE_MAX_PAGE_SIZE) || pageSize <= uint32(256) { goto page1_init_failed } - _ = libc.Int32FromInt32(0) /* EVIDENCE-OF: R-59310-51205 The "reserved space" size in the 1-byte ** integer at offset 20 is the number of bytes of space at the end of ** each page to reserve for extensions. @@ -50552,7 +48308,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { p2 = pBt + 24 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_PAGESIZE_FIXED)) _freeTempSpace(tls, pBt) - rc = _sqlite3PagerSetPagesize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pBt+36, int32(pageSize-usableSize)) + rc = _sqlite3PagerSetPagesize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pBt+36, libc.Int32FromUint32(pageSize-usableSize)) return rc } if nPage > *(*Tu32)(unsafe.Pointer(bp + 4)) { @@ -50578,13 +48334,13 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } else { v4 = 0 } - (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum = uint8(v4) + (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum = libc.Uint8FromInt32(v4) if _sqlite3Get4byte(tls, page1+uintptr(libc.Int32FromInt32(36)+libc.Int32FromInt32(7)*libc.Int32FromInt32(4))) != 0 { v5 = int32(1) } else { v5 = 0 } - (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = uint8(v5) + (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = libc.Uint8FromInt32(v5) } /* maxLocal is the maximum amount of payload to store locally for ** a cell. Make sure it is small enough so that at least minFanout @@ -50603,12 +48359,11 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { (*TBtShared)(unsafe.Pointer(pBt)).FminLocal = uint16(((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(12))*libc.Uint32FromInt32(32)/libc.Uint32FromInt32(255) - libc.Uint32FromInt32(23)) (*TBtShared)(unsafe.Pointer(pBt)).FmaxLeaf = uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(35)) (*TBtShared)(unsafe.Pointer(pBt)).FminLeaf = uint16(((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(12))*libc.Uint32FromInt32(32)/libc.Uint32FromInt32(255) - libc.Uint32FromInt32(23)) - if int32((*TBtShared)(unsafe.Pointer(pBt)).FmaxLocal) > int32(127) { + if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FmaxLocal) > int32(127) { (*TBtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload = uint8(127) } else { (*TBtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload = uint8((*TBtShared)(unsafe.Pointer(pBt)).FmaxLocal) } - _ = libc.Int32FromInt32(0) (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 = *(*uintptr)(unsafe.Pointer(bp)) (*TBtShared)(unsafe.Pointer(pBt)).FnPage = nPage return SQLITE_OK @@ -50633,12 +48388,8 @@ page1_init_failed: func _unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { var pPage1 uintptr _ = pPage1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE && (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 != uintptr(0) { + if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE && (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 != uintptr(0) { pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 = uintptr(0) _releasePageOne(tls, pPage1) } @@ -50655,34 +48406,28 @@ func _newDatabase(tls *libc.TLS, pBt uintptr) (r int32) { var data, pP1, p1 uintptr var rc int32 _, _, _, _ = data, pP1, rc, p1 - _ = libc.Int32FromInt32(0) if (*TBtShared)(unsafe.Pointer(pBt)).FnPage > uint32(0) { return SQLITE_OK } pP1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 - _ = libc.Int32FromInt32(0) data = (*TMemPage)(unsafe.Pointer(pP1)).FaData rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pP1)).FpDbPage) if rc != 0 { return rc } libc.Xmemcpy(tls, data, uintptr(unsafe.Pointer(&_zMagicHeader)), uint32(16)) - _ = libc.Int32FromInt32(0) *(*uint8)(unsafe.Pointer(data + 16)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FpageSize >> libc.Int32FromInt32(8) & libc.Uint32FromInt32(0xff)) *(*uint8)(unsafe.Pointer(data + 17)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FpageSize >> libc.Int32FromInt32(16) & libc.Uint32FromInt32(0xff)) *(*uint8)(unsafe.Pointer(data + 18)) = uint8(1) *(*uint8)(unsafe.Pointer(data + 19)) = uint8(1) - _ = libc.Int32FromInt32(0) *(*uint8)(unsafe.Pointer(data + 20)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - (*TBtShared)(unsafe.Pointer(pBt)).FusableSize) *(*uint8)(unsafe.Pointer(data + 21)) = uint8(64) *(*uint8)(unsafe.Pointer(data + 22)) = uint8(32) *(*uint8)(unsafe.Pointer(data + 23)) = uint8(32) - libc.Xmemset(tls, data+24, 0, uint32(libc.Int32FromInt32(100)-libc.Int32FromInt32(24))) + libc.Xmemset(tls, data+24, 0, libc.Uint32FromInt32(libc.Int32FromInt32(100)-libc.Int32FromInt32(24))) _zeroPage(tls, pP1, libc.Int32FromInt32(PTF_INTKEY)|libc.Int32FromInt32(PTF_LEAF)|libc.Int32FromInt32(PTF_LEAFDATA)) p1 = pBt + 24 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(BTS_PAGESIZE_FIXED)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3Put4byte(tls, data+uintptr(libc.Int32FromInt32(36)+libc.Int32FromInt32(4)*libc.Int32FromInt32(4)), uint32((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum)) _sqlite3Put4byte(tls, data+uintptr(libc.Int32FromInt32(36)+libc.Int32FromInt32(7)*libc.Int32FromInt32(4)), uint32((*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum)) (*TBtShared)(unsafe.Pointer(pBt)).FnPage = uint32(1) @@ -50753,22 +48498,19 @@ func _btreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uin pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager rc = SQLITE_OK _sqlite3BtreeEnter(tls, p) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the btree is already in a write-transaction, or it ** is already in a read-transaction and a read-transaction ** is requested, this is a no-op. */ - if int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) || int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_READ) && !(wrflag != 0) { + if libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) || libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_READ) && !(wrflag != 0) { goto trans_begun } - _ = libc.Int32FromInt32(0) - if (*Tsqlite3)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).Fdb)).Fflags&uint64(SQLITE_ResetDatabase) != 0 && int32(_sqlite3PagerIsreadonly(tls, pPager)) == 0 { + if (*Tsqlite3)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).Fdb)).Fflags&uint64(SQLITE_ResetDatabase) != 0 && libc.Int32FromUint8(_sqlite3PagerIsreadonly(tls, pPager)) == 0 { p1 = pBt + 24 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_READ_ONLY)) } /* Write transactions are not possible on a read-only database */ - if int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_READ_ONLY) != 0 && wrflag != 0 { + if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_READ_ONLY) != 0 && wrflag != 0 { rc = int32(SQLITE_READONLY) goto trans_begun } @@ -50777,7 +48519,7 @@ func _btreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uin ** on this shared-btree structure and a second write transaction is ** requested, return SQLITE_LOCKED. */ - if wrflag != 0 && int32((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == int32(TRANS_WRITE) || int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_PENDING) != 0 { + if wrflag != 0 && libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == int32(TRANS_WRITE) || libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_PENDING) != 0 { pBlock = (*TBtree)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpWriter)).Fdb } else { if wrflag > int32(1) { @@ -50815,7 +48557,7 @@ func _btreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uin p4 = pBt + 24 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(BTS_INITIALLY_EMPTY)) } - for cond := true; cond; cond = rc&int32(0xFF) == int32(SQLITE_BUSY) && int32((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE && _btreeInvokeBusyHandler(tls, pBt) != 0 { + for cond := true; cond; cond = rc&int32(0xFF) == int32(SQLITE_BUSY) && libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE && _btreeInvokeBusyHandler(tls, pBt) != 0 { /* Call lockBtree() until either pBt->pPage1 is populated or ** lockBtree() returns something other than SQLITE_OK. lockBtree() ** may return SQLITE_OK but leave pBt->pPage1 set to 0 if after @@ -50833,14 +48575,14 @@ func _btreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uin } } if rc == SQLITE_OK && wrflag != 0 { - if int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_READ_ONLY) != 0 { + if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_READ_ONLY) != 0 { rc = int32(SQLITE_READONLY) } else { rc = _sqlite3PagerBegin(tls, pPager, libc.BoolInt32(wrflag > int32(1)), _sqlite3TempInMemory(tls, (*TBtree)(unsafe.Pointer(p)).Fdb)) if rc == SQLITE_OK { rc = _newDatabase(tls, pBt) } else { - if rc == libc.Int32FromInt32(SQLITE_BUSY)|libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) && int32((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE { + if rc == libc.Int32FromInt32(SQLITE_BUSY)|libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) && libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE { /* if there was no transaction opened when this function was ** called and SQLITE_BUSY_SNAPSHOT is returned, change the error ** code to SQLITE_BUSY. */ @@ -50855,10 +48597,9 @@ func _btreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uin } } if rc == SQLITE_OK { - if int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE { + if libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE { (*TBtShared)(unsafe.Pointer(pBt)).FnTransaction++ if (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { - _ = libc.Int32FromInt32(0) (*TBtree)(unsafe.Pointer(p)).Flock.FeLock = uint8(READ_LOCK) (*TBtree)(unsafe.Pointer(p)).Flock.FpNext = (*TBtShared)(unsafe.Pointer(pBt)).FpLock (*TBtShared)(unsafe.Pointer(pBt)).FpLock = p + 32 @@ -50869,13 +48610,12 @@ func _btreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uin } else { v7 = int32(TRANS_READ) } - (*TBtree)(unsafe.Pointer(p)).FinTrans = uint8(v7) - if int32((*TBtree)(unsafe.Pointer(p)).FinTrans) > int32((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) { + (*TBtree)(unsafe.Pointer(p)).FinTrans = libc.Uint8FromInt32(v7) + if libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) > libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) { (*TBtShared)(unsafe.Pointer(pBt)).FinTransaction = (*TBtree)(unsafe.Pointer(p)).FinTrans } if wrflag != 0 { pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 - _ = libc.Int32FromInt32(0) (*TBtShared)(unsafe.Pointer(pBt)).FpWriter = p p8 = pBt + 24 *(*Tu16)(unsafe.Pointer(p8)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p8))) & ^libc.Int32FromInt32(BTS_EXCLUSIVE)) @@ -50902,7 +48642,7 @@ trans_begun: ; if rc == SQLITE_OK { if pSchemaVersion != 0 { - *(*int32)(unsafe.Pointer(pSchemaVersion)) = int32(_sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+40)) + *(*int32)(unsafe.Pointer(pSchemaVersion)) = libc.Int32FromUint32(_sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+40)) } if wrflag != 0 { /* This call makes sure that the pager has the correct number of @@ -50912,8 +48652,6 @@ trans_begun: rc = _sqlite3PagerOpenSavepoint(tls, pPager, (*Tsqlite3)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).Fdb)).FnSavepoint) } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3BtreeLeave(tls, p) return rc } @@ -50921,12 +48659,12 @@ trans_begun: func _sqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) (r int32) { var pBt uintptr _ = pBt - if (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 || int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE || int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_READ) && wrflag != 0 { + if (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 || libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE || libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_READ) && wrflag != 0 { return _btreeBeginTrans(tls, p, wrflag, pSchemaVersion) } pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if pSchemaVersion != 0 { - *(*int32)(unsafe.Pointer(pSchemaVersion)) = int32(_sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+40)) + *(*int32)(unsafe.Pointer(pSchemaVersion)) = libc.Int32FromUint32(_sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+40)) } if wrflag != 0 { /* This call makes sure that the pager has the correct number of @@ -50957,7 +48695,6 @@ func _setChildPtrmaps(tls *libc.TLS, pPage uintptr) (r int32) { _, _, _, _, _, _, _, _ = childPgno, childPgno1, i, nCell, pBt, pCell, pgno, v1 /* Return code */ pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt pgno = (*TMemPage)(unsafe.Pointer(pPage)).Fpgno - _ = libc.Int32FromInt32(0) if (*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0 { v1 = SQLITE_OK } else { @@ -50967,13 +48704,13 @@ func _setChildPtrmaps(tls *libc.TLS, pPage uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp)) } - nCell = int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) + nCell = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) i = 0 for { if !(i < nCell) { break } - pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*i)))))) + pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*i)))))) _ptrmapPutOvflPtr(tls, pPage, pPage, pCell, bp) if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { childPgno = _sqlite3Get4byte(tls, pCell) @@ -50985,7 +48722,7 @@ func _setChildPtrmaps(tls *libc.TLS, pPage uintptr) (r int32) { i++ } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { - childPgno1 = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) + childPgno1 = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) _ptrmapPut(tls, pBt, childPgno1, uint8(PTRMAP_BTREE), pgno, bp) } return *(*int32)(unsafe.Pointer(bp)) @@ -51014,9 +48751,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT var pCell uintptr var _ /* info at bp+0 */ TCellInfo _, _, _, _, _ = i, nCell, pCell, rc, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32(eType) == int32(PTRMAP_OVERFLOW2) { + if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { return _sqlite3CorruptError(tls, int32(74384)) @@ -51032,14 +48767,14 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if rc != 0 { return rc } - nCell = int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) + nCell = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) i = 0 for { if !(i < nCell) { break } - pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*i)))))) - if int32(eType) == int32(PTRMAP_OVERFLOW1) { + pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*i)))))) + if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW1) { (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { @@ -51065,10 +48800,10 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT i++ } if i == nCell { - if int32(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { + if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { return _sqlite3CorruptError(tls, int32(74424)) } - _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) + _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } } return SQLITE_OK @@ -51095,9 +48830,6 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP _, _, _ = iDbPage, nextOvfl, pPager /* The page that contains a pointer to pDbPage */ iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iDbPage < uint32(3) { return _sqlite3CorruptError(tls, int32(74459)) } @@ -51115,7 +48847,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP ** pointer to a subsequent overflow page. If this is the case, then ** the pointer map needs to be updated for the subsequent overflow page. */ - if int32(eType) == int32(PTRMAP_BTREE) || int32(eType) == int32(PTRMAP_ROOTPAGE) { + if libc.Int32FromUint8(eType) == int32(PTRMAP_BTREE) || libc.Int32FromUint8(eType) == int32(PTRMAP_ROOTPAGE) { *(*int32)(unsafe.Pointer(bp + 4)) = _setChildPtrmaps(tls, pDbPage) if *(*int32)(unsafe.Pointer(bp + 4)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 4)) @@ -51133,7 +48865,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP ** that it points at iFreePage. Also fix the pointer map entry for ** iPtrPage. */ - if int32(eType) != int32(PTRMAP_ROOTPAGE) { + if libc.Int32FromUint8(eType) != int32(PTRMAP_ROOTPAGE) { *(*int32)(unsafe.Pointer(bp + 4)) = _btreeGetPage(tls, pBt, iPtrPage, bp, 0) if *(*int32)(unsafe.Pointer(bp + 4)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 4)) @@ -51185,9 +48917,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom var _ /* pFreePg at bp+24 */ uintptr var _ /* pLastPg at bp+20 */ uintptr _, _, _, _, _ = dbSize, eMode, iNear, nFreeList, rc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if !(_ptrmapPageno(tls, pBt, iLastPg) == iLastPg) && iLastPg != uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if !(_ptrmapPageno(tls, pBt, iLastPg) == iLastPg) && iLastPg != libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { nFreeList = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) if nFreeList == uint32(0) { return int32(SQLITE_DONE) @@ -51196,16 +48926,15 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom if rc != SQLITE_OK { return rc } - if int32(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { return _sqlite3CorruptError(tls, int32(74557)) } - if int32(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { rc = _allocateBtreePage(tls, pBt, bp+12, bp+8, iLastPg, uint8(BTALLOC_EXACT)) if rc != SQLITE_OK { return rc } - _ = libc.Int32FromInt32(0) _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) } } else { @@ -51239,7 +48968,6 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return _sqlite3CorruptError(tls, int32(74609)) } } - _ = libc.Int32FromInt32(0) rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 20)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 16)), bCommit) _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 20))) if rc != SQLITE_OK { @@ -51248,7 +48976,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom } } if bCommit == 0 { - for cond := true; cond; cond = iLastPg == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) || _ptrmapPageno(tls, pBt, iLastPg) == iLastPg { + for cond := true; cond; cond = iLastPg == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) || _ptrmapPageno(tls, pBt, iLastPg) == iLastPg { iLastPg-- } (*TBtShared)(unsafe.Pointer(pBt)).FbDoTruncate = uint8(1) @@ -51268,13 +48996,13 @@ func _finalDbSize(tls *libc.TLS, pBt uintptr, nOrig TPgno, nFree TPgno) (r TPgno var nEntry int32 var nFin, nPtrmap TPgno _, _, _ = nEntry, nFin, nPtrmap /* Return value */ - nEntry = int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize / uint32(5)) - nPtrmap = (nFree - nOrig + _ptrmapPageno(tls, pBt, nOrig) + uint32(nEntry)) / uint32(nEntry) + nEntry = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize / uint32(5)) + nPtrmap = (nFree - nOrig + _ptrmapPageno(tls, pBt, nOrig) + libc.Uint32FromInt32(nEntry)) / libc.Uint32FromInt32(nEntry) nFin = nOrig - nFree - nPtrmap - if nOrig > uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) && nFin < uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if nOrig > libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) && nFin < libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { nFin-- } - for _ptrmapPageno(tls, pBt, nFin) == nFin || nFin == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + for _ptrmapPageno(tls, pBt, nFin) == nFin || nFin == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { nFin-- } return nFin @@ -51297,7 +49025,6 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { _, _, _, _, _ = nFin, nFree, nOrig, pBt, rc pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) - _ = libc.Int32FromInt32(0) if !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { rc = int32(SQLITE_DONE) } else { @@ -51338,15 +49065,12 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { var iFree, nFin, nFree, nOrig, nVac TPgno _, _, _, _, _, _, _, _, _, _ = db, iDb, iFree, nFin, nFree, nOrig, nVac, pBt, pPager, rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager - _ = libc.Int32FromInt32(0) _invalidateAllOverflowCache(tls, pBt) - _ = libc.Int32FromInt32(0) if !((*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum != 0) { /* Database size before freeing */ nOrig = _btreePagecount(tls, pBt) - if _ptrmapPageno(tls, pBt, nOrig) == nOrig || nOrig == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if _ptrmapPageno(tls, pBt, nOrig) == nOrig || nOrig == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { /* It is not possible to create a database for which the final page ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. @@ -51411,7 +49135,6 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { _sqlite3PagerRollback(tls, pPager) } } - _ = libc.Int32FromInt32(0) return rc } @@ -51448,7 +49171,7 @@ func _sqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) ( var rc int32 _, _ = pBt, rc rc = SQLITE_OK - if int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) { + if libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) { pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { @@ -51478,9 +49201,8 @@ func _btreeEndTransaction(tls *libc.TLS, p uintptr) { _, _ = db, pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt db = (*TBtree)(unsafe.Pointer(p)).Fdb - _ = libc.Int32FromInt32(0) (*TBtShared)(unsafe.Pointer(pBt)).FbDoTruncate = uint8(0) - if int32((*TBtree)(unsafe.Pointer(p)).FinTrans) > TRANS_NONE && (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { + if libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) > TRANS_NONE && (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { /* If there are other active statements that belong to this database ** handle, downgrade to a read-only transaction. The other statements ** may still be reading from the database. */ @@ -51491,7 +49213,7 @@ func _btreeEndTransaction(tls *libc.TLS, p uintptr) { ** transaction count of the shared btree. If the transaction count ** reaches 0, set the shared state to TRANS_NONE. The unlockBtreeIfUnused() ** call below will unlock the pager. */ - if int32((*TBtree)(unsafe.Pointer(p)).FinTrans) != TRANS_NONE { + if libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) != TRANS_NONE { _clearAllSharedCacheTableLocks(tls, p) (*TBtShared)(unsafe.Pointer(pBt)).FnTransaction-- if 0 == (*TBtShared)(unsafe.Pointer(pBt)).FnTransaction { @@ -51503,8 +49225,6 @@ func _btreeEndTransaction(tls *libc.TLS, p uintptr) { (*TBtree)(unsafe.Pointer(p)).FinTrans = uint8(TRANS_NONE) _unlockBtreeIfUnused(tls, pBt) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } // C documentation @@ -51539,19 +49259,15 @@ func _sqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) (r in var pBt uintptr var rc int32 _, _ = pBt, rc - if int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE { + if libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE { return SQLITE_OK } _sqlite3BtreeEnter(tls, p) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the handle has a write-transaction open, commit the shared-btrees ** transaction and set the shared state to TRANS_READ. */ - if int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) { + if libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) { pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3PagerCommitPhaseTwo(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager) if rc != SQLITE_OK && bCleanup == 0 { _sqlite3BtreeLeave(tls, p) @@ -51616,7 +49332,6 @@ func _sqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, w var rc int32 _, _ = p, rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if pBtree != 0 { _sqlite3BtreeEnter(tls, pBtree) p = (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(pBtree)).FpBt)).FpCursor @@ -51624,8 +49339,8 @@ func _sqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, w if !(p != 0) { break } - if writeOnly != 0 && int32((*TBtCursor)(unsafe.Pointer(p)).FcurFlags)&int32(BTCF_WriteFlag) == 0 { - if int32((*TBtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID || int32((*TBtCursor)(unsafe.Pointer(p)).FeState) == int32(CURSOR_SKIPNEXT) { + if writeOnly != 0 && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(p)).FcurFlags)&int32(BTCF_WriteFlag) == 0 { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID || libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(p)).FeState) == int32(CURSOR_SKIPNEXT) { rc = _saveCursorPosition(tls, p) if rc != SQLITE_OK { _sqlite3BtreeTripAllCursors(tls, pBtree, rc, 0) @@ -51658,11 +49373,11 @@ func _btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* nPage at bp+0 */ int32 - *(*int32)(unsafe.Pointer(bp)) = int32(_sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+28)) + *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint32(_sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+28)) if *(*int32)(unsafe.Pointer(bp)) == 0 { _sqlite3PagerPagecount(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, bp) } - (*TBtShared)(unsafe.Pointer(pBt)).FnPage = uint32(*(*int32)(unsafe.Pointer(bp))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPage = libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) } // C documentation @@ -51686,8 +49401,6 @@ func _sqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i var _ /* pPage1 at bp+0 */ uintptr _, _, _, _, _ = pBt, rc, rc2, rc21, v1 pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) if tripCode == SQLITE_OK { v1 = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -51701,15 +49414,11 @@ func _sqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i } if tripCode != 0 { rc2 = _sqlite3BtreeTripAllCursors(tls, p, tripCode, writeOnly) - _ = libc.Int32FromInt32(0) if rc2 != SQLITE_OK { rc = rc2 } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) { rc21 = _sqlite3PagerRollback(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager) if rc21 != SQLITE_OK { rc = rc21 @@ -51721,7 +49430,6 @@ func _sqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i _btreeSetNPage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp))) _releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp))) } - _ = libc.Int32FromInt32(0) (*TBtShared)(unsafe.Pointer(pBt)).FinTransaction = uint8(TRANS_READ) _btreeClearHasContent(tls, pBt) } @@ -51756,11 +49464,6 @@ func _sqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) (r int32 _, _ = pBt, rc pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* At the pager level, a statement transaction is a savepoint with ** an index greater than all savepoints created explicitly using ** SQL statements. It is illegal to open, release or rollback any @@ -51790,10 +49493,8 @@ func _sqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32 var rc int32 _, _ = pBt, rc rc = SQLITE_OK - if p != 0 && int32((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) { + if p != 0 && libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) == int32(TRANS_WRITE) { pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) if op == int32(SAVEPOINT_ROLLBACK) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -51802,14 +49503,13 @@ func _sqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32 rc = _sqlite3PagerSavepoint(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, op, iSavepoint) } if rc == SQLITE_OK { - if iSavepoint < 0 && int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_INITIALLY_EMPTY) != 0 { + if iSavepoint < 0 && libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_INITIALLY_EMPTY) != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FnPage = uint32(0) } rc = _newDatabase(tls, pBt) _btreeSetNPage(tls, pBt, (*TBtShared)(unsafe.Pointer(pBt)).FpPage1) /* pBt->nPage might be zero if the database was corrupt when ** the transaction was started. Otherwise, it must be at least 1. */ - _ = libc.Int32FromInt32(0) } _sqlite3BtreeLeave(tls, p) } @@ -51864,25 +49564,16 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo var pBt, pX, p2, p3 uintptr _, _, _, _ = pBt, pX, p2, p3 pBt = (*TBtree)(unsafe.Pointer(p)).FpBt /* Looping over other all cursors */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The following assert statements verify that if this is a sharable ** b-tree database, the connection is holding the required table locks, ** and that no other connection has any open cursor that conflicts with ** this lock. The iTable<1 term disables the check for corrupt schemas. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Assert that the caller has opened the required transaction. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iTable <= uint32(1) { if iTable < uint32(1) { return _sqlite3CorruptError(tls, int32(75219)) } else { if _btreePagecount(tls, pBt) == uint32(0) { - _ = libc.Int32FromInt32(0) iTable = uint32(0) } } @@ -51957,7 +49648,7 @@ func _sqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, p // ** this routine. // */ func _sqlite3BtreeCursorSize(tls *libc.TLS) (r int32) { - return int32((libc.Uint32FromInt64(188) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + return libc.Int32FromUint32((libc.Uint32FromInt64(188) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) } // C documentation @@ -51987,7 +49678,6 @@ func _sqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) (r int32) { if pBtree != 0 { pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt _sqlite3BtreeEnter(tls, pBtree) - _ = libc.Int32FromInt32(0) if (*TBtShared)(unsafe.Pointer(pBt)).FpCursor == pCur { (*TBtShared)(unsafe.Pointer(pBt)).FpCursor = (*TBtCursor)(unsafe.Pointer(pCur)).FpNext } else { @@ -52004,10 +49694,9 @@ func _sqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) (r int32) { _unlockBtreeIfUnused(tls, pBt) Xsqlite3_free(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow) Xsqlite3_free(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpKey) - if int32((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) != 0 && (*TBtShared)(unsafe.Pointer(pBt)).FpCursor == uintptr(0) { + if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) != 0 && (*TBtShared)(unsafe.Pointer(pBt)).FpCursor == uintptr(0) { /* Since the BtShared is not sharable, there is no need to ** worry about the missing sqlite3BtreeLeave() call here. */ - _ = libc.Int32FromInt32(0) _sqlite3BtreeClose(tls, pBtree) } else { _sqlite3BtreeLeave(tls, pBtree) @@ -52030,17 +49719,16 @@ func _sqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) (r int32) { func _getCellInfo(tls *libc.TLS, pCur uintptr) { var p1 uintptr _ = p1 - if int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) == 0 { + if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) == 0 { p1 = pCur + 1 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(BTCF_ValidNKey)) - _btreeParseCell(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage, int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix), pCur+28) + _btreeParseCell(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage, libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix), pCur+28) } else { } } func _sqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - return libc.BoolInt32(int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID) + return libc.BoolInt32(libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID) } // C documentation @@ -52052,9 +49740,6 @@ func _sqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) (r int32) { // ** is invalid, the result of this routine is undefined. // */ func _sqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) (r Ti64) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _getCellInfo(tls, pCur) return (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey } @@ -52067,7 +49752,6 @@ func _sqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) (r Ti64) { func _sqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) { var p1 uintptr _ = p1 - _ = libc.Int32FromInt32(0) p1 = pCur + 1 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(BTCF_Pinned)) } @@ -52075,7 +49759,6 @@ func _sqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) { func _sqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { var p1 uintptr _ = p1 - _ = libc.Int32FromInt32(0) p1 = pCur + 1 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTCF_Pinned)) } @@ -52087,10 +49770,8 @@ func _sqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { // ** payload to which the cursor is pointing. // */ func _sqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) (r Ti64) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _getCellInfo(tls, pCur) - return int64((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize)*(int64((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno)-int64(1)) + int64(int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)-int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData)) + return libc.Int64FromUint32((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize)*(libc.Int64FromUint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno)-int64(1)) + int64(int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)-int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData)) } // C documentation @@ -52105,8 +49786,6 @@ func _sqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) (r Ti64) { // ** that the cursor has Cursor.eState==CURSOR_VALID. // */ func _sqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) (r Tu32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _getCellInfo(tls, pCur) return (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload } @@ -52127,9 +49806,7 @@ func _sqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) (r Tu32) { // ** database file. // */ func _sqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) (r Tsqlite3_int64) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - return int64((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * int64((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage) + return libc.Int64FromUint32((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * libc.Int64FromUint32((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage) } // C documentation @@ -52165,8 +49842,6 @@ func _getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl TPgno, ppPage uintptr, pP next = uint32(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Try to find the next page in the overflow list using the ** autovacuum pointer-map pages. Guess that the next page in ** the overflow list is page number (ovfl+1). If that guess turns @@ -52175,18 +49850,17 @@ func _getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl TPgno, ppPage uintptr, pP */ if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { iGuess = ovfl + uint32(1) - for _ptrmapPageno(tls, pBt, iGuess) == iGuess || iGuess == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + for _ptrmapPageno(tls, pBt, iGuess) == iGuess || iGuess == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { iGuess++ } if iGuess <= _btreePagecount(tls, pBt) { rc = _ptrmapGet(tls, pBt, iGuess, bp+8, bp+4) - if rc == SQLITE_OK && int32(*(*Tu8)(unsafe.Pointer(bp + 8))) == int32(PTRMAP_OVERFLOW2) && *(*TPgno)(unsafe.Pointer(bp + 4)) == ovfl { + if rc == SQLITE_OK && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 8))) == int32(PTRMAP_OVERFLOW2) && *(*TPgno)(unsafe.Pointer(bp + 4)) == ovfl { next = iGuess rc = int32(SQLITE_DONE) } } } - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK { if ppPage == uintptr(0) { v1 = int32(PAGER_GET_READONLY) @@ -52194,7 +49868,6 @@ func _getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl TPgno, ppPage uintptr, pP v1 = 0 } rc = _btreeGetPage(tls, pBt, ovfl, bp, v1) - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK { next = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) } @@ -52235,10 +49908,10 @@ func _copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eO if rc != SQLITE_OK { return rc } - libc.Xmemcpy(tls, pPayload, pBuf, uint32(nByte)) + libc.Xmemcpy(tls, pPayload, pBuf, libc.Uint32FromInt32(nByte)) } else { /* Copy data from page to buffer (a read operation) */ - libc.Xmemcpy(tls, pBuf, pPayload, uint32(nByte)) + libc.Xmemcpy(tls, pBuf, pPayload, libc.Uint32FromInt32(nByte)) } return SQLITE_OK } @@ -52289,18 +49962,12 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Btree page of current entry */ pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { return _sqlite3CorruptError(tls, int32(75624)) } - _ = libc.Int32FromInt32(0) _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if uint32(int32(aPayload)-int32((*TMemPage)(unsafe.Pointer(pPage)).FaData)) > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { + if libc.Uint32FromInt32(int32(aPayload)-int32((*TMemPage)(unsafe.Pointer(pPage)).FaData)) > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { /* Trying to read or write past the end of the data is an error. The ** conditional above is really: ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] @@ -52310,14 +49977,14 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { - a = int32(amt) - if uint32(a)+offset > uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { - a = int32(uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) - offset) + a = libc.Int32FromUint32(amt) + if libc.Uint32FromInt32(a)+offset > uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { + a = libc.Int32FromUint32(uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) - offset) } rc = _copyPayload(tls, aPayload+uintptr(offset), pBuf, a, eOp, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) offset = uint32(0) pBuf += uintptr(a) - amt -= uint32(a) + amt -= libc.Uint32FromInt32(a) } else { offset -= uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) } @@ -52331,13 +49998,13 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** stored in aOverflow[0], etc. A value of 0 in the aOverflow[] array ** means "not yet known" (the cache is lazily populated). */ - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_ValidOvfl) == 0 { - nOvfl = int32(((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload - uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) + ovflSize - uint32(1)) / ovflSize) + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_ValidOvfl) == 0 { + nOvfl = libc.Int32FromUint32(((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload - uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) + ovflSize - uint32(1)) / ovflSize) if (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow == uintptr(0) || nOvfl*libc.Int32FromInt64(4) > _sqlite3MallocSize(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow) { if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(uint32(nOvfl*int32(2))*uint32(4))) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint32FromInt32(nOvfl*int32(2))*uint32(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -52345,30 +50012,26 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow = aNew } } - libc.Xmemset(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, 0, uint32(nOvfl)*uint32(4)) + libc.Xmemset(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, 0, libc.Uint32FromInt32(nOvfl)*uint32(4)) p1 = pCur + 1 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(BTCF_ValidOvfl)) } else { /* Sanity check the validity of the overflow page cache */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the overflow page-list cache has been allocated and the ** entry for the first required overflow page is valid, skip ** directly to it. */ if *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(offset/ovflSize)*4)) != 0 { - iIdx = int32(offset / ovflSize) + iIdx = libc.Int32FromUint32(offset / ovflSize) *(*TPgno)(unsafe.Pointer(bp)) = *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) offset = offset % ovflSize } } - _ = libc.Int32FromInt32(0) for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { return _sqlite3CorruptError(tls, int32(75710)) } - _ = libc.Int32FromInt32(0) *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { /* The only reason to read this page is to obtain the page @@ -52377,8 +50040,6 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** page-list cache, if any, then fall back to the getOverflowPage() ** function. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx+int32(1))*4)) != 0 { *(*TPgno)(unsafe.Pointer(bp)) = *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx+int32(1))*4)) } else { @@ -52389,9 +50050,9 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin /* Need to read this page properly. It contains some of the ** range of data that is being read (eOp==0) or written (eOp!=0). */ - a1 = int32(amt) - if uint32(a1)+offset > ovflSize { - a1 = int32(ovflSize - offset) + a1 = libc.Int32FromUint32(amt) + if libc.Uint32FromInt32(a1)+offset > ovflSize { + a1 = libc.Int32FromUint32(ovflSize - offset) } /* If all the following are true: ** @@ -52409,9 +50070,9 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if eOp == 0 && offset == uint32(0) && _sqlite3PagerDirectReadOk(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, *(*TPgno)(unsafe.Pointer(bp))) != 0 && pBuf+uintptr(-libc.Int32FromInt32(4)) >= pBufStart { fd = _sqlite3PagerFile(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager) aWrite = pBuf + uintptr(-libc.Int32FromInt32(4)) - _ = libc.Int32FromInt32(0) /* due to (6) */ + /* due to (6) */ libc.Xmemcpy(tls, bp+4, aWrite, uint32(4)) - rc = _sqlite3OsRead(tls, fd, aWrite, a1+int32(4), int64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)*int64(*(*TPgno)(unsafe.Pointer(bp))-libc.Uint32FromInt32(1))) + rc = _sqlite3OsRead(tls, fd, aWrite, a1+int32(4), libc.Int64FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)*libc.Int64FromUint32(*(*TPgno)(unsafe.Pointer(bp))-libc.Uint32FromInt32(1))) *(*TPgno)(unsafe.Pointer(bp)) = _sqlite3Get4byte(tls, aWrite) libc.Xmemcpy(tls, aWrite, bp+4, uint32(4)) } else { @@ -52429,7 +50090,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin offset = uint32(0) } } - amt -= uint32(a1) + amt -= libc.Uint32FromInt32(a1) if amt == uint32(0) { return rc } @@ -52468,9 +50129,6 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin // ** the available payload. // */ func _sqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return _accessPayload(tls, pCur, offset, amt, pBuf, 0) } @@ -52484,10 +50142,9 @@ func _sqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pB func _accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uintptr) (r int32) { var rc, v1 int32 _, _ = rc, v1 - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_INVALID) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_INVALID) { return int32(SQLITE_ABORT) } - _ = libc.Int32FromInt32(0) rc = _btreeRestoreCursorPosition(tls, pCur) if rc != 0 { v1 = rc @@ -52498,8 +50155,7 @@ func _accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, p } func _sqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uintptr) (r int32) { - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID { return _accessPayload(tls, pCur, offset, amt, pBuf, 0) } else { return _accessPayloadChecked(tls, pCur, offset, amt, pBuf) @@ -52531,19 +50187,10 @@ func _sqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset Tu32, amt T func _fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) (r uintptr) { var amt, v1 int32 _, _ = amt, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - amt = int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) + amt = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) if amt > int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd)-int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload) { /* There is too little space on the page for the expected amount ** of local content. Database must be corrupt. */ - _ = libc.Int32FromInt32(0) if 0 > int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd)-int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload) { v1 = 0 } else { @@ -52551,7 +50198,7 @@ func _fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) (r uintptr) { } amt = v1 } - *(*Tu32)(unsafe.Pointer(pAmt)) = uint32(amt) + *(*Tu32)(unsafe.Pointer(pAmt)) = libc.Uint32FromInt32(amt) return (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload } @@ -52591,10 +50238,6 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v2 Ti8 var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { return _sqlite3CorruptError(tls, int32(75932)) } @@ -52605,9 +50248,8 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { *(*uintptr)(unsafe.Pointer(pCur + 112 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*4)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(0) (*TBtCursor)(unsafe.Pointer(pCur)).FiPage++ - rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+108, int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) - _ = libc.Int32FromInt32(0) - if rc == SQLITE_OK && (int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { + rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+108, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) + if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) rc = _sqlite3CorruptError(tls, int32(75946)) } @@ -52634,10 +50276,6 @@ func _moveToParent(tls *libc.TLS, pCur uintptr) { var pLeaf, v3, p1 uintptr var v2 Ti8 _, _, _, _ = pLeaf, v2, v3, p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) @@ -52680,12 +50318,6 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { var v1 Ti8 _, _, _, _, _, _, _ = pRoot, rc, subpage, v1, v2, v3, p4 rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= 0 { if (*TBtCursor)(unsafe.Pointer(pCur)).FiPage != 0 { _releasePageNotNull(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) @@ -52708,15 +50340,13 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_INVALID) return int32(SQLITE_EMPTY) } else { - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_FAULT) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_FAULT) { return (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext } _sqlite3BtreeClearCursor(tls, pCur) } - rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, (*TBtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur+108, int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) + rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, (*TBtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur+108, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc != SQLITE_OK { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_INVALID) return rc @@ -52726,7 +50356,6 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { } } pRoot = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage - _ = libc.Int32FromInt32(0) /* If pCur->pKeyInfo is not NULL, then the caller that opened this cursor ** expected to open it on an index b-tree. Otherwise, if pKeyInfo is ** NULL, the caller expects a table b-tree. If this is not the case, @@ -52737,8 +50366,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** if pCur->iPage>=0). But this is not so if the database is corrupted ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ - _ = libc.Int32FromInt32(0) - if int32((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != int32((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { + if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { return _sqlite3CorruptError(tls, int32(76081)) } goto skip_init @@ -52748,14 +50376,14 @@ skip_init: (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p4 = pCur + 1 *(*Tu8)(unsafe.Pointer(p4)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p4))) & ^(libc.Int32FromInt32(BTCF_AtLast) | libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) - if int32((*TMemPage)(unsafe.Pointer(pRoot)).FnCell) > 0 { + if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pRoot)).FnCell) > 0 { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { return _sqlite3CorruptError(tls, int32(76093)) } - subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) + subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) rc = _moveToChild(tls, pCur, subpage) } else { @@ -52782,8 +50410,6 @@ func _moveToLeftmost(tls *libc.TLS, pCur uintptr) (r int32) { var v2 bool _, _, _, _, _ = pPage, pgno, rc, v1, v2 rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for { if v2 = rc == SQLITE_OK; v2 { v1 = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -52792,8 +50418,7 @@ func _moveToLeftmost(tls *libc.TLS, pCur uintptr) (r int32) { if !(v2 && !((*TMemPage)(unsafe.Pointer(v1)).Fleaf != 0)) { break } - _ = libc.Int32FromInt32(0) - pgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix)))))))) + pgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix)))))))) rc = _moveToChild(tls, pCur, pgno) } return rc @@ -52818,24 +50443,20 @@ func _moveToRightmost(tls *libc.TLS, pCur uintptr) (r int32) { _, _, _, _ = pPage, pgno, rc, v1 rc = SQLITE_OK pPage = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for { v1 = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage pPage = v1 if !!((*TMemPage)(unsafe.Pointer(v1)).Fleaf != 0) { break } - pgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) + pgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).Fix = (*TMemPage)(unsafe.Pointer(pPage)).FnCell rc = _moveToChild(tls, pCur, pgno) if rc != 0 { return rc } } - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - int32(1)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - int32(1)) return SQLITE_OK } @@ -52848,16 +50469,12 @@ func _moveToRightmost(tls *libc.TLS, pCur uintptr) (r int32) { func _sqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) (r int32) { var rc int32 _ = rc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _moveToRoot(tls, pCur) if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pRes)) = 0 rc = _moveToLeftmost(tls, pCur) } else { if rc == int32(SQLITE_EMPTY) { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pRes)) = int32(1) rc = SQLITE_OK } @@ -52877,7 +50494,6 @@ func _btreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) (r int32) { _, _, _ = rc, p1, p2 rc = _moveToRoot(tls, pCur) if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pRes)) = 0 rc = _moveToRightmost(tls, pCur) if rc == SQLITE_OK { @@ -52889,7 +50505,6 @@ func _btreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) (r int32) { } } else { if rc == int32(SQLITE_EMPTY) { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pRes)) = int32(1) rc = SQLITE_OK } @@ -52898,11 +50513,8 @@ func _btreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) (r int32) { } func _sqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the cursor already points to the last entry, this is a no-op. */ - if CURSOR_VALID == int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) && int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_AtLast) != 0 { - _ = libc.Int32FromInt32(0) + if CURSOR_VALID == libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_AtLast) != 0 { *(*int32)(unsafe.Pointer(pRes)) = 0 return SQLITE_OK } @@ -52942,21 +50554,15 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh var pCell, pPage, v3, p4 uintptr var _ /* nCellKey at bp+0 */ Ti64 _, _, _, _, _, _, _, _, _, _ = c, chldPg, idx, lwr, pCell, pPage, rc, upr, v3, p4 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the cursor is already positioned at the point we are trying ** to move to, then just return without doing any work */ - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID && int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_ValidNKey) != 0 { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_ValidNKey) != 0 { if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey == intKey { *(*int32)(unsafe.Pointer(pRes)) = 0 return SQLITE_OK } if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey < intKey { - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_AtLast) != 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_AtLast) != 0 { *(*int32)(unsafe.Pointer(pRes)) = -int32(1) return SQLITE_OK } @@ -52983,18 +50589,11 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh rc = _moveToRoot(tls, pCur) if rc != 0 { if rc == int32(SQLITE_EMPTY) { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pRes)) = -int32(1) return SQLITE_OK } return rc } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for { pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Pointer to current cell in pPage */ /* pPage->nCell must be greater than zero. If this is the root-page @@ -53003,19 +50602,16 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh ** would have already detected db corruption. Similarly, pPage must ** be the right kind (index or table) of b-tree page. Otherwise ** a moveToChild() or moveToRoot() call would have detected corruption. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) lwr = 0 - upr = int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - int32(1) - _ = libc.Int32FromInt32(0) + upr = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - int32(1) idx = upr >> (int32(1) - biasRight) /* idx = biasRight ? upr : (lwr+upr)/2; */ for { - pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))) + pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf != 0 { for { v3 = pCell pCell++ - if !(int32(0x80) <= int32(*(*Tu8)(unsafe.Pointer(v3)))) { + if !(int32(0x80) <= libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v3)))) { break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { @@ -53038,8 +50634,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } } else { - _ = libc.Int32FromInt32(0) - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { lwr = idx goto moveto_table_next_layer @@ -53053,16 +50648,12 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh } } } - _ = libc.Int32FromInt32(0) idx = (lwr + upr) >> int32(1) /* idx = (lwr+upr)/2; */ goto _2 _2: } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0 { - _ = libc.Int32FromInt32(0) - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) *(*int32)(unsafe.Pointer(pRes)) = c rc = SQLITE_OK goto moveto_table_finish @@ -53070,12 +50661,12 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto moveto_table_next_layer moveto_table_next_layer: ; - if lwr >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - chldPg = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) + if lwr >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + chldPg = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) } else { - chldPg = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*lwr))))))) + chldPg = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*lwr))))))) } - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(lwr) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(lwr) rc = _moveToChild(tls, pCur, chldPg) if rc != 0 { break @@ -53087,7 +50678,6 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) - _ = libc.Int32FromInt32(0) return rc } @@ -53115,19 +50705,19 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, var v2 bool _, _, _, _, _, _ = c, nCell, pCell, pPage, v1, v2 pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Size of the pCell cell in bytes */ - pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))) - nCell = int32(*(*Tu8)(unsafe.Pointer(pCell))) - if nCell <= int32((*TMemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload) { + pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))) + nCell = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell))) + if nCell <= libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload) { /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { - if v2 = !(int32(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { - v1 = nCell&libc.Int32FromInt32(0x7f)<<libc.Int32FromInt32(7) + int32(*(*Tu8)(unsafe.Pointer(pCell + 1))) + if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { + v1 = nCell&libc.Int32FromInt32(0x7f)<<libc.Int32FromInt32(7) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1))) nCell = v1 } - if v2 && v1 <= int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { + if v2 && v1 <= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { /* The record-size field is a 2 byte varint and the record ** fits entirely on the main b-tree page. */ c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+2, pIdxKey) @@ -53150,14 +50740,13 @@ func _cursorOnLastPage(tls *libc.TLS, pCur uintptr) (r int32) { var i int32 var pPage uintptr _, _ = i, pPage - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)) { break } pPage = *(*uintptr)(unsafe.Pointer(pCur + 112 + uintptr(i)*4)) - if int32(*(*Tu16)(unsafe.Pointer(pCur + 64 + uintptr(i)*2))) < int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + if libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 64 + uintptr(i)*2))) < libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { return 0 } goto _1 @@ -53204,13 +50793,8 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes var v10 Ti8 var v2, v7 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, c1, chldPg, idx, lwr, nCell, nOverrun, pCell, pCellBody, pCellKey, pPage, rc, upr, xRecordCompare, v1, v10, v11, v2, v6, v7, p3, p8, p9 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) xRecordCompare = _sqlite3VdbeFindCompare(tls, pIdxKey) (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode = uint8(0) - _ = libc.Int32FromInt32(0) /* Check to see if we can skip a lot of work. Two cases: ** ** (1) If the cursor is already pointing to the very last cell @@ -53222,16 +50806,16 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes ** search key, then we can start the search on the current page ** without needing to go back to root. */ - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID && (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf != 0 && _cursorOnLastPage(tls, pCur) != 0 { - if v2 = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) == int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell)-int32(1); v2 { - v1 = _indexCellCompare(tls, pCur, int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix), pIdxKey, xRecordCompare) + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID && (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf != 0 && _cursorOnLastPage(tls, pCur) != 0 { + if v2 = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) == libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell)-int32(1); v2 { + v1 = _indexCellCompare(tls, pCur, libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix), pIdxKey, xRecordCompare) c = v1 } - if v2 && v1 <= 0 && int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode) == SQLITE_OK { + if v2 && v1 <= 0 && libc.Int32FromUint8((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode) == SQLITE_OK { *(*int32)(unsafe.Pointer(pRes)) = c return SQLITE_OK /* Cursor already pointing at the correct spot */ } - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) > 0 && _indexCellCompare(tls, pCur, 0, pIdxKey, xRecordCompare) <= 0 && int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode) == SQLITE_OK { + if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) > 0 && _indexCellCompare(tls, pCur, 0, pIdxKey, xRecordCompare) <= 0 && libc.Int32FromUint8((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode) == SQLITE_OK { p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^libc.Int32FromInt32(BTCF_ValidOvfl)) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { @@ -53244,7 +50828,6 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes rc = _moveToRoot(tls, pCur) if rc != 0 { if rc == int32(SQLITE_EMPTY) { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pRes)) = -int32(1) return SQLITE_OK } @@ -53253,12 +50836,6 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes goto bypass_moveto_root bypass_moveto_root: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for { pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Pointer to current cell in pPage */ /* pPage->nCell must be greater than zero. If this is the root-page @@ -53267,13 +50844,11 @@ bypass_moveto_root: ** would have already detected db corruption. Similarly, pPage must ** be the right kind (index or table) of b-tree page. Otherwise ** a moveToChild() or moveToRoot() call would have detected corruption. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) lwr = 0 - upr = int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - int32(1) + upr = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - int32(1) idx = upr >> int32(1) /* idx = (lwr+upr)/2; */ for { /* Size of the pCell cell in bytes */ - pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))) + pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))) /* The maximum supported page-size is 65536 bytes. This means that ** the maximum number of record bytes stored on an index B-Tree ** page is less than 16384 bytes and may be stored as a 2-byte @@ -53282,18 +50857,18 @@ bypass_moveto_root: ** stored entirely within the b-tree page by inspecting the first ** 2 bytes of the cell. */ - nCell = int32(*(*Tu8)(unsafe.Pointer(pCell))) - if nCell <= int32((*TMemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload) { + nCell = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell))) + if nCell <= libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload) { /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ c1 = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { - if v7 = !(int32(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v7 { - v6 = nCell&libc.Int32FromInt32(0x7f)<<libc.Int32FromInt32(7) + int32(*(*Tu8)(unsafe.Pointer(pCell + 1))) + if v7 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v7 { + v6 = nCell&libc.Int32FromInt32(0x7f)<<libc.Int32FromInt32(7) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1))) nCell = v6 } - if v7 && v6 <= int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { + if v7 && v6 <= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { /* The record-size field is a 2 byte varint and the record ** fits entirely on the main b-tree page. */ c1 = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+2, pIdxKey) @@ -53306,18 +50881,18 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x00 */ /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ - if nCell < int32(2) || uint32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { + if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { rc = _sqlite3CorruptError(tls, int32(76625)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, uint64(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish } - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) - rc = _accessPayload(tls, pCur, uint32(0), uint32(nCell), pCellKey, 0) - libc.Xmemset(tls, pCellKey+uintptr(nCell), 0, uint32(nOverrun)) /* Fix uninit warnings */ + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) + rc = _accessPayload(tls, pCur, uint32(0), libc.Uint32FromInt32(nCell), pCellKey, 0) + libc.Xmemset(tls, pCellKey+uintptr(nCell), 0, libc.Uint32FromInt32(nOverrun)) /* Fix uninit warnings */ p8 = pCur + 1 *(*Tu8)(unsafe.Pointer(p8)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p8))) & ^libc.Int32FromInt32(BTCF_ValidOvfl)) if rc != 0 { @@ -53328,17 +50903,15 @@ bypass_moveto_root: Xsqlite3_free(tls, pCellKey) } } - _ = libc.Int32FromInt32(0) if c1 < 0 { lwr = idx + int32(1) } else { if c1 > 0 { upr = idx - int32(1) } else { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pRes)) = 0 rc = SQLITE_OK - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { rc = _sqlite3CorruptError(tls, int32(76657)) } @@ -53348,24 +50921,20 @@ bypass_moveto_root: if lwr > upr { break } - _ = libc.Int32FromInt32(0) idx = (lwr + upr) >> int32(1) /* idx = (lwr+upr)/2 */ goto _5 _5: } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0 { - _ = libc.Int32FromInt32(0) - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) *(*int32)(unsafe.Pointer(pRes)) = c1 rc = SQLITE_OK goto moveto_index_finish } - if lwr >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - chldPg = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) + if lwr >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + chldPg = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) } else { - chldPg = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*lwr))))))) + chldPg = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*lwr))))))) } /* This block is similar to an in-lined version of: ** @@ -53379,12 +50948,12 @@ bypass_moveto_root: if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { return _sqlite3CorruptError(tls, int32(76688)) } - *(*Tu16)(unsafe.Pointer(pCur + 64 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = uint16(lwr) + *(*Tu16)(unsafe.Pointer(pCur + 64 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 112 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*4)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(0) (*TBtCursor)(unsafe.Pointer(pCur)).FiPage++ - rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+108, int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) - if rc == SQLITE_OK && (int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { + rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+108, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) + if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) rc = _sqlite3CorruptError(tls, int32(76699)) } @@ -53404,7 +50973,6 @@ bypass_moveto_root: moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) - _ = libc.Int32FromInt32(0) return rc } @@ -53422,7 +50990,7 @@ func _sqlite3BtreeEof(tls *libc.TLS, pCur uintptr) (r int32) { ** have been deleted? This API will need to change to return an error code ** as well as the boolean result value. */ - return libc.BoolInt32(CURSOR_VALID != int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState)) + return libc.BoolInt32(CURSOR_VALID != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState)) } // C documentation @@ -53436,24 +51004,22 @@ func _sqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) (r Ti64) { var i Tu8 var n Ti64 _, _ = i, n - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Currently this interface is only called by the OP_IfSizeBetween ** opcode and the OP_Count opcode with P3=1. In either case, ** the cursor will always be valid unless the btree is empty. */ - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { return 0 } - if int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf) == 0 { + if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf) == 0 { return int64(-int32(1)) } - n = int64((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) + n = libc.Int64FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) i = uint8(0) for { - if !(int32(i) < int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)) { + if !(libc.Int32FromUint8(i) < int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)) { break } - n *= int64((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur + 112 + uintptr(i)*4)))).FnCell) + n *= libc.Int64FromUint16((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur + 112 + uintptr(i)*4)))).FnCell) goto _1 _1: ; @@ -53489,10 +51055,8 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { var pPage, v3 uintptr var v2 Tu16 _, _, _, _, _, _ = idx, pPage, rc, v1, v2, v3 - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { v1 = _btreeRestoreCursorPosition(tls, pCur) } else { v1 = SQLITE_OK @@ -53501,10 +51065,10 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { if rc != SQLITE_OK { return rc } - if int32(CURSOR_INVALID) == int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) { + if int32(CURSOR_INVALID) == libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) { return int32(SQLITE_DONE) } - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_SKIPNEXT) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) == int32(CURSOR_SKIPNEXT) { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) if (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext > 0 { return SQLITE_OK @@ -53515,22 +51079,22 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { v3 = pCur + 62 *(*Tu16)(unsafe.Pointer(v3))++ v2 = *(*Tu16)(unsafe.Pointer(v3)) - idx = int32(v2) + idx = libc.Int32FromUint16(v2) if _sqlite3FaultSim(tls, int32(412)) != 0 { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { return _sqlite3CorruptError(tls, int32(76800)) } - if idx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { - rc = _moveToChild(tls, pCur, _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)))) + rc = _moveToChild(tls, pCur, _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)))) if rc != 0 { return rc } return _moveToLeftmost(tls, pCur) } - for cond := true; cond; cond = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + for cond := true; cond; cond = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_INVALID) return int32(SQLITE_DONE) @@ -53557,19 +51121,17 @@ func _sqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) (r int32) { var v2 Tu16 _, _, _, _ = pPage, v2, v3, p1 _ = flags /* Used in COMDB2 but not native SQLite */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { return _btreeNext(tls, pCur) } pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage v3 = pCur + 62 *(*Tu16)(unsafe.Pointer(v3))++ v2 = *(*Tu16)(unsafe.Pointer(v3)) - if int32(v2) >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + if libc.Int32FromUint16(v2) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { (*TBtCursor)(unsafe.Pointer(pCur)).Fix-- return _btreeNext(tls, pCur) } @@ -53607,11 +51169,8 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { var idx, rc, v1 int32 var pPage uintptr _, _, _, _ = idx, pPage, rc, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { v1 = _btreeRestoreCursorPosition(tls, pCur) } else { v1 = SQLITE_OK @@ -53620,10 +51179,10 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { if rc != SQLITE_OK { return rc } - if int32(CURSOR_INVALID) == int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) { + if int32(CURSOR_INVALID) == libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) { return int32(SQLITE_DONE) } - if int32(CURSOR_SKIPNEXT) == int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) { + if int32(CURSOR_SKIPNEXT) == libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) if (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext < 0 { return SQLITE_OK @@ -53638,22 +51197,20 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { return _sqlite3CorruptError(tls, int32(76893)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { - idx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) - rc = _moveToChild(tls, pCur, _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))))) + idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) + rc = _moveToChild(tls, pCur, _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))))) if rc != 0 { return rc } rc = _moveToRightmost(tls, pCur) } else { - for int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) == 0 { + for libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) == 0 { if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_INVALID) return int32(SQLITE_DONE) } _moveToParent(tls, pCur) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TBtCursor)(unsafe.Pointer(pCur)).Fix-- pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if (*TMemPage)(unsafe.Pointer(pPage)).FintKey != 0 && !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -53668,13 +51225,11 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { func _sqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) (r int32) { var p1 uintptr _ = p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _ = flags /* Used in COMDB2 but not native SQLite */ p1 = pCur + 1 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(BTCF_AtLast) | libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_ValidNKey))) (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID || int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) == 0 || int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf) == 0 { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID || libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) == 0 || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf) == 0 { return _btreePrevious(tls, pCur) } (*TBtCursor)(unsafe.Pointer(pCur)).Fix-- @@ -53721,8 +51276,6 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aData, bNoContent, closest, d2, dist, i, iNewTrunk, iPage, iTrunk, k, mxPage, n, nSearch, noContent, pPage1, pPrevTrunk, rc, searchList, v1, v2, v5, v6 /* Number of leaves on the trunk of the freelist */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pPrevTrunk = uintptr(0) /* Total size of the database file */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 mxPage = _btreePagecount(tls, pBt) /* EVIDENCE-OF: R-21003-45125 The 4-byte big-endian integer at offset 36 @@ -53738,20 +51291,18 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** shows that the page 'nearby' is somewhere on the free-list, then ** the entire-list will be searched for that page. */ - if int32(eMode) == int32(BTALLOC_EXACT) { + if libc.Int32FromUint8(eMode) == int32(BTALLOC_EXACT) { if nearby <= mxPage { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _ptrmapGet(tls, pBt, nearby, bp+4, uintptr(0)) if rc != 0 { return rc } - if int32(*(*Tu8)(unsafe.Pointer(bp + 4))) == int32(PTRMAP_FREEPAGE) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 4))) == int32(PTRMAP_FREEPAGE) { searchList = uint8(1) } } } else { - if int32(eMode) == int32(BTALLOC_LE) { + if libc.Int32FromUint8(eMode) == int32(BTALLOC_LE) { searchList = uint8(1) } } @@ -53794,8 +51345,6 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) goto end_allocate_page } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* EVIDENCE-OF: R-13523-04394 The second integer on a freelist trunk page ** is the number of leaf page pointers to follow. */ k = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) @@ -53803,7 +51352,6 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt /* The trunk has no leaves and the list is not being searched. ** So extract the trunk page itself and use it as the newly ** allocated page */ - _ = libc.Int32FromInt32(0) rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) if rc != 0 { goto end_allocate_page @@ -53818,7 +51366,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt rc = _sqlite3CorruptError(tls, int32(77068)) goto end_allocate_page } else { - if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && int32(eMode) == int32(BTALLOC_LE)) { + if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { /* The list is being searched and this trunk page is the page ** to allocate, regardless of whether it has leaves. */ @@ -53859,7 +51407,6 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt libc.Xmemcpy(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+8, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+12, (k-uint32(1))*uint32(4)) _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if !(pPrevTrunk != 0) { - _ = libc.Int32FromInt32(0) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iNewTrunk) } else { rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPrevTrunk)).FpDbPage) @@ -53875,7 +51422,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt aData = (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData if nearby > uint32(0) { closest = uint32(0) - if int32(eMode) == int32(BTALLOC_LE) { + if libc.Int32FromUint8(eMode) == int32(BTALLOC_LE) { i = uint32(0) for { if !(i < k) { @@ -53892,13 +51439,13 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt i++ } } else { - dist = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, aData+8)-nearby)) + dist = _sqlite3AbsInt32(tls, libc.Int32FromUint32(_sqlite3Get4byte(tls, aData+8)-nearby)) i = uint32(1) for { if !(i < k) { break } - d2 = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, aData+uintptr(uint32(8)+i*uint32(4)))-nearby)) + d2 = _sqlite3AbsInt32(tls, libc.Int32FromUint32(_sqlite3Get4byte(tls, aData+uintptr(uint32(8)+i*uint32(4)))-nearby)) if d2 < dist { closest = i dist = d2 @@ -53917,7 +51464,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt rc = _sqlite3CorruptError(tls, int32(77167)) goto end_allocate_page } - if !(searchList != 0) || (iPage == nearby || iPage < nearby && int32(eMode) == int32(BTALLOC_LE)) { + if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { *(*TPgno)(unsafe.Pointer(pPgno)) = iPage rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) if rc != 0 { @@ -53951,7 +51498,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt pPrevTrunk = uintptr(0) } } else { - if 0 == int32((*TBtShared)(unsafe.Pointer(pBt)).FbDoTruncate) { + if 0 == libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FbDoTruncate) { v6 = int32(PAGER_GET_NOCONTENT) } else { v6 = 0 @@ -53980,7 +51527,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt return rc } (*TBtShared)(unsafe.Pointer(pBt)).FnPage++ - if (*TBtShared)(unsafe.Pointer(pBt)).FnPage == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if (*TBtShared)(unsafe.Pointer(pBt)).FnPage == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { (*TBtShared)(unsafe.Pointer(pBt)).FnPage++ } if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && _ptrmapPageno(tls, pBt, (*TBtShared)(unsafe.Pointer(pBt)).FnPage) == (*TBtShared)(unsafe.Pointer(pBt)).FnPage { @@ -53989,7 +51536,6 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** becomes a new pointer-map page, the second is used by the caller. */ *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) - _ = libc.Int32FromInt32(0) rc = _btreeGetUnusedPage(tls, pBt, (*TBtShared)(unsafe.Pointer(pBt)).FnPage, bp+12, bNoContent) if rc == SQLITE_OK { rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FpDbPage) @@ -53999,13 +51545,12 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt return rc } (*TBtShared)(unsafe.Pointer(pBt)).FnPage++ - if (*TBtShared)(unsafe.Pointer(pBt)).FnPage == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if (*TBtShared)(unsafe.Pointer(pBt)).FnPage == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { (*TBtShared)(unsafe.Pointer(pBt)).FnPage++ } } _sqlite3Put4byte(tls, uintptr(28)+(*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData, (*TBtShared)(unsafe.Pointer(pBt)).FnPage) *(*TPgno)(unsafe.Pointer(pPgno)) = (*TBtShared)(unsafe.Pointer(pBt)).FnPage - _ = libc.Int32FromInt32(0) rc = _btreeGetUnusedPage(tls, pBt, *(*TPgno)(unsafe.Pointer(pPgno)), ppPage, bNoContent) if rc != 0 { return rc @@ -54016,14 +51561,11 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) } } - _ = libc.Int32FromInt32(0) goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) _releasePage(tls, pPrevTrunk) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return rc } @@ -54056,9 +51598,6 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Free-list trunk page */ iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { return _sqlite3CorruptError(tls, int32(77294)) } @@ -54075,7 +51614,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36, nFree+uint32(1)) - if int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_SECURE_DELETE) != 0 { + if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_SECURE_DELETE) != 0 { /* If the secure_delete option is enabled, then ** always fully overwrite deleted information with zeros. */ @@ -54119,7 +51658,6 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in goto freepage_out } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) - _ = libc.Int32FromInt32(0) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(77352)) goto freepage_out @@ -54148,7 +51686,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4, nLeaf+uint32(1)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+uintptr(uint32(8)+nLeaf*uint32(4)), iPage) - if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 && int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_SECURE_DELETE) == 0 { + if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 && libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_SECURE_DELETE) == 0 { _sqlite3PagerDontWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FpDbPage) } *(*int32)(unsafe.Pointer(bp + 8)) = _btreeSetHasContent(tls, pBt, iPage) @@ -54209,18 +51747,14 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp var _ /* iNext at bp+0 */ TPgno var _ /* pOvfl at bp+4 */ uintptr _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ return _sqlite3CorruptError(tls, int32(77441)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - _ = libc.Int32FromInt32(0) ovflPageSize = (*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(4) - nOvfl = int32(((*TCellInfo)(unsafe.Pointer(pInfo)).FnPayload - uint32((*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal) + ovflPageSize - uint32(1)) / ovflPageSize) - _ = libc.Int32FromInt32(0) + nOvfl = libc.Int32FromUint32(((*TCellInfo)(unsafe.Pointer(pInfo)).FnPayload - uint32((*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal) + ovflPageSize - uint32(1)) / ovflPageSize) for { v1 = nOvfl nOvfl-- @@ -54303,42 +51837,39 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize var _ /* pgnoOvfl at bp+4 */ TPgno var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = eType, mn, n, nHeader, nPayload, nSrc, pBt, pPayload, pPrior, pSrc, pToRelease, pgnoPtrmap, spaceLeft, v1, v2, v3, v4 - _ = libc.Int32FromInt32(0) /* pPage is not necessarily writeable since pCell might be auxiliary ** buffer space that is separate from the pPage buffer area */ - _ = libc.Int32FromInt32(0) /* Fill in the header. */ - nHeader = int32((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + nHeader = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) if (*TMemPage)(unsafe.Pointer(pPage)).FintKey != 0 { nPayload = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero pSrc = (*TBtreePayload)(unsafe.Pointer(pX)).FpData nSrc = (*TBtreePayload)(unsafe.Pointer(pX)).FnData - _ = libc.Int32FromInt32(0) /* fillInCell() only called for leaves */ - if uint32(nPayload) < libc.Uint32FromInt32(0x80) { - *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = uint8(nPayload) + /* fillInCell() only called for leaves */ + if libc.Uint32FromInt32(nPayload) < libc.Uint32FromInt32(0x80) { + *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = libc.Uint8FromInt32(nPayload) v1 = libc.Int32FromInt32(1) } else { - v1 = _sqlite3PutVarint(tls, pCell+uintptr(nHeader), uint64(nPayload)) + v1 = _sqlite3PutVarint(tls, pCell+uintptr(nHeader), libc.Uint64FromInt32(nPayload)) } - nHeader += int32(uint8(v1)) + nHeader += libc.Int32FromUint8(libc.Uint8FromInt32(v1)) nHeader += _sqlite3PutVarint(tls, pCell+uintptr(nHeader), *(*Tu64)(unsafe.Pointer(pX + 4))) } else { - _ = libc.Int32FromInt32(0) v2 = int32((*TBtreePayload)(unsafe.Pointer(pX)).FnKey) nPayload = v2 nSrc = v2 pSrc = (*TBtreePayload)(unsafe.Pointer(pX)).FpKey - if uint32(nPayload) < libc.Uint32FromInt32(0x80) { - *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = uint8(nPayload) + if libc.Uint32FromInt32(nPayload) < libc.Uint32FromInt32(0x80) { + *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = libc.Uint8FromInt32(nPayload) v3 = libc.Int32FromInt32(1) } else { - v3 = _sqlite3PutVarint(tls, pCell+uintptr(nHeader), uint64(nPayload)) + v3 = _sqlite3PutVarint(tls, pCell+uintptr(nHeader), libc.Uint64FromInt32(nPayload)) } - nHeader += int32(uint8(v3)) + nHeader += libc.Int32FromUint8(libc.Uint8FromInt32(v3)) } /* Fill in the payload */ pPayload = pCell + uintptr(nHeader) - if nPayload <= int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { + if nPayload <= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { /* This is the common case where everything fits on the btree page ** and no overflow pages are required. */ n = nHeader + nPayload @@ -54347,17 +51878,16 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize *(*uint8)(unsafe.Pointer(pPayload + uintptr(nPayload))) = uint8(0) } *(*int32)(unsafe.Pointer(pnSize)) = n - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, pPayload, pSrc, uint32(nSrc)) - libc.Xmemset(tls, pPayload+uintptr(nSrc), 0, uint32(nPayload-nSrc)) + libc.Xmemcpy(tls, pPayload, pSrc, libc.Uint32FromInt32(nSrc)) + libc.Xmemset(tls, pPayload+uintptr(nSrc), 0, libc.Uint32FromInt32(nPayload-nSrc)) return SQLITE_OK } /* If we reach this point, it means that some of the content will need ** to spill onto overflow pages. */ - mn = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - n = int32(uint32(mn) + uint32(nPayload-mn)%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4))) - if n > int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { + mn = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) + n = libc.Int32FromUint32(libc.Uint32FromInt32(mn) + libc.Uint32FromInt32(nPayload-mn)%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4))) + if n > libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { n = mn } spaceLeft = n @@ -54386,18 +51916,16 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize } /* If pToRelease is not zero than pPayload points into the data area ** of pToRelease. Make sure pToRelease is still writeable. */ - _ = libc.Int32FromInt32(0) /* If pPayload is part of the data area of pPage, then make sure pPage ** is still writeable */ - _ = libc.Int32FromInt32(0) if nSrc >= n { - libc.Xmemcpy(tls, pPayload, pSrc, uint32(n)) + libc.Xmemcpy(tls, pPayload, pSrc, libc.Uint32FromInt32(n)) } else { if nSrc > 0 { n = nSrc - libc.Xmemcpy(tls, pPayload, pSrc, uint32(n)) + libc.Xmemcpy(tls, pPayload, pSrc, libc.Uint32FromInt32(n)) } else { - libc.Xmemset(tls, pPayload, 0, uint32(n)) + libc.Xmemset(tls, pPayload, 0, libc.Uint32FromInt32(n)) } } nPayload -= n @@ -54412,7 +51940,7 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pgnoPtrmap = *(*TPgno)(unsafe.Pointer(bp + 4)) /* Overflow page pointer-map entry page */ if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - for cond := true; cond; cond = _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4))) == *(*TPgno)(unsafe.Pointer(bp + 4)) || *(*TPgno)(unsafe.Pointer(bp + 4)) == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + for cond := true; cond; cond = _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4))) == *(*TPgno)(unsafe.Pointer(bp + 4)) || *(*TPgno)(unsafe.Pointer(bp + 4)) == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { *(*TPgno)(unsafe.Pointer(bp + 4))++ } } @@ -54433,7 +51961,7 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize } else { v4 = int32(PTRMAP_OVERFLOW1) } - eType = uint8(v4) + eType = libc.Uint8FromInt32(v4) _ptrmapPut(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4)), eType, pgnoPtrmap, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -54445,17 +51973,15 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize } /* If pToRelease is not zero than pPrior points into the data area ** of pToRelease. Make sure pToRelease is still writeable. */ - _ = libc.Int32FromInt32(0) /* If pPrior is part of the data area of pPage, then make sure pPage ** is still writeable */ - _ = libc.Int32FromInt32(0) _sqlite3Put4byte(tls, pPrior, *(*TPgno)(unsafe.Pointer(bp + 4))) _releasePage(tls, pToRelease) pToRelease = *(*uintptr)(unsafe.Pointer(bp + 8)) pPrior = (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData _sqlite3Put4byte(tls, pPrior, uint32(0)) pPayload = (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData + 4 - spaceLeft = int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(4)) + spaceLeft = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(4)) } } _releasePage(tls, pToRelease) @@ -54480,36 +52006,29 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { if *(*int32)(unsafe.Pointer(pRC)) != 0 { return } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) data = (*TMemPage)(unsafe.Pointer(pPage)).FaData ptr = (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx) - _ = libc.Int32FromInt32(0) - pc = uint32(int32(*(*Tu8)(unsafe.Pointer(ptr)))<<libc.Int32FromInt32(8) | int32(*(*Tu8)(unsafe.Pointer(ptr + 1)))) - hdr = int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) - if pc+uint32(sz) > (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { + pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr + 1)))) + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + if pc+libc.Uint32FromInt32(sz) > (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77734)) return } - rc = _freeSpace(tls, pPage, uint16(pc), uint16(sz)) + rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return } (*TMemPage)(unsafe.Pointer(pPage)).FnCell-- - if int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { + if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint32(4)) *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - uint32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) - uint32((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) - uint32(8)) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - uint32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) - uint32((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) - uint32(8)) } else { - libc.Xmemmove(tls, ptr, ptr+uintptr(2), uint32(int32(2)*(int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell)-idx))) - *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(3)))) = uint8(int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) >> libc.Int32FromInt32(8)) + libc.Xmemmove(tls, ptr, ptr+uintptr(2), libc.Uint32FromInt32(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell)-idx))) + *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(3)))) = libc.Uint8FromInt32(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(3)) + 1)) = uint8((*TMemPage)(unsafe.Pointer(pPage)).FnCell) *(*int32)(unsafe.Pointer(pPage + 20)) += int32(2) } @@ -54547,76 +52066,60 @@ func _insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, var _ /* rc2 at bp+4 */ int32 _, _, _, _, _, _, _, _ = data, j, pIns, rc, v1, v2, v3, v4 *(*int32)(unsafe.Pointer(bp)) = 0 /* The point in pPage->aCellIdx[] where no cell inserted */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow != 0 || sz+int32(2) > (*TMemPage)(unsafe.Pointer(pPage)).FnFree { if pTemp != 0 { - libc.Xmemcpy(tls, pTemp, pCell, uint32(sz)) + libc.Xmemcpy(tls, pTemp, pCell, libc.Uint32FromInt32(sz)) pCell = pTemp } _sqlite3Put4byte(tls, pCell, iChild) v2 = pPage + 12 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - j = int32(v1) + j = libc.Int32FromUint8(v1) /* Comparison against ArraySize-1 since we hold back one extra slot ** as a contingency. In other words, never need more than 3 overflow ** slots but 4 are allocated, just to be safe. */ - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pPage + 36 + uintptr(j)*4)) = pCell - *(*Tu16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = uint16(i) + *(*Tu16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = libc.Uint16FromInt32(i) /* When multiple overflows occur, they are always sequential and in ** sorted order. This invariants arise because multiple overflows can ** only occur when inserting divider cells into the parent page during ** balancing, and the dividers are adjacent and sorted. */ - _ = libc.Int32FromInt32(0) /* Overflows in sorted order */ - _ = libc.Int32FromInt32(0) /* Overflows are sequential */ + /* Overflows in sorted order */ + /* Overflows are sequential */ } else { rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if rc != SQLITE_OK { return rc } - _ = libc.Int32FromInt32(0) data = (*TMemPage)(unsafe.Pointer(pPage)).FaData - _ = libc.Int32FromInt32(0) rc = _allocateSpace(tls, pPage, sz, bp) if rc != 0 { return rc } /* The allocateSpace() routine guarantees the following properties ** if it returns successfully */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(pPage + 20)) -= int32(uint16(libc.Int32FromInt32(2) + sz)) + *(*int32)(unsafe.Pointer(pPage + 20)) -= libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(2) + sz)) /* In a corrupt database where an entry in the cell index section of ** a btree page has a value of 3 or less, the pCell value might point ** as many as 4 bytes in front of the start of the aData buffer for ** the source page. Make sure this does not cause problems by not ** reading the first 4 bytes */ - libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))+int32(4)), pCell+uintptr(4), uint32(sz-int32(4))) + libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))+int32(4)), pCell+uintptr(4), libc.Uint32FromInt32(sz-int32(4))) _sqlite3Put4byte(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))), iChild) pIns = (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(i*int32(2)) - libc.Xmemmove(tls, pIns+uintptr(2), pIns, uint32(int32(2)*(int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell)-i))) - *(*Tu8)(unsafe.Pointer(pIns)) = uint8(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(pIns + 1)) = uint8(*(*int32)(unsafe.Pointer(bp))) + libc.Xmemmove(tls, pIns+uintptr(2), pIns, libc.Uint32FromInt32(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell)-i))) + *(*Tu8)(unsafe.Pointer(pIns)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(pIns + 1)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp))) (*TMemPage)(unsafe.Pointer(pPage)).FnCell++ /* increment the cell count */ - v4 = data + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(4)) + v4 = data + uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(4)) *(*Tu8)(unsafe.Pointer(v4))++ v3 = *(*Tu8)(unsafe.Pointer(v4)) - if int32(v3) == 0 { - *(*Tu8)(unsafe.Pointer(data + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(3))))++ + if libc.Int32FromUint8(v3) == 0 { + *(*Tu8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(3))))++ } - _ = libc.Int32FromInt32(0) if (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FautoVacuum != 0 { *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK /* The cell may contain a pointer to an overflow page. If so, write @@ -54653,65 +52156,49 @@ func _insertCellFast(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz in var _ /* rc2 at bp+4 */ int32 _, _, _, _, _, _, _, _ = data, j, pIns, rc, v1, v2, v3, v4 *(*int32)(unsafe.Pointer(bp)) = 0 /* The point in pPage->aCellIdx[] where no cell inserted */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if sz+int32(2) > (*TMemPage)(unsafe.Pointer(pPage)).FnFree { v2 = pPage + 12 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - j = int32(v1) + j = libc.Int32FromUint8(v1) /* Comparison against ArraySize-1 since we hold back one extra slot ** as a contingency. In other words, never need more than 3 overflow ** slots but 4 are allocated, just to be safe. */ - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pPage + 36 + uintptr(j)*4)) = pCell - *(*Tu16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = uint16(i) + *(*Tu16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = libc.Uint16FromInt32(i) /* When multiple overflows occur, they are always sequential and in ** sorted order. This invariants arise because multiple overflows can ** only occur when inserting divider cells into the parent page during ** balancing, and the dividers are adjacent and sorted. */ - _ = libc.Int32FromInt32(0) /* Overflows in sorted order */ - _ = libc.Int32FromInt32(0) /* Overflows are sequential */ + /* Overflows in sorted order */ + /* Overflows are sequential */ } else { rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if rc != SQLITE_OK { return rc } - _ = libc.Int32FromInt32(0) data = (*TMemPage)(unsafe.Pointer(pPage)).FaData - _ = libc.Int32FromInt32(0) rc = _allocateSpace(tls, pPage, sz, bp) if rc != 0 { return rc } /* The allocateSpace() routine guarantees the following properties ** if it returns successfully */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(pPage + 20)) -= int32(uint16(libc.Int32FromInt32(2) + sz)) - libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))), pCell, uint32(sz)) + *(*int32)(unsafe.Pointer(pPage + 20)) -= libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(2) + sz)) + libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))), pCell, libc.Uint32FromInt32(sz)) pIns = (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(i*int32(2)) - libc.Xmemmove(tls, pIns+uintptr(2), pIns, uint32(int32(2)*(int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell)-i))) - *(*Tu8)(unsafe.Pointer(pIns)) = uint8(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(pIns + 1)) = uint8(*(*int32)(unsafe.Pointer(bp))) + libc.Xmemmove(tls, pIns+uintptr(2), pIns, libc.Uint32FromInt32(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell)-i))) + *(*Tu8)(unsafe.Pointer(pIns)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(pIns + 1)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp))) (*TMemPage)(unsafe.Pointer(pPage)).FnCell++ /* increment the cell count */ - v4 = data + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(4)) + v4 = data + uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(4)) *(*Tu8)(unsafe.Pointer(v4))++ v3 = *(*Tu8)(unsafe.Pointer(v4)) - if int32(v3) == 0 { - *(*Tu8)(unsafe.Pointer(data + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(3))))++ + if libc.Int32FromUint8(v3) == 0 { + *(*Tu8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(3))))++ } - _ = libc.Int32FromInt32(0) if (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FautoVacuum != 0 { *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK /* The cell may contain a pointer to an overflow page. If so, write @@ -54840,13 +52327,10 @@ func _populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { _, _ = pRef, szCell pRef = (*TCellArray)(unsafe.Pointer(p)).FpRef szCell = (*TCellArray)(unsafe.Pointer(p)).FszCell - _ = libc.Int32FromInt32(0) for N > 0 { - _ = libc.Int32FromInt32(0) - if int32(*(*Tu16)(unsafe.Pointer(szCell + uintptr(idx)*2))) == 0 { + if libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(szCell + uintptr(idx)*2))) == 0 { *(*Tu16)(unsafe.Pointer(szCell + uintptr(idx)*2)) = (*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pRef)).FxCellSize})))(tls, pRef, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(p)).FapCell + uintptr(idx)*4))) } else { - _ = libc.Int32FromInt32(0) } idx++ N-- @@ -54859,14 +52343,11 @@ func _populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { // ** Return the size of the Nth element of the cell array // */ func _computeCellSize(tls *libc.TLS, p uintptr, N int32) (r Tu16) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) = (*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(p)).FpRef)).FxCellSize})))(tls, (*TCellArray)(unsafe.Pointer(p)).FpRef, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(p)).FapCell + uintptr(N)*4))) return *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) } func _cachedCellSize(tls *libc.TLS, p uintptr, N int32) (r Tu16) { - _ = libc.Int32FromInt32(0) if *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) != 0 { return *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) } @@ -54894,21 +52375,19 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg var j Tu32 var sz Tu16 _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aData, hdr, i, iEnd, j, k, pCell, pCellptr, pData, pEnd, pSrcEnd, pTmp, sz, usableSize - hdr = int32((*TMemPage)(unsafe.Pointer(pPg)).FhdrOffset) /* Offset of header on pPg */ - aData = (*TMemPage)(unsafe.Pointer(pPg)).FaData /* Pointer to data for pPg */ - usableSize = int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize) + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPg)).FhdrOffset) /* Offset of header on pPg */ + aData = (*TMemPage)(unsafe.Pointer(pPg)).FaData /* Pointer to data for pPg */ + usableSize = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize) pEnd = aData + uintptr(usableSize) i = iFirst /* Start of cell content area */ iEnd = i + nCell /* Loop terminator */ pCellptr = (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx pTmp = _sqlite3PagerTempSpace(tls, (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPg)).FpBt)).FpPager) /* Current pCArray->apEnd[k] value */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - j = uint32(int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))))<<libc.Int32FromInt32(8) | int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)))) - if j > uint32(usableSize) { + j = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)))) + if j > libc.Uint32FromInt32(usableSize) { j = uint32(0) } - libc.Xmemcpy(tls, pTmp+uintptr(j), aData+uintptr(j), uint32(usableSize)-j) + libc.Xmemcpy(tls, pTmp+uintptr(j), aData+uintptr(j), libc.Uint32FromInt32(usableSize)-j) k = 0 for { if !(k < libc.Int32FromInt32(NB)*libc.Int32FromInt32(2) && *(*int32)(unsafe.Pointer(pCArray + 40 + uintptr(k)*4)) <= i) { @@ -54924,7 +52403,6 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg for int32(1) != 0 { pCell = *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)) sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) - _ = libc.Int32FromInt32(0) if uint32(pCell) >= uint32(aData+uintptr(j)) && uint32(pCell) < uint32(pEnd) { if uint32(pCell+uintptr(sz)) > uint32(pEnd) { return _sqlite3CorruptError(tls, int32(78123)) @@ -54936,14 +52414,13 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg } } pData -= uintptr(sz) - *(*Tu8)(unsafe.Pointer(pCellptr)) = uint8((int32(pData) - int32(aData)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = uint8(int32(pData) - int32(aData)) + *(*Tu8)(unsafe.Pointer(pCellptr)) = libc.Uint8FromInt32((int32(pData) - int32(aData)) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt32(int32(pData) - int32(aData)) pCellptr += uintptr(2) if pData < pCellptr { return _sqlite3CorruptError(tls, int32(78134)) } libc.Xmemmove(tls, pData, pCell, uint32(sz)) - _ = libc.Int32FromInt32(0) i++ if i >= iEnd { break @@ -54954,14 +52431,14 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg } } /* The pPg->nFree field is now set incorrectly. The caller will fix it. */ - (*TMemPage)(unsafe.Pointer(pPg)).FnCell = uint16(nCell) + (*TMemPage)(unsafe.Pointer(pPg)).FnCell = libc.Uint16FromInt32(nCell) (*TMemPage)(unsafe.Pointer(pPg)).FnOverflow = uint8(0) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(1)))) = uint8(libc.Int32FromInt32(0) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(1)) + 1)) = uint8(libc.Int32FromInt32(0)) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)))) = uint8(int32((*TMemPage)(unsafe.Pointer(pPg)).FnCell) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(1)))) = libc.Uint8FromInt32(libc.Int32FromInt32(0) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(1)) + 1)) = libc.Uint8FromInt32(libc.Int32FromInt32(0)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)))) = libc.Uint8FromInt32(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPg)).FnCell) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)) + 1)) = uint8((*TMemPage)(unsafe.Pointer(pPg)).FnCell) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int32(pData) - int32(aData)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int32(pData) - int32(aData)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32((int32(pData) - int32(aData)) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(int32(pData) - int32(aData)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(7)))) = uint8(0x00) return SQLITE_OK } @@ -55004,7 +52481,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr aData = (*TMemPage)(unsafe.Pointer(pPg)).FaData /* Complete page */ pData = *(*uintptr)(unsafe.Pointer(ppData)) /* Content area. A subset of aData[] */ iEnd = iFirst + nCell /* Maximum extent of cell data */ - _ = libc.Int32FromInt32(0) /* Never called on page 1 */ + /* Never called on page 1 */ if iEnd <= iFirst { return 0 } @@ -55020,9 +52497,8 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr } pEnd = *(*uintptr)(unsafe.Pointer(pCArray + 16 + uintptr(k)*4)) for int32(1) != 0 { - _ = libc.Int32FromInt32(0) - sz = int32(*(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2))) - if v3 = int32(*(*Tu8)(unsafe.Pointer(aData + 1))) == 0 && int32(*(*Tu8)(unsafe.Pointer(aData + 2))) == 0; !v3 { + sz = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2))) + if v3 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + 1))) == 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + 2))) == 0; !v3 { v2 = _pageFindSlot(tls, pPg, sz, bp) pSlot = v2 } @@ -55036,15 +52512,13 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr /* pSlot and pCArray->apCell[i] will never overlap on a well-formed ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ - _ = libc.Int32FromInt32(0) if uint32(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))+uintptr(sz)) > uint32(pEnd) && uint32(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))) < uint32(pEnd) { - _ = libc.Int32FromInt32(0) _sqlite3CorruptError(tls, int32(78219)) return int32(1) } - libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)), uint32(sz)) - *(*Tu8)(unsafe.Pointer(pCellptr)) = uint8((int32(pSlot) - int32(aData)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = uint8(int32(pSlot) - int32(aData)) + libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)), libc.Uint32FromInt32(sz)) + *(*Tu8)(unsafe.Pointer(pCellptr)) = libc.Uint8FromInt32((int32(pSlot) - int32(aData)) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt32(int32(pSlot) - int32(aData)) pCellptr += uintptr(2) i++ if i >= iEnd { @@ -55077,7 +52551,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aAfter, aData, aOfst, i, iAfter, iEnd, iOfst, j, nFree, nRet, pCell, pEnd, pStart, sz aData = (*TMemPage)(unsafe.Pointer(pPg)).FaData pEnd = aData + uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize) - pStart = aData + uintptr(int32((*TMemPage)(unsafe.Pointer(pPg)).FhdrOffset)+int32(8)+int32((*TMemPage)(unsafe.Pointer(pPg)).FchildPtrSize)) + pStart = aData + uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPg)).FhdrOffset)+int32(8)+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPg)).FchildPtrSize)) nRet = 0 iEnd = iFirst + nCell nFree = 0 @@ -55091,9 +52565,8 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr /* No need to use cachedCellSize() here. The sizes of all cells that ** are to be freed have already been computing while deciding which ** cells need freeing */ - sz = int32(*(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2))) - _ = libc.Int32FromInt32(0) - iOfst = int32(uint16(int32(pCell) - int32(aData))) + sz = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2))) + iOfst = libc.Int32FromUint16(libc.Uint16FromInt32(int32(pCell) - int32(aData))) iAfter = iOfst + sz j = 0 for { @@ -55115,13 +52588,13 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr j++ } if j >= nFree { - if nFree >= int32(libc.Uint32FromInt64(40)/libc.Uint32FromInt64(4)) { + if nFree >= libc.Int32FromUint32(libc.Uint32FromInt64(40)/libc.Uint32FromInt64(4)) { j = 0 for { if !(j < nFree) { break } - _freeSpace(tls, pPg, uint16(aOfst[j]), uint16(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) goto _3 _3: ; @@ -55148,7 +52621,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, uint16(aOfst[j]), uint16(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) goto _4 _4: ; @@ -55179,27 +52652,25 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p var _ /* pData at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _ = aData, hdr, i, iCell, iNewEnd, iOldEnd, nAdd, nCell, nShift, nTail, pBegin, pCellptr, v1 aData = (*TMemPage)(unsafe.Pointer(pPg)).FaData - hdr = int32((*TMemPage)(unsafe.Pointer(pPg)).FhdrOffset) + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPg)).FhdrOffset) pBegin = (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr(nNew*int32(2)) - nCell = int32((*TMemPage)(unsafe.Pointer(pPg)).FnCell) - iOldEnd = iOld + int32((*TMemPage)(unsafe.Pointer(pPg)).FnCell) + int32((*TMemPage)(unsafe.Pointer(pPg)).FnOverflow) + nCell = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPg)).FnCell) + iOldEnd = iOld + libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPg)).FnCell) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPg)).FnOverflow) iNewEnd = iNew + nNew /* Remove cells from the start and end of the page */ - _ = libc.Int32FromInt32(0) if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { return _sqlite3CorruptError(tls, int32(78341)) } - libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), uint32(nCell*int32(2))) + libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint32FromInt32(nCell*int32(2))) nCell -= nShift } if iNewEnd < iOldEnd { nTail = _pageFreeArray(tls, pPg, iNewEnd, iOldEnd-iNewEnd, pCArray) - _ = libc.Int32FromInt32(0) nCell -= nTail } - *(*uintptr)(unsafe.Pointer(bp)) = aData + uintptr(int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))))<<libc.Int32FromInt32(8)|int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)))) + *(*uintptr)(unsafe.Pointer(bp)) = aData + uintptr(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))))<<libc.Int32FromInt32(8)|libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)))) if *(*uintptr)(unsafe.Pointer(bp)) < pBegin { goto editpage_fail } @@ -55214,10 +52685,8 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p v1 = iOld - iNew } nAdd = v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCellptr = (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx - libc.Xmemmove(tls, pCellptr+uintptr(nAdd*int32(2)), pCellptr, uint32(nCell*int32(2))) + libc.Xmemmove(tls, pCellptr+uintptr(nAdd*int32(2)), pCellptr, libc.Uint32FromInt32(nCell*int32(2))) if _pageInsertArray(tls, pPg, pBegin, bp, pCellptr, iNew, nAdd, pCArray) != 0 { goto editpage_fail } @@ -55226,14 +52695,14 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p /* Add any overflow cells */ i = 0 for { - if !(i < int32((*TMemPage)(unsafe.Pointer(pPg)).FnOverflow)) { + if !(i < libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPg)).FnOverflow)) { break } - iCell = iOld + int32(*(*Tu16)(unsafe.Pointer(pPg + 28 + uintptr(i)*2))) - iNew + iCell = iOld + libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pPg + 28 + uintptr(i)*2))) - iNew if iCell >= 0 && iCell < nNew { pCellptr = (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr(iCell*int32(2)) if nCell > iCell { - libc.Xmemmove(tls, pCellptr+2, pCellptr, uint32((nCell-iCell)*int32(2))) + libc.Xmemmove(tls, pCellptr+2, pCellptr, libc.Uint32FromInt32((nCell-iCell)*int32(2))) } nCell++ _cachedCellSize(tls, pCArray, iCell+iNew) @@ -55247,17 +52716,16 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p i++ } /* Append cells to the end of the page */ - _ = libc.Int32FromInt32(0) pCellptr = (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr(nCell*int32(2)) if _pageInsertArray(tls, pPg, pBegin, bp, pCellptr, iNew+nCell, nNew-nCell, pCArray) != 0 { goto editpage_fail } - (*TMemPage)(unsafe.Pointer(pPg)).FnCell = uint16(nNew) + (*TMemPage)(unsafe.Pointer(pPg)).FnCell = libc.Uint16FromInt32(nNew) (*TMemPage)(unsafe.Pointer(pPg)).FnOverflow = uint8(0) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)))) = uint8(int32((*TMemPage)(unsafe.Pointer(pPg)).FnCell) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)))) = libc.Uint8FromInt32(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPg)).FnCell) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)) + 1)) = uint8((*TMemPage)(unsafe.Pointer(pPg)).FnCell) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32((int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) return SQLITE_OK goto editpage_fail editpage_fail: @@ -55308,14 +52776,9 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt var _ /* szCell at bp+16 */ Tu16 _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { + if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { return _sqlite3CorruptError(tls, int32(78455)) } /* dbfuzz001.test */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell ** may be inserted. If both these operations are successful, proceed. @@ -55325,8 +52788,6 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt pOut = pSpace + 4 *(*uintptr)(unsafe.Pointer(bp + 12)) = *(*uintptr)(unsafe.Pointer(pPage + 36)) *(*Tu16)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, *(*uintptr)(unsafe.Pointer(bp + 12))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), libc.Int32FromInt32(PTF_INTKEY)|libc.Int32FromInt32(PTF_LEAFDATA)|libc.Int32FromInt32(PTF_LEAF)) (*(*TCellArray)(unsafe.Pointer(bp + 20))).FnCell = int32(1) (*(*TCellArray)(unsafe.Pointer(bp + 20))).FpRef = pPage @@ -55339,7 +52800,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) return *(*int32)(unsafe.Pointer(bp + 4)) } - (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnFree = int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcellOffset) - uint32(2) - uint32(*(*Tu16)(unsafe.Pointer(bp + 16)))) + (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnFree = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcellOffset) - uint32(2) - uint32(*(*Tu16)(unsafe.Pointer(bp + 16)))) /* If this is an auto-vacuum database, update the pointer map ** with entries for the new page, and any pointer from the ** cell on the page to an overflow page. If either of these @@ -55351,7 +52812,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt */ if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { _ptrmapPut(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), uint8(PTRMAP_BTREE), (*TMemPage)(unsafe.Pointer(pParent)).Fpgno, bp+4) - if int32(*(*Tu16)(unsafe.Pointer(bp + 16))) > int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FminLocal) { + if libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(bp + 16))) > libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FminLocal) { _ptrmapPutOvflPtr(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 12)), bp+4) } } @@ -55368,12 +52829,12 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt ** field. The second while(...) loop copies the key value from the ** cell on pPage into the pSpace buffer. */ - *(*uintptr)(unsafe.Pointer(bp + 12)) = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*(int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell)-int32(1)))))))) + *(*uintptr)(unsafe.Pointer(bp + 12)) = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell)-int32(1)))))))) pStop = *(*uintptr)(unsafe.Pointer(bp + 12)) + 9 for { v1 = *(*uintptr)(unsafe.Pointer(bp + 12)) *(*uintptr)(unsafe.Pointer(bp + 12))++ - if !(int32(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0 && *(*uintptr)(unsafe.Pointer(bp + 12)) < pStop) { + if !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0 && *(*uintptr)(unsafe.Pointer(bp + 12)) < pStop) { break } } @@ -55385,16 +52846,16 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt v4 = pOut pOut++ *(*Tu8)(unsafe.Pointer(v4)) = v2 - if !(int32(v2)&int32(0x80) != 0 && *(*uintptr)(unsafe.Pointer(bp + 12)) < pStop) { + if !(libc.Int32FromUint8(v2)&int32(0x80) != 0 && *(*uintptr)(unsafe.Pointer(bp + 12)) < pStop) { break } } /* Insert the new divider cell into pParent. */ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 4)) = _insertCell(tls, pParent, int32((*TMemPage)(unsafe.Pointer(pParent)).FnCell), pSpace, int32(pOut)-int32(pSpace), uintptr(0), (*TMemPage)(unsafe.Pointer(pPage)).Fpgno) + *(*int32)(unsafe.Pointer(bp + 4)) = _insertCell(tls, pParent, libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pParent)).FnCell), pSpace, int32(pOut)-int32(pSpace), uintptr(0), (*TMemPage)(unsafe.Pointer(pPage)).Fpgno) } /* Set the right-child pointer of pParent to point to the new page. */ - _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pParent)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pParent)).FhdrOffset)+int32(8)), *(*TPgno)(unsafe.Pointer(bp + 8))) + _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pParent)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pParent)).FhdrOffset)+int32(8)), *(*TPgno)(unsafe.Pointer(bp + 8))) /* Release the reference to the new page. */ _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) } @@ -55428,20 +52889,17 @@ func _copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { pBt = (*TMemPage)(unsafe.Pointer(pFrom)).FpBt aFrom = (*TMemPage)(unsafe.Pointer(pFrom)).FaData aTo = (*TMemPage)(unsafe.Pointer(pTo)).FaData - iFromHdr = int32((*TMemPage)(unsafe.Pointer(pFrom)).FhdrOffset) + iFromHdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pFrom)).FhdrOffset) if (*TMemPage)(unsafe.Pointer(pTo)).Fpgno == uint32(1) { v1 = int32(100) } else { v1 = 0 } iToHdr = v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Copy the b-tree node content from page pFrom to page pTo. */ - iData = int32(*(*Tu8)(unsafe.Pointer(aFrom + uintptr(iFromHdr+int32(5)))))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(aFrom + uintptr(iFromHdr+int32(5)) + 1))) - libc.Xmemcpy(tls, aTo+uintptr(iData), aFrom+uintptr(iData), (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(iData)) - libc.Xmemcpy(tls, aTo+uintptr(iToHdr), aFrom+uintptr(iFromHdr), uint32(int32((*TMemPage)(unsafe.Pointer(pFrom)).FcellOffset)+int32(2)*int32((*TMemPage)(unsafe.Pointer(pFrom)).FnCell))) + iData = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aFrom + uintptr(iFromHdr+int32(5)))))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aFrom + uintptr(iFromHdr+int32(5)) + 1))) + libc.Xmemcpy(tls, aTo+uintptr(iData), aFrom+uintptr(iData), (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(iData)) + libc.Xmemcpy(tls, aTo+uintptr(iToHdr), aFrom+uintptr(iFromHdr), libc.Uint32FromInt32(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pFrom)).FcellOffset)+int32(2)*libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pFrom)).FnCell))) /* Reinitialize page pTo so that the contents of the MemPage structure ** match the new data. The initialization of pTo can actually fail under ** fairly obscure circumstances, even though it is a copy of initialized @@ -55538,19 +52996,14 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, bp+60, 0, uint32(5)) libc.Xmemset(tls, bp+68, 0, uint32(64)) pBt = (*TMemPage)(unsafe.Pointer(pParent)).FpBt - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* At this point pParent may have at most one overflow cell. And if ** this overflow cell is present, it must be the cell with ** index iParentIdx. This scenario comes about when this function ** is called (indirectly) from sqlite3BtreeDelete(). */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if !(aOvflSpace != 0) { return int32(SQLITE_NOMEM) } - _ = libc.Int32FromInt32(0) /* Find the sibling pages to balance. Also locate the cells in pParent ** that divide the siblings. An attempt is made to find NN siblings on ** either side of pPage. More siblings are taken from one side, however, @@ -55562,11 +53015,10 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** overflow cells in the parent page, since if any existed they will ** have already been removed. */ - i = int32((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow) + int32((*TMemPage)(unsafe.Pointer(pParent)).FnCell) + i = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow) + libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pParent)).FnCell) if i < int32(2) { nxDiv = 0 } else { - _ = libc.Int32FromInt32(0) if iParentIdx == 0 { nxDiv = 0 } else { @@ -55579,10 +53031,10 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa i = int32(2) - bBulk } nOld = i + int32(1) - if i+nxDiv-int32((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow) == int32((*TMemPage)(unsafe.Pointer(pParent)).FnCell) { - pRight = (*TMemPage)(unsafe.Pointer(pParent)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pParent)).FhdrOffset)+int32(8)) + if i+nxDiv-libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow) == libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pParent)).FnCell) { + pRight = (*TMemPage)(unsafe.Pointer(pParent)).FaData + uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pParent)).FhdrOffset)+int32(8)) } else { - pRight = (*TMemPage)(unsafe.Pointer(pParent)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pParent)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pParent)).FaCellIdx + uintptr(int32(2)*(i+nxDiv-int32((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow)))))))) + pRight = (*TMemPage)(unsafe.Pointer(pParent)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pParent)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pParent)).FaCellIdx + uintptr(int32(2)*(i+nxDiv-libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow)))))))) } *(*TPgno)(unsafe.Pointer(bp + 56)) = _sqlite3Get4byte(tls, pRight) for int32(1) != 0 { @@ -55590,31 +53042,31 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _getAndInitPage(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 56)), bp+4+uintptr(i)*4, 0) } if *(*int32)(unsafe.Pointer(bp)) != 0 { - libc.Xmemset(tls, bp+4, 0, uint32(i+libc.Int32FromInt32(1))*uint32(4)) + libc.Xmemset(tls, bp+4, 0, libc.Uint32FromInt32(i+libc.Int32FromInt32(1))*uint32(4)) goto balance_cleanup } if (*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[i])).FnFree < 0 { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, (*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[i]) if *(*int32)(unsafe.Pointer(bp)) != 0 { - libc.Xmemset(tls, bp+4, 0, uint32(i)*uint32(4)) + libc.Xmemset(tls, bp+4, 0, libc.Uint32FromInt32(i)*uint32(4)) goto balance_cleanup } } - nMaxCells += int32((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[i])).FnCell) + int32(libc.Uint32FromInt64(16)/libc.Uint32FromInt64(4)) + nMaxCells += libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[i])).FnCell) + libc.Int32FromUint32(libc.Uint32FromInt64(16)/libc.Uint32FromInt64(4)) v1 = i i-- if v1 == 0 { break } - if (*TMemPage)(unsafe.Pointer(pParent)).FnOverflow != 0 && i+nxDiv == int32(*(*Tu16)(unsafe.Pointer(pParent + 28))) { + if (*TMemPage)(unsafe.Pointer(pParent)).FnOverflow != 0 && i+nxDiv == libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pParent + 28))) { apDiv[i] = *(*uintptr)(unsafe.Pointer(pParent + 36)) *(*TPgno)(unsafe.Pointer(bp + 56)) = _sqlite3Get4byte(tls, apDiv[i]) - (*(*[5]int32)(unsafe.Pointer(bp + 36)))[i] = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pParent)).FxCellSize})))(tls, pParent, apDiv[i])) + (*(*[5]int32)(unsafe.Pointer(bp + 36)))[i] = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pParent)).FxCellSize})))(tls, pParent, apDiv[i])) (*TMemPage)(unsafe.Pointer(pParent)).FnOverflow = uint8(0) } else { - apDiv[i] = (*TMemPage)(unsafe.Pointer(pParent)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pParent)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pParent)).FaCellIdx + uintptr(int32(2)*(i+nxDiv-int32((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow)))))))) + apDiv[i] = (*TMemPage)(unsafe.Pointer(pParent)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pParent)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pParent)).FaCellIdx + uintptr(int32(2)*(i+nxDiv-libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow)))))))) *(*TPgno)(unsafe.Pointer(bp + 56)) = _sqlite3Get4byte(tls, apDiv[i]) - (*(*[5]int32)(unsafe.Pointer(bp + 36)))[i] = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pParent)).FxCellSize})))(tls, pParent, apDiv[i])) + (*(*[5]int32)(unsafe.Pointer(bp + 36)))[i] = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pParent)).FxCellSize})))(tls, pParent, apDiv[i])) /* Drop the cell from the parent page. apDiv[i] still points to ** the cell within the parent, even though it has been dropped. ** This is safe because dropping a cell only overwrites the first @@ -55627,16 +53079,16 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** In this case, temporarily copy the cell into the aOvflSpace[] ** buffer. It will be copied out again as soon as the aSpace[] buffer ** is allocated. */ - if int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { + if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { /* If the following if() condition is not true, the db is corrupted. ** The call to dropCell() below will detect this. */ iOff = int32(apDiv[i]) - int32((*TMemPage)(unsafe.Pointer(pParent)).FaData) - if iOff+(*(*[5]int32)(unsafe.Pointer(bp + 36)))[i] <= int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) { - libc.Xmemcpy(tls, aOvflSpace+uintptr(iOff), apDiv[i], uint32((*(*[5]int32)(unsafe.Pointer(bp + 36)))[i])) + if iOff+(*(*[5]int32)(unsafe.Pointer(bp + 36)))[i] <= libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) { + libc.Xmemcpy(tls, aOvflSpace+uintptr(iOff), apDiv[i], libc.Uint32FromInt32((*(*[5]int32)(unsafe.Pointer(bp + 36)))[i])) apDiv[i] = aOvflSpace + uintptr(int32(apDiv[i])-int32((*TMemPage)(unsafe.Pointer(pParent)).FaData)) } } - _dropCell(tls, pParent, i+nxDiv-int32((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow), (*(*[5]int32)(unsafe.Pointer(bp + 36)))[i], bp) + _dropCell(tls, pParent, i+nxDiv-libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pParent)).FnOverflow), (*(*[5]int32)(unsafe.Pointer(bp + 36)))[i], bp) } } /* Make nMaxCells a multiple of 4 in order to preserve 8-byte @@ -55645,16 +53097,14 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = int32(uint32(nMaxCells)*uint32(4) + uint32(nMaxCells)*uint32(2) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize) /* aSpace1 */ - _ = libc.Int32FromInt32(0) - (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(szScratch)) + szScratch = libc.Int32FromUint32(libc.Uint32FromInt32(nMaxCells)*uint32(4) + libc.Uint32FromInt32(nMaxCells)*uint32(2) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) if (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup } (*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell = (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr(nMaxCells)*4 aSpace1 = (*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr(nMaxCells)*2 - _ = libc.Int32FromInt32(0) /* ** Load pointers to all cells on sibling pages and the divider cells ** into the local b.apCell[] array. Make copies of the divider cells @@ -55672,22 +53122,22 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** leafData: 1 if pPage holds key+data and pParent holds only keys. */ (*(*TCellArray)(unsafe.Pointer(bp + 68))).FpRef = (*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[0] - leafCorrection = uint16(int32((*TMemPage)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FpRef)).Fleaf) * int32(4)) - leafData = int32((*TMemPage)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FpRef)).FintKeyLeaf) + leafCorrection = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FpRef)).Fleaf) * int32(4)) + leafData = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FpRef)).FintKeyLeaf) i = 0 for { if !(i < nOld) { break } pOld = (*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[i] - limit = int32((*TMemPage)(unsafe.Pointer(pOld)).FnCell) + limit = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pOld)).FnCell) aData = (*TMemPage)(unsafe.Pointer(pOld)).FaData maskPage = (*TMemPage)(unsafe.Pointer(pOld)).FmaskPage piCell = aData + uintptr((*TMemPage)(unsafe.Pointer(pOld)).FcellOffset) /* Verify that all sibling pages are of the same "type" (table-leaf, ** table-interior, index-leaf, or index-interior). */ - if int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[0])).FaData))) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[0])).FaData))) { *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(78876)) goto balance_cleanup } @@ -55708,19 +53158,19 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** long be able to find the cells if a pointer to each cell is not saved ** first. */ - libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2, 0, uint32(2)*uint32(limit+int32((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) - if int32((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { - if limit < int32(*(*Tu16)(unsafe.Pointer(pOld + 28))) { + libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2, 0, uint32(2)*libc.Uint32FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) + if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { + if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(78900)) goto balance_cleanup } - limit = int32(*(*Tu16)(unsafe.Pointer(pOld + 28))) + limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) j = 0 for { if !(j < limit) { break } - *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*4)) = aData + uintptr(int32(maskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(piCell))))) + *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*4)) = aData + uintptr(libc.Int32FromUint16(maskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(piCell))))) piCell += uintptr(2) (*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell++ goto _3 @@ -55730,10 +53180,10 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } k = 0 for { - if !(k < int32((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow)) { + if !(k < libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow)) { break } - _ = libc.Int32FromInt32(0) /* NOTE 1 */ + /* NOTE 1 */ *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*4)) = *(*uintptr)(unsafe.Pointer(pOld + 36 + uintptr(k)*4)) (*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell++ goto _4 @@ -55742,40 +53192,29 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa k++ } } - piEnd = aData + uintptr((*TMemPage)(unsafe.Pointer(pOld)).FcellOffset) + uintptr(int32(2)*int32((*TMemPage)(unsafe.Pointer(pOld)).FnCell)) + piEnd = aData + uintptr((*TMemPage)(unsafe.Pointer(pOld)).FcellOffset) + uintptr(int32(2)*libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pOld)).FnCell)) for piCell < piEnd { - _ = libc.Int32FromInt32(0) - *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*4)) = aData + uintptr(int32(maskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(piCell))))) + *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*4)) = aData + uintptr(libc.Int32FromUint16(maskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(piCell))))) piCell += uintptr(2) (*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell++ } - _ = libc.Int32FromInt32(0) cntOld[i] = (*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell if i < nOld-int32(1) && !(leafData != 0) { - sz = uint16((*(*[5]int32)(unsafe.Pointer(bp + 36)))[i]) - _ = libc.Int32FromInt32(0) + sz = libc.Uint16FromInt32((*(*[5]int32)(unsafe.Pointer(bp + 36)))[i]) *(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2)) = sz pTemp = aSpace1 + uintptr(iSpace1) - iSpace1 += int32(sz) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + iSpace1 += libc.Int32FromUint16(sz) libc.Xmemcpy(tls, pTemp, apDiv[i], uint32(sz)) *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*4)) = pTemp + uintptr(leafCorrection) - _ = libc.Int32FromInt32(0) - *(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2)) = uint16(int32(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2))) - int32(leafCorrection)) + *(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2)) = libc.Uint16FromInt32(libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2))) - libc.Int32FromUint16(leafCorrection)) if !((*TMemPage)(unsafe.Pointer(pOld)).Fleaf != 0) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The right pointer of the child page pOld becomes the left ** pointer of the divider cell */ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*4)), (*TMemPage)(unsafe.Pointer(pOld)).FaData+8, uint32(4)) } else { - _ = libc.Int32FromInt32(0) - for int32(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2))) < int32(4) { + for libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2))) < int32(4) { /* Do not allow any cells smaller than 4 bytes. If a smaller cell ** does exist, pad it with 0x00 bytes. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v5 = iSpace1 iSpace1++ *(*Tu8)(unsafe.Pointer(aSpace1 + uintptr(v5))) = uint8(0x00) @@ -55805,7 +53244,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** usableSpace: Number of bytes of space available on each sibling. ** */ - usableSpace = int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(12) + uint32(leafCorrection)) + usableSpace = libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(12) + uint32(leafCorrection)) v7 = libc.Int32FromInt32(0) k = v7 i = v7 @@ -55824,14 +53263,13 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*uintptr)(unsafe.Pointer(bp + 68 + 16 + uintptr(k)*4)) = (*TMemPage)(unsafe.Pointer(pParent)).FaDataEnd *(*int32)(unsafe.Pointer(bp + 68 + 40 + uintptr(k)*4)) = cntOld[i] + int32(1) } - _ = libc.Int32FromInt32(0) (*(*[5]int32)(unsafe.Pointer(bp + 36)))[i] = usableSpace - (*TMemPage)(unsafe.Pointer(p)).FnFree j = 0 for { - if !(j < int32((*TMemPage)(unsafe.Pointer(p)).FnOverflow)) { + if !(j < libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(p)).FnOverflow)) { break } - *(*int32)(unsafe.Pointer(bp + 36 + uintptr(i)*4)) += int32(2) + int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(p)).FxCellSize})))(tls, p, *(*uintptr)(unsafe.Pointer(p + 36 + uintptr(j)*4)))) + *(*int32)(unsafe.Pointer(bp + 36 + uintptr(i)*4)) += int32(2) + libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(p)).FxCellSize})))(tls, p, *(*uintptr)(unsafe.Pointer(p + 36 + uintptr(j)*4)))) goto _8 _8: ; @@ -55860,11 +53298,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa (*(*[5]int32)(unsafe.Pointer(bp + 36)))[k-int32(1)] = 0 cntNew[k-int32(1)] = (*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell } - sz1 = int32(2) + int32(_cachedCellSize(tls, bp+68, cntNew[i]-int32(1))) + sz1 = int32(2) + libc.Int32FromUint16(_cachedCellSize(tls, bp+68, cntNew[i]-int32(1))) *(*int32)(unsafe.Pointer(bp + 36 + uintptr(i)*4)) -= sz1 if !(leafData != 0) { if cntNew[i] < (*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell { - sz1 = int32(2) + int32(_cachedCellSize(tls, bp+68, cntNew[i])) + sz1 = int32(2) + libc.Int32FromUint16(_cachedCellSize(tls, bp+68, cntNew[i])) } else { sz1 = 0 } @@ -55873,7 +53311,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa cntNew[i]-- } for cntNew[i] < (*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell { - sz1 = int32(2) + int32(_cachedCellSize(tls, bp+68, cntNew[i])) + sz1 = int32(2) + libc.Int32FromUint16(_cachedCellSize(tls, bp+68, cntNew[i])) if (*(*[5]int32)(unsafe.Pointer(bp + 36)))[i]+sz1 > usableSpace { break } @@ -55881,7 +53319,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa cntNew[i]++ if !(leafData != 0) { if cntNew[i] < (*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell { - sz1 = int32(2) + int32(_cachedCellSize(tls, bp+68, cntNew[i])) + sz1 = int32(2) + libc.Int32FromUint16(_cachedCellSize(tls, bp+68, cntNew[i])) } else { sz1 = 0 } @@ -55928,10 +53366,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa d = r + int32(1) - leafData _cachedCellSize(tls, bp+68, d) for cond := true; cond; cond = r >= 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - szR = int32(_cachedCellSize(tls, bp+68, r)) - szD = int32(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr(d)*2))) + szR = libc.Int32FromUint16(_cachedCellSize(tls, bp+68, r)) + szD = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr(d)*2))) if v14 = szRight != 0; v14 { if v13 = bBulk != 0; !v13 { if i == k-int32(1) { @@ -55973,11 +53409,10 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** the real root page is page 1 and we are the only child of ** that page. */ - _ = libc.Int32FromInt32(0) /* ** Allocate k new pages. Reuse old pages where possible. */ - pageFlags = int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[0])).FaData))) + pageFlags = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[0])).FaData))) i = 0 for { if !(i < k) { @@ -55997,7 +53432,6 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa goto balance_cleanup } } else { - _ = libc.Int32FromInt32(0) if bBulk != 0 { v18 = uint32(1) } else { @@ -56042,8 +53476,6 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa break } aPgno[i] = (*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[i])).Fpgno - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto _19 _19: ; @@ -56076,7 +53508,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if iB != i { pgnoA = (*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[i])).Fpgno pgnoB = (*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[iB])).Fpgno - pgnoTemp = uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize + uint32(1) + pgnoTemp = libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize + uint32(1) fgA = (*TDbPage)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[i])).FpDbPage)).Fflags fgB = (*TDbPage)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[iB])).FpDbPage)).Fflags _sqlite3PagerRekey(tls, (*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[i])).FpDbPage, pgnoTemp, fgB) @@ -56090,9 +53522,6 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ; i++ } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3Put4byte(tls, pRight, (*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[nNew-int32(1)])).Fpgno) /* If the sibling pages are not leaves, ensure that the right-child pointer ** of the right-most new sibling page is set to the value that was @@ -56126,7 +53555,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v23 = (*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[0] pOld2 = v23 pNew1 = v23 - cntOldNext = int32((*TMemPage)(unsafe.Pointer(pNew1)).FnCell) + int32((*TMemPage)(unsafe.Pointer(pNew1)).FnOverflow) + cntOldNext = libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pNew1)).FnCell) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pNew1)).FnOverflow) iNew = 0 iOld = 0 i = 0 @@ -56137,15 +53566,13 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa pCell = *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr(i)*4)) for i == cntOldNext { iOld++ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iOld < nNew { v25 = (*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[iOld] } else { v25 = (*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[iOld] } pOld2 = v25 - cntOldNext += int32((*TMemPage)(unsafe.Pointer(pOld2)).FnCell) + int32((*TMemPage)(unsafe.Pointer(pOld2)).FnOverflow) + libc.BoolInt32(!(leafData != 0)) + cntOldNext += libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pOld2)).FnCell) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld2)).FnOverflow) + libc.BoolInt32(!(leafData != 0)) } if i == cntNew[iNew] { iNew++ @@ -56165,7 +53592,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if !(leafCorrection != 0) { _ptrmapPut(tls, pBt, _sqlite3Get4byte(tls, pCell), uint8(PTRMAP_BTREE), (*TMemPage)(unsafe.Pointer(pNew1)).Fpgno, bp) } - if int32(_cachedCellSize(tls, bp+68, i)) > int32((*TMemPage)(unsafe.Pointer(pNew1)).FminLocal) { + if libc.Int32FromUint16(_cachedCellSize(tls, bp+68, i)) > libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pNew1)).FminLocal) { _ptrmapPutOvflPtr(tls, pNew1, pOld2, pCell, bp) } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56186,10 +53613,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pNew2 = (*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[i] j = cntNew[i] - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCell1 = *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr(j)*4)) - sz2 = int32(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr(j)*2))) + int32(leafCorrection) + sz2 = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr(j)*2))) + libc.Int32FromUint16(leafCorrection) pTemp1 = aOvflSpace + uintptr(iOvflSpace) if !((*TMemPage)(unsafe.Pointer(pNew2)).Fleaf != 0) { libc.Xmemcpy(tls, (*TMemPage)(unsafe.Pointer(pNew2)).FaData+8, pCell1, uint32(4)) @@ -56198,7 +53623,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa j-- (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pNew2)).FxParseCell})))(tls, pNew2, *(*uintptr)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell + uintptr(j)*4)), bp+136) pCell1 = pTemp1 - sz2 = int32(4) + _sqlite3PutVarint(tls, pCell1+4, uint64((*(*TCellInfo)(unsafe.Pointer(bp + 136))).FnKey)) + sz2 = int32(4) + _sqlite3PutVarint(tls, pCell1+4, libc.Uint64FromInt64((*(*TCellInfo)(unsafe.Pointer(bp + 136))).FnKey)) pTemp1 = uintptr(0) } else { pCell1 -= uintptr(4) @@ -56213,15 +53638,12 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** and WITHOUT ROWID tables with exactly one column which is the ** primary key. */ - if int32(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr(j)*2))) == int32(4) { - _ = libc.Int32FromInt32(0) - sz2 = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pParent)).FxCellSize})))(tls, pParent, pCell1)) + if libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell + uintptr(j)*2))) == int32(4) { + sz2 = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pParent)).FxCellSize})))(tls, pParent, pCell1)) } } } iOvflSpace += sz2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) k = 0 for { if !(k < libc.Int32FromInt32(NB)*libc.Int32FromInt32(2) && *(*int32)(unsafe.Pointer(bp + 68 + 40 + uintptr(k)*4)) <= j) { @@ -56241,7 +53663,6 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto balance_cleanup } - _ = libc.Int32FromInt32(0) goto _27 _27: ; @@ -56280,19 +53701,14 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v30 = i } iPg = v30 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*(*[5]Tu8)(unsafe.Pointer(bp + 60)))[iPg] != 0 { goto _29 } /* Skip pages already processed */ if i >= 0 || cntOld[iPg-int32(1)] >= cntNew[iPg-int32(1)] { /* Verify condition (1): If cells are moving left, update iPg ** only after iPg-1 has already been updated. */ - _ = libc.Int32FromInt32(0) /* Verify condition (2): If cells are moving right, update iPg ** only after iPg+1 has already been updated. */ - _ = libc.Int32FromInt32(0) if iPg == 0 { v31 = libc.Int32FromInt32(0) iOld1 = v31 @@ -56314,8 +53730,6 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } (*(*[5]Tu8)(unsafe.Pointer(bp + 60)))[iPg]++ (*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[iPg])).FnFree = usableSpace - (*(*[5]int32)(unsafe.Pointer(bp + 36)))[iPg] - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } goto _29 _29: @@ -56323,10 +53737,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa i++ } /* All pages have been processed exactly once */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if isRoot != 0 && int32((*TMemPage)(unsafe.Pointer(pParent)).FnCell) == 0 && int32((*TMemPage)(unsafe.Pointer(pParent)).FhdrOffset) <= (*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[0])).FnFree { + if isRoot != 0 && libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pParent)).FnCell) == 0 && libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pParent)).FhdrOffset) <= (*TMemPage)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[0])).FnFree { /* The root page of the b-tree now contains no cells. The only sibling ** page is the right-child of the parent. Copy the contents of the ** child page into the parent, decreasing the overall height of the @@ -56342,9 +53753,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** by smaller than the child due to the database header, and so all the ** free space needs to be up front. */ - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _defragmentPage(tls, (*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[0], -int32(1)) - _ = libc.Int32FromInt32(0) _copyNodeContent(tls, (*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[0], pParent, bp) _freePage(tls, (*(*[5]uintptr)(unsafe.Pointer(bp + 16)))[0], bp) } else { @@ -56366,7 +53775,6 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } } } - _ = libc.Int32FromInt32(0) /* Free any old pages that were not reused as new pages. */ i = nNew @@ -56444,8 +53852,6 @@ func _balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* Pointer to a new child page */ *(*TPgno)(unsafe.Pointer(bp + 8)) = uint32(0) /* Page number of the new child page */ pBt = (*TMemPage)(unsafe.Pointer(pRoot)).FpBt /* The BTree */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Make pRoot, the root page of the b-tree, writable. Allocate a new ** page that will become the new right-child of pPage. Copy the contents ** of the node stored on pRoot into the new child page. @@ -56463,16 +53869,13 @@ func _balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) (r int32) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) return *(*int32)(unsafe.Pointer(bp)) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Copy the overflow cells from pRoot to pChild */ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 4))+28, pRoot+28, uint32((*TMemPage)(unsafe.Pointer(pRoot)).FnOverflow)*uint32(2)) libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 4))+36, pRoot+36, uint32((*TMemPage)(unsafe.Pointer(pRoot)).FnOverflow)*uint32(4)) (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FnOverflow = (*TMemPage)(unsafe.Pointer(pRoot)).FnOverflow /* Zero the contents of pRoot. Then install pChild as the right-child. */ - _zeroPage(tls, pRoot, int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData))) & ^libc.Int32FromInt32(PTF_LEAF)) - _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8)), *(*TPgno)(unsafe.Pointer(bp + 8))) + _zeroPage(tls, pRoot, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData))) & ^libc.Int32FromInt32(PTF_LEAF)) + _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8)), *(*TPgno)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(ppChild)) = *(*uintptr)(unsafe.Pointer(bp + 4)) return SQLITE_OK } @@ -56498,7 +53901,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { if !(pOther != 0) { break } - if pOther != pCur && int32((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { + if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { return _sqlite3CorruptError(tls, int32(79543)) } goto _1 @@ -56536,7 +53939,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { break } - if int32((*TMemPage)(unsafe.Pointer(pPage)).FnOverflow) == 0 && (*TMemPage)(unsafe.Pointer(pPage)).FnFree*int32(3) <= int32((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize)*int32(2) { + if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FnOverflow) == 0 && (*TMemPage)(unsafe.Pointer(pPage)).FnFree*int32(3) <= libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize)*int32(2) { /* No rebalance required as long as: ** (1) There are no overflow cells ** (2) The amount of free space on the page is less than 2/3rds of @@ -56556,7 +53959,6 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { ** and copy the current contents of the root-page to it. The ** next iteration of the do-loop will balance the child page. */ - _ = libc.Int32FromInt32(0) rc = _balance_deeper(tls, pPage, pCur+112+1*4) if rc == SQLITE_OK { (*TBtCursor)(unsafe.Pointer(pCur)).FiPage = int8(1) @@ -56564,7 +53966,6 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { *(*Tu16)(unsafe.Pointer(pCur + 64)) = uint16(0) *(*uintptr)(unsafe.Pointer(pCur + 112)) = pPage (*TBtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 112 + 1*4)) - _ = libc.Int32FromInt32(0) } } else { break @@ -56577,13 +53978,13 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { rc = _sqlite3CorruptError(tls, int32(79603)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 112 + uintptr(iPage-int32(1))*4)) - iIdx = int32(*(*Tu16)(unsafe.Pointer(pCur + 64 + uintptr(iPage-int32(1))*2))) + iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 64 + uintptr(iPage-int32(1))*2))) rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pParent)).FpDbPage) if rc == SQLITE_OK && (*TMemPage)(unsafe.Pointer(pParent)).FnFree < 0 { rc = _btreeComputeFreeSpace(tls, pParent) } if rc == SQLITE_OK { - if (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf != 0 && int32((*TMemPage)(unsafe.Pointer(pPage)).FnOverflow) == int32(1) && int32(*(*Tu16)(unsafe.Pointer(pPage + 28))) == int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) && (*TMemPage)(unsafe.Pointer(pParent)).Fpgno != uint32(1) && int32((*TMemPage)(unsafe.Pointer(pParent)).FnCell) == iIdx { + if (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf != 0 && libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FnOverflow) == int32(1) && libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pPage + 28))) == libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) && (*TMemPage)(unsafe.Pointer(pParent)).Fpgno != uint32(1) && libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pParent)).FnCell) == iIdx { /* Call balance_quick() to create a new sibling of pPage on which ** to store the overflow cell. balance_quick() inserts a new cell ** into pParent, which may cause pParent overflow. If this @@ -56597,7 +53998,6 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { ** function. If this were not verified, a subtle bug involving reuse ** of the aBalanceQuickSpace[] might sneak in. */ - _ = libc.Int32FromInt32(0) rc = _balance_quick(tls, pParent, pPage, bp) } else { /* In this case, call balance_nonroot() to redistribute cells @@ -56617,8 +54017,8 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { ** copied either into the body of a database page or into the new ** pSpace buffer passed to the latter call to balance_nonroot(). */ - pSpace = _sqlite3PageMalloc(tls, int32((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize)) - rc = _balance_nonroot(tls, pParent, iIdx, pSpace, libc.BoolInt32(iPage == int32(1)), int32((*TBtCursor)(unsafe.Pointer(pCur)).Fhints)&int32(BTREE_BULKLOAD)) + pSpace = _sqlite3PageMalloc(tls, libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize)) + rc = _balance_nonroot(tls, pParent, iIdx, pSpace, libc.BoolInt32(iPage == int32(1)), libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).Fhints)&int32(BTREE_BULKLOAD)) if pFree != 0 { /* If pFree is not NULL, it points to the pSpace buffer used ** by a previous call to balance_nonroot(). Its contents are @@ -56636,7 +54036,6 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The next iteration of the do-loop balances the parent page. */ _releasePage(tls, pPage) (*TBtCursor)(unsafe.Pointer(pCur)).FiPage-- - _ = libc.Int32FromInt32(0) (*TBtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 112 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*4)) } } @@ -56660,7 +54059,7 @@ func _btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uint if nData <= 0 { i = 0 for { - if !(i < iAmt && int32(*(*Tu8)(unsafe.Pointer(pDest + uintptr(i)))) == 0) { + if !(i < iAmt && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pDest + uintptr(i)))) == 0) { break } goto _1 @@ -56673,7 +54072,7 @@ func _btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uint if rc != 0 { return rc } - libc.Xmemset(tls, pDest+uintptr(i), 0, uint32(iAmt-i)) + libc.Xmemset(tls, pDest+uintptr(i), 0, libc.Uint32FromInt32(iAmt-i)) } } else { if nData < iAmt { @@ -56685,7 +54084,7 @@ func _btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uint } iAmt = nData } - if libc.Xmemcmp(tls, pDest, (*TBtreePayload)(unsafe.Pointer(pX)).FpData+uintptr(iOffset), uint32(iAmt)) != 0 { + if libc.Xmemcmp(tls, pDest, (*TBtreePayload)(unsafe.Pointer(pX)).FpData+uintptr(iOffset), libc.Uint32FromInt32(iAmt)) != 0 { rc2 = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if rc2 != 0 { return rc2 @@ -56694,7 +54093,7 @@ func _btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uint ** buffers to overlap. This is harmless since the database is already ** corrupt but it does cause valgrind and ASAN warnings. So use ** memmove(). */ - libc.Xmemmove(tls, pDest, (*TBtreePayload)(unsafe.Pointer(pX)).FpData+uintptr(iOffset), uint32(iAmt)) + libc.Xmemmove(tls, pDest, (*TBtreePayload)(unsafe.Pointer(pX)).FpData+uintptr(iOffset), libc.Uint32FromInt32(iAmt)) } } return SQLITE_OK @@ -56718,16 +54117,14 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int _, _, _, _, _, _ = iOffset, nTotal, ovflPageSize, ovflPgno, pBt, rc /* Next byte of pX->pData to write */ nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Return code */ *(*uintptr)(unsafe.Pointer(bp)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Size to write on overflow page */ - _ = libc.Int32FromInt32(0) /* pCur is an overflow cell */ + /* pCur is an overflow cell */ /* Overwrite the local portion first */ - rc = _btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp)), (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX, 0, int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) + rc = _btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp)), (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX, 0, libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) if rc != 0 { return rc } /* Now overwrite the overflow pages */ - iOffset = int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + iOffset = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) ovflPgno = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr(iOffset)) pBt = (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpBt ovflPageSize = (*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(4) @@ -56739,12 +54136,12 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { rc = _sqlite3CorruptError(tls, int32(79767)) } else { - if uint32(iOffset)+ovflPageSize < uint32(nTotal) { + if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) } else { - ovflPageSize = uint32(nTotal - iOffset) + ovflPageSize = libc.Uint32FromInt32(nTotal - iOffset) } - rc = _btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp)), (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+uintptr(4), pX, iOffset, int32(ovflPageSize)) + rc = _btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp)), (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+uintptr(4), pX, iOffset, libc.Int32FromUint32(ovflPageSize)) } _sqlite3PagerUnref(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) if rc != 0 { @@ -56770,9 +54167,9 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { return _sqlite3CorruptError(tls, int32(79795)) } - if int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { + if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ - return _btreeOverwriteContent(tls, pPage, (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX, 0, int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) + return _btreeOverwriteContent(tls, pPage, (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX, 0, libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) } else { /* The cell contains overflow content */ return _btreeOverwriteOverflowCell(tls, pCur, pX) @@ -56831,8 +54228,6 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s *(*int32)(unsafe.Pointer(bp + 8)) = 0 p = (*TBtCursor)(unsafe.Pointer(pCur)).FpBtree newCell = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Save the positions of any other cursors open on this table. ** ** In some cases, the call to btreeMoveto() below is a no-op. For @@ -56844,7 +54239,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** doing any work. To avoid thwarting these optimizations, it is important ** not to clear the cursor here. */ - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_Multiple) != 0 { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_Multiple) != 0 { *(*int32)(unsafe.Pointer(bp)) = _saveAllCursors(tls, (*TBtree)(unsafe.Pointer(p)).FpBt, (*TBtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur) if *(*int32)(unsafe.Pointer(bp)) != 0 { return *(*int32)(unsafe.Pointer(bp)) @@ -56861,23 +54256,18 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s /* Ensure that the cursor is not in the CURSOR_FAULT state and that it ** points to a valid cell. */ - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { *(*int32)(unsafe.Pointer(bp)) = _moveToRoot(tls, pCur) if *(*int32)(unsafe.Pointer(bp)) != 0 && *(*int32)(unsafe.Pointer(bp)) != int32(SQLITE_EMPTY) { return *(*int32)(unsafe.Pointer(bp)) } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Assert that the caller has been consistent. If this cursor was opened ** expecting an index b-tree, then the caller should be inserting blob ** keys with no associated data. If the cursor was opened expecting an ** intkey table, the caller should be inserting integer keys with a ** blob of associated data. */ - _ = libc.Int32FromInt32(0) if (*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0) { - _ = libc.Int32FromInt32(0) /* If this is an insert into a table b-tree, invalidate any incrblob ** cursors open on the row being replaced */ if (*TBtree)(unsafe.Pointer(p)).FhasIncrblobCur != 0 { @@ -56890,15 +54280,13 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** that the cursor is not pointing to a row to be overwritten. ** So do a complete check. */ - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_ValidNKey) != 0 && (*TBtreePayload)(unsafe.Pointer(pX)).FnKey == (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_ValidNKey) != 0 && (*TBtreePayload)(unsafe.Pointer(pX)).FnKey == (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey { /* The cursor is pointing to the entry that is to be ** overwritten */ - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) != 0 && (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload == uint32((*TBtreePayload)(unsafe.Pointer(pX)).FnData)+uint32((*TBtreePayload)(unsafe.Pointer(pX)).FnZero) { + if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) != 0 && (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload == libc.Uint32FromInt32((*TBtreePayload)(unsafe.Pointer(pX)).FnData)+libc.Uint32FromInt32((*TBtreePayload)(unsafe.Pointer(pX)).FnZero) { /* New entry is the same size as the old. Do an overwrite */ return _btreeOverwriteCell(tls, pCur, pX) } - _ = libc.Int32FromInt32(0) } else { if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { /* The cursor is *not* pointing to the cell to be overwritten, nor @@ -56916,7 +54304,6 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s /* If BTREE_SAVEPOSITION is set, the cursor must already be pointing ** to a row with the same key as the new entry being inserted. */ - _ = libc.Int32FromInt32(0) /* If the cursor is not already pointing either to the cell to be ** overwritten, or if a new cell is being inserted, if the cursor is ** not pointing to an immediately adjacent cell, then move the cursor @@ -56951,12 +54338,9 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s } } } - _ = libc.Int32FromInt32(0) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79999)) } else { @@ -56966,10 +54350,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s return *(*int32)(unsafe.Pointer(bp)) } } - _ = libc.Int32FromInt32(0) newCell = (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FpTmpSpace - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if flags&int32(BTREE_PREFORMAT) != 0 { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*int32)(unsafe.Pointer(bp + 8)) = (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnPreformatSize @@ -56977,7 +54358,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s *(*int32)(unsafe.Pointer(bp + 8)) = int32(4) *(*uint8)(unsafe.Pointer(newCell + 3)) = uint8(0) } - if (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FautoVacuum != 0 && *(*int32)(unsafe.Pointer(bp + 8)) > int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { + if (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FautoVacuum != 0 && *(*int32)(unsafe.Pointer(bp + 8)) > libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, newCell, bp+72) if (*(*TCellInfo)(unsafe.Pointer(bp + 72))).FnPayload != uint32((*(*TCellInfo)(unsafe.Pointer(bp + 72))).FnLocal) { ovfl = _sqlite3Get4byte(tls, newCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))-int32(4))) @@ -56993,20 +54374,17 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s goto end_insert } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - idx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) + idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { - _ = libc.Int32FromInt32(0) - if idx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { return _sqlite3CorruptError(tls, int32(80041)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { goto end_insert } - oldCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))) + oldCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx)))))) if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { libc.Xmemcpy(tls, newCell, oldCell, uint32(4)) } @@ -57018,7 +54396,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s } p1 = pCur + 1 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTCF_ValidOvfl)) - if int32((*(*TCellInfo)(unsafe.Pointer(bp + 92))).FnSize) == *(*int32)(unsafe.Pointer(bp + 8)) && uint32((*(*TCellInfo)(unsafe.Pointer(bp + 92))).FnLocal) == (*(*TCellInfo)(unsafe.Pointer(bp + 92))).FnPayload && (!((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FautoVacuum != 0) || *(*int32)(unsafe.Pointer(bp + 8)) < int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal)) { + if libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp + 92))).FnSize) == *(*int32)(unsafe.Pointer(bp + 8)) && uint32((*(*TCellInfo)(unsafe.Pointer(bp + 92))).FnLocal) == (*(*TCellInfo)(unsafe.Pointer(bp + 92))).FnPayload && (!((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FautoVacuum != 0) || *(*int32)(unsafe.Pointer(bp + 8)) < libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FminLocal)) { /* Overwrite the old cell with the new if they are the same size. ** We could also try to do this if the old cell is smaller, then add ** the leftover space to the free list. But experiments show that @@ -57028,36 +54406,32 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** This optimization cannot be used on an autovacuum database if the ** new entry uses overflow pages, as the insertCell() call below is ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ - _ = libc.Int32FromInt32(0) /* clearCell never fails when nLocal==nPayload */ + /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { return _sqlite3CorruptError(tls, int32(80068)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { return _sqlite3CorruptError(tls, int32(80071)) } - libc.Xmemcpy(tls, oldCell, newCell, uint32(*(*int32)(unsafe.Pointer(bp + 8)))) + libc.Xmemcpy(tls, oldCell, newCell, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK } - _dropCell(tls, pPage, idx, int32((*(*TCellInfo)(unsafe.Pointer(bp + 92))).FnSize), bp) + _dropCell(tls, pPage, idx, libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp + 92))).FnSize), bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { goto end_insert } } else { - if *(*int32)(unsafe.Pointer(bp + 4)) < 0 && int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) > 0 { - _ = libc.Int32FromInt32(0) + if *(*int32)(unsafe.Pointer(bp + 4)) < 0 && libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) > 0 { v3 = pCur + 62 *(*Tu16)(unsafe.Pointer(v3))++ v2 = *(*Tu16)(unsafe.Pointer(v3)) - idx = int32(v2) + idx = libc.Int32FromUint16(v2) p4 = pCur + 1 *(*Tu8)(unsafe.Pointer(p4)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p4))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) } else { - _ = libc.Int32FromInt32(0) } } *(*int32)(unsafe.Pointer(bp)) = _insertCellFast(tls, pPage, idx, newCell, *(*int32)(unsafe.Pointer(bp + 8))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If no error has occurred and pPage has an overflow cell, call balance() ** to redistribute the cells within the tree. Since balance() may move ** the cursor, zero the BtCursor.info.nSize and BTCF_ValidNKey @@ -57079,7 +54453,6 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** row without seeking the cursor. This can be a big performance boost. */ if (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow != 0 { - _ = libc.Int32FromInt32(0) p5 = pCur + 1 *(*Tu8)(unsafe.Pointer(p5)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p5))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) *(*int32)(unsafe.Pointer(bp)) = _balance(tls, pCur) @@ -57092,19 +54465,17 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if flags&int32(BTREE_SAVEPOSITION) != 0 && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _btreeReleaseAllCursorPages(tls, pCur) if (*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo != 0 { - _ = libc.Int32FromInt32(0) - (*TBtCursor)(unsafe.Pointer(pCur)).FpKey = _sqlite3Malloc(tls, uint64((*TBtreePayload)(unsafe.Pointer(pX)).FnKey)) + (*TBtCursor)(unsafe.Pointer(pCur)).FpKey = _sqlite3Malloc(tls, libc.Uint64FromInt64((*TBtreePayload)(unsafe.Pointer(pX)).FnKey)) if (*TBtCursor)(unsafe.Pointer(pCur)).FpKey == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpKey, (*TBtreePayload)(unsafe.Pointer(pX)).FpKey, uint32((*TBtreePayload)(unsafe.Pointer(pX)).FnKey)) + libc.Xmemcpy(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpKey, (*TBtreePayload)(unsafe.Pointer(pX)).FpKey, libc.Uint32FromInt64((*TBtreePayload)(unsafe.Pointer(pX)).FnKey)) } } (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_REQUIRESEEK) (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = (*TBtreePayload)(unsafe.Pointer(pX)).FnKey } } - _ = libc.Int32FromInt32(0) goto end_insert end_insert: ; @@ -57153,7 +54524,7 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T aOut += uintptr(_sqlite3PutVarint(tls, aOut, uint64((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) } if (*TBtCursor)(unsafe.Pointer(pDest)).FpKeyInfo == uintptr(0) { - aOut += uintptr(_sqlite3PutVarint(tls, aOut, uint64(iKey))) + aOut += uintptr(_sqlite3PutVarint(tls, aOut, libc.Uint64FromInt64(iKey))) } nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload @@ -57163,7 +54534,7 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, nIn) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(nIn + uint32(int32(aOut)-int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(aOut)-int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -57172,8 +54543,8 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T ovflIn = uint32(0) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ - nOut = uint32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, int64((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(nOut + uint32(int32(aOut)-int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut + libc.Uint32FromInt32(int32(aOut)-int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 88)) += int32(4) @@ -57187,17 +54558,16 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T for cond := true; cond; cond = nRem > uint32(0) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { nRem -= nOut for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && nOut > uint32(0) { - _ = libc.Int32FromInt32(0) if nIn > uint32(0) { if nOut < nIn { v2 = nOut } else { v2 = nIn } - nCopy = int32(v2) - libc.Xmemcpy(tls, aOut, aIn, uint32(nCopy)) - nOut -= uint32(nCopy) - nIn -= uint32(nCopy) + nCopy = libc.Int32FromUint32(v2) + libc.Xmemcpy(tls, aOut, aIn, libc.Uint32FromInt32(nCopy)) + nOut -= libc.Uint32FromInt32(nCopy) + nIn -= libc.Uint32FromInt32(nCopy) aOut += uintptr(nCopy) aIn += uintptr(nCopy) } @@ -57274,32 +54644,23 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { _, _, _, _, _, _, _, _, _, _, _, _, _ = bPreserve, iCellDepth, iCellIdx, n, nCell, p, pBt, pCell, pLeaf, pPage, pTmp, v1, v2 p = (*TBtCursor)(unsafe.Pointer(pCur)).FpBtree pBt = (*TBtree)(unsafe.Pointer(p)).FpBt /* Keep cursor valid. 2 for CURSOR_SKIPNEXT */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) >= int32(CURSOR_REQUIRESEEK) { *(*int32)(unsafe.Pointer(bp)) = _btreeRestoreCursorPosition(tls, pCur) - _ = libc.Int32FromInt32(0) - if *(*int32)(unsafe.Pointer(bp)) != 0 || int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { + if *(*int32)(unsafe.Pointer(bp)) != 0 || libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID { return *(*int32)(unsafe.Pointer(bp)) } } else { return _sqlite3CorruptError(tls, int32(80294)) } } - _ = libc.Int32FromInt32(0) iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) - iCellIdx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) + iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage - if int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { + if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { return _sqlite3CorruptError(tls, int32(80303)) } - pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) + pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { return _sqlite3CorruptError(tls, int32(80307)) } @@ -57322,9 +54683,9 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { ** bPreserve==1 Use CURSOR_REQUIRESEEK to save the cursor position ** bPreserve==2 Cursor won't move. Set CURSOR_SKIPNEXT. */ - bPreserve = libc.BoolUint8(int32(flags)&int32(BTREE_SAVEPOSITION) != 0) + bPreserve = libc.BoolUint8(libc.Int32FromUint8(flags)&int32(BTREE_SAVEPOSITION) != 0) if bPreserve != 0 { - if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) || (*TMemPage)(unsafe.Pointer(pPage)).FnFree+int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, pCell))+int32(2) > int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize*libc.Uint32FromInt32(2)/libc.Uint32FromInt32(3)) || int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == int32(1) { + if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) || (*TMemPage)(unsafe.Pointer(pPage)).FnFree+libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, pCell))+int32(2) > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize*libc.Uint32FromInt32(2)/libc.Uint32FromInt32(3)) || libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == int32(1) { /* A b-tree rebalance will be required after deleting this entry. ** Save the cursor key. */ *(*int32)(unsafe.Pointer(bp)) = _saveCursorKey(tls, pCur) @@ -57344,14 +54705,13 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { ** balancing the tree following the delete operation easier. */ if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreePrevious(tls, pCur, 0) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) != 0 { return *(*int32)(unsafe.Pointer(bp)) } } /* Save the positions of any other cursors open on this table before ** making any modifications. */ - if int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_Multiple) != 0 { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_Multiple) != 0 { *(*int32)(unsafe.Pointer(bp)) = _saveAllCursors(tls, pBt, (*TBtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur) if *(*int32)(unsafe.Pointer(bp)) != 0 { return *(*int32)(unsafe.Pointer(bp)) @@ -57375,7 +54735,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK } - _dropCell(tls, pPage, iCellIdx, int32((*(*TCellInfo)(unsafe.Pointer(bp + 4))).FnSize), bp) + _dropCell(tls, pPage, iCellIdx, libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp + 4))).FnSize), bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { return *(*int32)(unsafe.Pointer(bp)) } @@ -57397,19 +54757,17 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } else { n = (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno } - pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(int32((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) + pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { return _sqlite3CorruptError(tls, int32(80401)) } - nCell = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) - _ = libc.Int32FromInt32(0) + nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pLeaf)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pPage, iCellIdx, pCell-uintptr(4), nCell+int32(4), pTmp, n) } - _dropCell(tls, pLeaf, int32((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1), nCell, bp) + _dropCell(tls, pLeaf, libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1), nCell, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { return *(*int32)(unsafe.Pointer(bp)) } @@ -57429,9 +54787,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { ** been corrected, so be it. Otherwise, after balancing the leaf node, ** walk the cursor up the tree to the internal node and balance it as ** well. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnFree*int32(3) <= int32((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize)*int32(2) { + if (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnFree*int32(3) <= libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize)*int32(2) { /* Optimization: If the free space is less than 2/3rds of the page, ** then balance() will always be a no-op. No need to invoke it. */ *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -57451,14 +54807,11 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { *(*int32)(unsafe.Pointer(bp)) = _balance(tls, pCur) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if int32(bPreserve) > int32(1) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(bPreserve) > int32(1) { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_SKIPNEXT) - if iCellIdx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + if iCellIdx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext = -int32(1) - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - int32(1)) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) - int32(1)) } else { (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext = int32(1) } @@ -57502,10 +54855,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags var _ /* pgnoRoot at bp+4 */ TPgno var _ /* rc at bp+8 */ int32 _, _ = pBt, ptfFlags - pBt = (*TBtree)(unsafe.Pointer(p)).FpBt /* Page-type flags for the root page of new table */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + pBt = (*TBtree)(unsafe.Pointer(p)).FpBt /* Page-type flags for the root page of new table */ if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { /* The page to move to. */ /* Creating a new table may probably require moving an existing database ** to make room for the new tables root page. In case this page turns @@ -57525,10 +54875,9 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags /* The new root-page may not be allocated on a pointer-map page, or the ** PENDING_BYTE page. */ - for *(*TPgno)(unsafe.Pointer(bp + 4)) == _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4))) || *(*TPgno)(unsafe.Pointer(bp + 4)) == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + for *(*TPgno)(unsafe.Pointer(bp + 4)) == _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4))) || *(*TPgno)(unsafe.Pointer(bp + 4)) == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { *(*TPgno)(unsafe.Pointer(bp + 4))++ } - _ = libc.Int32FromInt32(0) /* Allocate a page. The page that currently resides at pgnoRoot will ** be moved to the allocated page (unless the allocated page happens ** to reside at pgnoRoot). @@ -57560,15 +54909,13 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags return *(*int32)(unsafe.Pointer(bp + 8)) } *(*int32)(unsafe.Pointer(bp + 8)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4)), bp+20, bp+24) - if int32(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_ROOTPAGE) || int32(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_FREEPAGE) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_FREEPAGE) { *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80565)) } if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) return *(*int32)(unsafe.Pointer(bp + 8)) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp + 8)) = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp)), *(*Tu8)(unsafe.Pointer(bp + 20)), *(*TPgno)(unsafe.Pointer(bp + 24)), *(*TPgno)(unsafe.Pointer(bp + 12)), 0) _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) /* Obtain the page at pgnoRoot */ @@ -57597,7 +54944,6 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags ** order either to increase the database filesize, or to decrement the ** freelist count. Hence, the sqlite3BtreeUpdateMeta() call cannot fail. */ - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3BtreeUpdateMeta(tls, p, int32(4), *(*TPgno)(unsafe.Pointer(bp + 4))) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -57609,7 +54955,6 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags return *(*int32)(unsafe.Pointer(bp + 8)) } } - _ = libc.Int32FromInt32(0) if createTabFlags&int32(BTREE_INTKEY) != 0 { ptfFlags = libc.Int32FromInt32(PTF_INTKEY) | libc.Int32FromInt32(PTF_LEAFDATA) | libc.Int32FromInt32(PTF_LEAF) } else { @@ -57617,7 +54962,6 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), ptfFlags) _sqlite3PagerUnref(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) - _ = libc.Int32FromInt32(0) *(*TPgno)(unsafe.Pointer(piTable)) = *(*TPgno)(unsafe.Pointer(bp + 4)) return SQLITE_OK } @@ -57646,7 +54990,6 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* pPage at bp+0 */ uintptr var _ /* rc at bp+4 */ int32 _, _, _, _ = hdr, i, pCell, v2 - _ = libc.Int32FromInt32(0) if pgno > _btreePagecount(tls, pBt) { return _sqlite3CorruptError(tls, int32(80655)) } @@ -57654,17 +54997,17 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { return *(*int32)(unsafe.Pointer(bp + 4)) } - if int32((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { + if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3CorruptError(tls, int32(80662)) goto cleardatabasepage_out } - hdr = int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) i = 0 for { - if !(i < int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnCell)) { + if !(i < libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnCell)) { break } - pCell = (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaCellIdx + uintptr(int32(2)*i)))))) + pCell = (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaCellIdx + uintptr(int32(2)*i)))))) if !((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fleaf != 0) { *(*int32)(unsafe.Pointer(bp + 4)) = _clearDatabasePage(tls, pBt, _sqlite3Get4byte(tls, pCell), int32(1), pnChange) if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { @@ -57695,7 +55038,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int } } if pnChange != 0 { - *(*Ti64)(unsafe.Pointer(pnChange)) += int64((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnCell) + *(*Ti64)(unsafe.Pointer(pnChange)) += libc.Int64FromUint16((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnCell) } if freePageFlag != 0 { _freePage(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+4) @@ -57703,7 +55046,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int v2 = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) *(*int32)(unsafe.Pointer(bp + 4)) = v2 if v2 == 0 { - _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) + _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } goto cleardatabasepage_out @@ -57733,16 +55076,15 @@ func _sqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange ui _, _ = pBt, rc pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) - _ = libc.Int32FromInt32(0) - rc = _saveAllCursors(tls, pBt, uint32(iTable), uintptr(0)) + rc = _saveAllCursors(tls, pBt, libc.Uint32FromInt32(iTable), uintptr(0)) if SQLITE_OK == rc { /* Invalidate all incrblob cursors open on table iTable (assuming iTable ** is the root of a table b-tree - if it is not, the following call is ** a no-op). */ if (*TBtree)(unsafe.Pointer(p)).FhasIncrblobCur != 0 { - _invalidateIncrblobCursors(tls, p, uint32(iTable), 0, int32(1)) + _invalidateIncrblobCursors(tls, p, libc.Uint32FromInt32(iTable), 0, int32(1)) } - rc = _clearDatabasePage(tls, pBt, uint32(iTable), 0, pnChange) + rc = _clearDatabasePage(tls, pBt, libc.Uint32FromInt32(iTable), 0, pnChange) } _sqlite3BtreeLeave(tls, p) return rc @@ -57756,7 +55098,7 @@ func _sqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange ui // ** This routine only work for pCur on an ephemeral table. // */ func _sqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) (r int32) { - return _sqlite3BtreeClearTable(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBtree, int32((*TBtCursor)(unsafe.Pointer(pCur)).FpgnoRoot), uintptr(0)) + return _sqlite3BtreeClearTable(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBtree, libc.Int32FromUint32((*TBtCursor)(unsafe.Pointer(pCur)).FpgnoRoot), uintptr(0)) } // C documentation @@ -57792,13 +55134,10 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r _ = pBt *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iTable > _btreePagecount(tls, pBt) { return _sqlite3CorruptError(tls, int32(80766)) } - *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, int32(iTable), uintptr(0)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { return *(*int32)(unsafe.Pointer(bp)) } @@ -57837,7 +55176,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp)) } - *(*int32)(unsafe.Pointer(piMoved)) = int32(*(*TPgno)(unsafe.Pointer(bp + 8))) + *(*int32)(unsafe.Pointer(piMoved)) = libc.Int32FromUint32(*(*TPgno)(unsafe.Pointer(bp + 8))) } /* Set the new 'max-root-page' value in the database header. This ** is the old value less one, less one more if that happens to @@ -57845,10 +55184,9 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r ** PENDING_BYTE_PAGE. */ *(*TPgno)(unsafe.Pointer(bp + 8))-- - for *(*TPgno)(unsafe.Pointer(bp + 8)) == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) || _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8))) == *(*TPgno)(unsafe.Pointer(bp + 8)) { + for *(*TPgno)(unsafe.Pointer(bp + 8)) == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) || _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8))) == *(*TPgno)(unsafe.Pointer(bp + 8)) { *(*TPgno)(unsafe.Pointer(bp + 8))-- } - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeUpdateMeta(tls, p, int32(4), *(*TPgno)(unsafe.Pointer(bp + 8))) } else { _freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), bp) @@ -57861,7 +55199,7 @@ func _sqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uint var rc int32 _ = rc _sqlite3BtreeEnter(tls, p) - rc = _btreeDropTable(tls, p, uint32(iTable), piMoved) + rc = _btreeDropTable(tls, p, libc.Uint32FromInt32(iTable), piMoved) _sqlite3BtreeLeave(tls, p) return rc } @@ -57893,10 +55231,6 @@ func _sqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if idx == int32(BTREE_DATA_VERSION) { *(*Tu32)(unsafe.Pointer(pMeta)) = _sqlite3PagerDataVersion(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager) + (*TBtree)(unsafe.Pointer(p)).FiBDataVersion } else { @@ -57918,17 +55252,12 @@ func _sqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta Tu32) (r var rc int32 _, _, _ = pBt, pP1, rc pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pP1 = (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage) if rc == SQLITE_OK { _sqlite3Put4byte(tls, pP1+uintptr(int32(36)+idx*int32(4)), iMeta) if idx == int32(BTREE_INCR_VACUUM) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = uint8(iMeta) } } @@ -57967,7 +55296,7 @@ func _sqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if (*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0 || !((*TMemPage)(unsafe.Pointer(pPage)).FintKey != 0) { - nEntry += int64((*TMemPage)(unsafe.Pointer(pPage)).FnCell) + nEntry += libc.Int64FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) } /* pPage is a leaf node. This loop navigates the cursor so that it ** points to the first interior cell that it points to the parent of @@ -57980,7 +55309,7 @@ func _sqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr ** caller. */ if (*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0 { - for cond := true; cond; cond = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) { + for cond := true; cond; cond = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) { if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { /* All pages of the b-tree have been visited. Return successfully. */ *(*Ti64)(unsafe.Pointer(pnEntry)) = nEntry @@ -57994,11 +55323,11 @@ func _sqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr /* Descend to the child node of the cell that the cursor currently ** points at. This is the right-child if (iIdx==pPage->nCell). */ - iIdx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) - if iIdx == int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - rc = _moveToChild(tls, pCur, _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)))) + iIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) + if iIdx == libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { + rc = _moveToChild(tls, pCur, _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)))) } else { - rc = _moveToChild(tls, pCur, _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iIdx)))))))) + rc = _moveToChild(tls, pCur, _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iIdx)))))))) } } /* An error has occurred. Return an error code. */ @@ -58044,7 +55373,6 @@ func _checkProgress(tls *libc.TLS, pCheck uintptr) { (*TIntegrityCk)(unsafe.Pointer(pCheck)).FmxErr = 0 } if (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != 0 { - _ = libc.Int32FromInt32(0) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnStep++ if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnStep%(*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps == uint32(0) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxProgress})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0 { (*TIntegrityCk)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_INTERRUPT) @@ -58079,7 +55407,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) } Xsqlite3_str_vappendf(tls, pCheck+48, zFormat, ap) _ = ap - if int32((*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FaccError) == int32(SQLITE_NOMEM) { + if libc.Int32FromUint8((*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FaccError) == int32(SQLITE_NOMEM) { _checkOom(tls, pCheck) } } @@ -58091,9 +55419,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) // ** corresponds to page iPg is already set. // */ func _getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg TPgno) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - return int32(*(*Tu8)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr(iPg/uint32(8))))) & (int32(1) << (iPg & uint32(0x07))) + return libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr(iPg/uint32(8))))) & (int32(1) << (iPg & uint32(0x07))) } // C documentation @@ -58104,8 +55430,6 @@ func _getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg TPgno) (r int32) { func _setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg TPgno) { var p1 uintptr _ = p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p1 = (*TIntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr(iPg/uint32(8)) *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(1)<<(iPg&libc.Uint32FromInt32(0x07))) } @@ -58157,8 +55481,8 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen _checkAppendMsg(tls, pCheck, __ccgo_ts+4317, libc.VaList(bp+16, iChild)) return } - if int32(*(*Tu8)(unsafe.Pointer(bp))) != int32(eType) || *(*TPgno)(unsafe.Pointer(bp + 4)) != iParent { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4346, libc.VaList(bp+16, iChild, int32(eType), iParent, int32(*(*Tu8)(unsafe.Pointer(bp))), *(*TPgno)(unsafe.Pointer(bp + 4)))) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) != libc.Int32FromUint8(eType) || *(*TPgno)(unsafe.Pointer(bp + 4)) != iParent { + _checkAppendMsg(tls, pCheck, __ccgo_ts+4346, libc.VaList(bp+16, iChild, libc.Int32FromUint8(eType), iParent, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))), *(*TPgno)(unsafe.Pointer(bp + 4)))) } } @@ -58200,7 +55524,7 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } else { i = 0 for { - if !(i < int32(n)) { + if !(i < libc.Int32FromUint32(n)) { break } iFreePage = _sqlite3Get4byte(tls, pOvflData+uintptr(int32(8)+i*int32(4))) @@ -58221,8 +55545,8 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N ** the following page matches iPage. */ if (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 && N > uint32(0) { - i = int32(_sqlite3Get4byte(tls, pOvflData)) - _checkPtrmap(tls, pCheck, uint32(i), uint8(PTRMAP_OVERFLOW2), iPage) + i = libc.Int32FromUint32(_sqlite3Get4byte(tls, pOvflData)) + _checkPtrmap(tls, pCheck, libc.Uint32FromInt32(i), uint8(PTRMAP_OVERFLOW2), iPage) } } iPage = _sqlite3Get4byte(tls, pOvflData) @@ -58266,7 +55590,6 @@ func _btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x Tu32) { var i, j, v1, v3 Tu32 var v2 uintptr _, _, _, _, _ = i, j, v1, v2, v3 - _ = libc.Int32FromInt32(0) v2 = aHeap *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) @@ -58354,7 +55677,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr heap = uintptr(0) prev = uint32(0) /* Next and previous entry on the min-heap */ saved_zPfx = (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx - saved_v1 = int32((*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1) + saved_v1 = libc.Int32FromUint32((*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1) saved_v2 = (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2 savedIsInit = uint8(0) /* Check that the page exists @@ -58389,43 +55712,40 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v2 = _btreeInitPage(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = v2 if v2 != 0 { - _ = libc.Int32FromInt32(0) /* The only possible error from InitPage */ + /* The only possible error from InitPage */ _checkAppendMsg(tls, pCheck, __ccgo_ts+4569, libc.VaList(bp+48, rc)) goto end_of_check } v3 = _btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = v3 if v3 != 0 { - _ = libc.Int32FromInt32(0) _checkAppendMsg(tls, pCheck, __ccgo_ts+4607, libc.VaList(bp+48, rc)) goto end_of_check } data = (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData - hdr = int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FhdrOffset) + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FhdrOffset) /* Set up for cell analysis */ (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4629 - contentOffset = uint32((int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<libc.Int32FromInt32(8)|int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)))-libc.Int32FromInt32(1))&libc.Int32FromInt32(0xffff) + libc.Int32FromInt32(1)) - _ = libc.Int32FromInt32(0) /* Enforced by btreeInitPage() */ + contentOffset = libc.Uint32FromInt32((libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<libc.Int32FromInt32(8)|libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)))-libc.Int32FromInt32(1))&libc.Int32FromInt32(0xffff) + libc.Int32FromInt32(1)) + /* Enforced by btreeInitPage() */ /* EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the ** number of cells on the page. */ - nCell = int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(3)))))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(3)) + 1))) - _ = libc.Int32FromInt32(0) - if (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fleaf != 0 || int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FintKey) == 0 { + nCell = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(3)))))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(3)) + 1))) + if (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fleaf != 0 || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FintKey) == 0 { *(*Ti64)(unsafe.Pointer(pCheck + 80)) += int64(nCell) } /* EVIDENCE-OF: R-23882-45353 The cell pointer array of a b-tree page ** immediately follows the b-tree page header. */ - cellStart = hdr + int32(12) - int32(4)*int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fleaf) - _ = libc.Int32FromInt32(0) + cellStart = hdr + int32(12) - int32(4)*libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fleaf) pCellIdx = data + uintptr(cellStart+int32(2)*(nCell-int32(1))) if !((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fleaf != 0) { /* Analyze the right-child page of internal pages */ - pgno = int32(_sqlite3Get4byte(tls, data+uintptr(hdr+int32(8)))) + pgno = libc.Int32FromUint32(_sqlite3Get4byte(tls, data+uintptr(hdr+int32(8)))) if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4655 - _checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) + _checkPtrmap(tls, pCheck, libc.Uint32FromInt32(pgno), uint8(PTRMAP_BTREE), iPage) } - depth = _checkTreePage(tls, pCheck, uint32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) + depth = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 } else { /* For leaf pages, the coverage check will occur in the same loop @@ -58442,7 +55762,6 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr } /* Check cell size */ (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2 = i - _ = libc.Int32FromInt32(0) pc = uint32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(pCellIdx)))) pCellIdx -= uintptr(2) if pc < contentOffset || pc > usableSize-uint32(4) { @@ -58472,9 +55791,8 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr } /* Check the content overflow list */ if (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnPayload > uint32((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnLocal) { /* First page of the overflow chain */ - _ = libc.Int32FromInt32(0) nPage = ((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnPayload - uint32((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnLocal) + usableSize - uint32(5)) / (usableSize - uint32(4)) - pgnoOvfl = _sqlite3Get4byte(tls, pCell+uintptr(int32((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnSize)-int32(4))) + pgnoOvfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnSize)-int32(4))) if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { _checkPtrmap(tls, pCheck, pgnoOvfl, uint8(PTRMAP_OVERFLOW1), iPage) } @@ -58482,11 +55800,11 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr } if !((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fleaf != 0) { /* Check sanity of left child page for internal pages */ - pgno = int32(_sqlite3Get4byte(tls, pCell)) + pgno = libc.Int32FromUint32(_sqlite3Get4byte(tls, pCell)) if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - _checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) + _checkPtrmap(tls, pCheck, libc.Uint32FromInt32(pgno), uint8(PTRMAP_BTREE), iPage) } - d2 = _checkTreePage(tls, pCheck, uint32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) + d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { _checkAppendMsg(tls, pCheck, __ccgo_ts+4763, 0) @@ -58526,28 +55844,27 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr i-- } } - _ = libc.Int32FromInt32(0) /* Add the freeblocks to the min-heap ** ** EVIDENCE-OF: R-20690-50594 The second field of the b-tree page header ** is the offset of the first freeblock, or zero if there are no ** freeblocks on the page. */ - i = int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(1)) + 1))) + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(1)) + 1))) for i > 0 { - _ = libc.Int32FromInt32(0) /* Enforced by btreeComputeFreeSpace() */ - size1 = int32(*(*Tu8)(unsafe.Pointer(data + uintptr(i+int32(2)))))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(data + uintptr(i+int32(2)) + 1))) - _ = libc.Int32FromInt32(0) /* due to btreeComputeFreeSpace() */ - _btreeHeapInsert(tls, heap, uint32(i)<<libc.Int32FromInt32(16)|uint32(i+size1-libc.Int32FromInt32(1))) + /* Enforced by btreeComputeFreeSpace() */ + size1 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(i+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(i+int32(2)) + 1))) + /* due to btreeComputeFreeSpace() */ + _btreeHeapInsert(tls, heap, libc.Uint32FromInt32(i)<<libc.Int32FromInt32(16)|libc.Uint32FromInt32(i+size1-libc.Int32FromInt32(1))) /* EVIDENCE-OF: R-58208-19414 The first 2 bytes of a freeblock are a ** big-endian integer which is the offset in the b-tree page of the next ** freeblock in the chain, or zero if the freeblock is the last on the ** chain. */ - j = int32(*(*Tu8)(unsafe.Pointer(data + uintptr(i))))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(data + uintptr(i) + 1))) + j = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(i))))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(i) + 1))) /* EVIDENCE-OF: R-06866-39125 Freeblocks are always connected in order of ** increasing offset. */ - _ = libc.Int32FromInt32(0) /* Enforced by btreeComputeFreeSpace() */ - _ = libc.Int32FromInt32(0) /* Enforced by btreeComputeFreeSpace() */ + /* Enforced by btreeComputeFreeSpace() */ + /* Enforced by btreeComputeFreeSpace() */ i = j } /* Analyze the min-heap looking for overlap between cells and/or @@ -58580,8 +55897,8 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** EVIDENCE-OF: R-07161-27322 The one-byte integer at offset 7 gives the ** number of fragmented free bytes within the cell content area. */ - if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4825, libc.VaList(bp+48, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { + _checkAppendMsg(tls, pCheck, __ccgo_ts+4825, libc.VaList(bp+48, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -58592,7 +55909,7 @@ end_of_check: } _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = saved_zPfx - (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = uint32(saved_v1) + (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = libc.Uint32FromInt32(saved_v1) (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2 = saved_v2 return depth + int32(1) } @@ -58636,19 +55953,14 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin savedDbFlags = (*Tsqlite3)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags bPartial = 0 /* True if not checking all btrees */ bCkFreelist = int32(1) /* True to scan the freelist */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* aRoot[0]==0 means this is a partial check */ if *(*TPgno)(unsafe.Pointer(aRoot)) == uint32(0) { - _ = libc.Int32FromInt32(0) bPartial = int32(1) if *(*TPgno)(unsafe.Pointer(aRoot + 1*4)) != uint32(1) { bCkFreelist = 0 } } _sqlite3BtreeEnter(tls, p) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp, 0, uint32(88)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fdb = db (*(*TIntegrityCk)(unsafe.Pointer(bp))).FpBt = pBt @@ -58665,12 +55977,12 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin _checkOom(tls, bp) goto integrity_ck_cleanup } - (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap = _sqlite3PageMalloc(tls, int32((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) + (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap = _sqlite3PageMalloc(tls, libc.Int32FromUint32((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) if (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap == uintptr(0) { _checkOom(tls, bp) goto integrity_ck_cleanup } - i = uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize + libc.Uint32FromInt32(1) + i = libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize + libc.Uint32FromInt32(1) if i <= (*(*TIntegrityCk)(unsafe.Pointer(bp))).FnCkPage { _setPageReferenced(tls, bp, i) } @@ -58688,7 +56000,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin mx = uint32(0) i = uint32(0) for { - if !(int32(i) < nRoot) { + if !(libc.Int32FromUint32(i) < nRoot) { break } if mx < *(*TPgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) { @@ -58712,7 +56024,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin *(*Tu64)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).Fdb + 28)) &= ^libc.Uint64FromInt32(SQLITE_CellSizeCk) i = uint32(0) for { - if !(int32(i) < nRoot && (*(*TIntegrityCk)(unsafe.Pointer(bp))).FmxErr != 0) { + if !(libc.Int32FromUint32(i) < nRoot && (*(*TIntegrityCk)(unsafe.Pointer(bp))).FmxErr != 0) { break } (*(*TIntegrityCk)(unsafe.Pointer(bp))).FnRow = 0 @@ -58723,7 +56035,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fv0 = *(*TPgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) _checkTreePage(tls, bp, *(*TPgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+192, libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) } - _sqlite3MemSetArrayInt64(tls, aCnt, int32(i), (*(*TIntegrityCk)(unsafe.Pointer(bp))).FnRow) + _sqlite3MemSetArrayInt64(tls, aCnt, libc.Int32FromUint32(i), (*(*TIntegrityCk)(unsafe.Pointer(bp))).FnRow) goto _2 _2: ; @@ -58768,7 +56080,6 @@ integrity_ck_cleanup: *(*uintptr)(unsafe.Pointer(pzOut)) = _sqlite3StrAccumFinish(tls, bp+48) } /* Make sure this analysis did not leave any unref() pages. */ - _ = libc.Int32FromInt32(0) _sqlite3BtreeLeave(tls, p) return (*(*TIntegrityCk)(unsafe.Pointer(bp))).Frc } @@ -58783,7 +56094,6 @@ integrity_ck_cleanup: // ** open so it is safe to access without the BtShared mutex. // */ func _sqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) return _sqlite3PagerFilename(tls, (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FpPager, int32(1)) } @@ -58798,7 +56108,6 @@ func _sqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) (r uintptr) { // ** open so it is safe to access without the BtShared mutex. // */ func _sqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) return _sqlite3PagerJournalname(tls, (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FpPager) } @@ -58811,9 +56120,8 @@ func _sqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) (r uintptr) { func _sqlite3BtreeTxnState(tls *libc.TLS, p uintptr) (r int32) { var v1 int32 _ = v1 - _ = libc.Int32FromInt32(0) if p != 0 { - v1 = int32((*TBtree)(unsafe.Pointer(p)).FinTrans) + v1 = libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).FinTrans) } else { v1 = 0 } @@ -58838,7 +56146,7 @@ func _sqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintpt if p != 0 { pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) - if int32((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) != TRANS_NONE { + if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) != TRANS_NONE { rc = int32(SQLITE_LOCKED) } else { rc = _sqlite3PagerCheckpoint(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, (*TBtree)(unsafe.Pointer(p)).Fdb, eMode, pnLog, pnCkpt) @@ -58854,8 +56162,6 @@ func _sqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintpt // ** Return true if there is currently a backup running on Btree p. // */ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return libc.BoolInt32((*TBtree)(unsafe.Pointer(p)).FnBackup != 0) } @@ -58887,7 +56193,7 @@ func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { - (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), uint64(nBytes)) + (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree } _sqlite3BtreeLeave(tls, p) @@ -58904,10 +56210,8 @@ func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) func _sqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) (r int32) { var rc int32 _ = rc - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnter(tls, p) rc = _querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK)) - _ = libc.Int32FromInt32(0) _sqlite3BtreeLeave(tls, p) return rc } @@ -58924,15 +56228,12 @@ func _sqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock Tu var rc int32 _, _ = lockType, rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { - lockType = uint8(int32(READ_LOCK) + int32(isWriteLock)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + lockType = libc.Uint8FromInt32(int32(READ_LOCK) + libc.Int32FromUint8(isWriteLock)) _sqlite3BtreeEnter(tls, p) - rc = _querySharedCacheTableLock(tls, p, uint32(iTab), lockType) + rc = _querySharedCacheTableLock(tls, p, libc.Uint32FromInt32(iTab), lockType) if rc == SQLITE_OK { - rc = _setSharedCacheTableLock(tls, p, uint32(iTab), lockType) + rc = _setSharedCacheTableLock(tls, p, libc.Uint32FromInt32(iTab), lockType) } _sqlite3BtreeLeave(tls, p) } @@ -58954,10 +56255,7 @@ func _sqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock Tu func _sqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset Tu32, amt Tu32, z uintptr) (r int32) { var rc, v1 int32 _, _ = rc, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCsr)).FeState) >= int32(CURSOR_REQUIRESEEK) { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCsr)).FeState) >= int32(CURSOR_REQUIRESEEK) { v1 = _btreeRestoreCursorPosition(tls, pCsr) } else { v1 = SQLITE_OK @@ -58966,8 +56264,7 @@ func _sqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset Tu32, amt Tu32, z if rc != SQLITE_OK { return rc } - _ = libc.Int32FromInt32(0) - if int32((*TBtCursor)(unsafe.Pointer(pCsr)).FeState) != CURSOR_VALID { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCsr)).FeState) != CURSOR_VALID { return int32(SQLITE_ABORT) } /* Save the positions of all other cursors open on this table. This is @@ -58979,7 +56276,6 @@ func _sqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset Tu32, amt Tu32, z ** saveAllCursors can only return SQLITE_OK. */ _saveAllCursors(tls, (*TBtCursor)(unsafe.Pointer(pCsr)).FpBt, (*TBtCursor)(unsafe.Pointer(pCsr)).FpgnoRoot, pCsr) - _ = libc.Int32FromInt32(0) /* Check some assumptions: ** (a) the cursor is open for writing, ** (b) there is a read/write transaction open, @@ -58987,13 +56283,9 @@ func _sqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset Tu32, amt Tu32, z ** (d) there are no conflicting read-locks, and ** (e) the cursor points at a valid row of an intKey table. */ - if int32((*TBtCursor)(unsafe.Pointer(pCsr)).FcurFlags)&int32(BTCF_WriteFlag) == 0 { + if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCsr)).FcurFlags)&int32(BTCF_WriteFlag) == 0 { return int32(SQLITE_READONLY) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return _accessPayload(tls, pCsr, offset, amt, z, int32(1)) } @@ -59022,7 +56314,6 @@ func _sqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) (r i var rc int32 _, _, _, _, _, _ = aData, pBt, rc, p1, p2, p3 pBt = (*TBtree)(unsafe.Pointer(pBtree)).FpBt /* Return code */ - _ = libc.Int32FromInt32(0) /* If setting the version fields to 1, do not automatically open the ** WAL connection, even if the version fields are currently set to 2. */ @@ -59035,13 +56326,13 @@ func _sqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) (r i rc = _sqlite3BtreeBeginTrans(tls, pBtree, 0, uintptr(0)) if rc == SQLITE_OK { aData = (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData - if int32(*(*Tu8)(unsafe.Pointer(aData + 18))) != int32(uint8(iVersion)) || int32(*(*Tu8)(unsafe.Pointer(aData + 19))) != int32(uint8(iVersion)) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + 18))) != libc.Int32FromUint8(libc.Uint8FromInt32(iVersion)) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + 19))) != libc.Int32FromUint8(libc.Uint8FromInt32(iVersion)) { rc = _sqlite3BtreeBeginTrans(tls, pBtree, int32(2), uintptr(0)) if rc == SQLITE_OK { rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage) if rc == SQLITE_OK { - *(*Tu8)(unsafe.Pointer(aData + 18)) = uint8(iVersion) - *(*Tu8)(unsafe.Pointer(aData + 19)) = uint8(iVersion) + *(*Tu8)(unsafe.Pointer(aData + 18)) = libc.Uint8FromInt32(iVersion) + *(*Tu8)(unsafe.Pointer(aData + 19)) = libc.Uint8FromInt32(iVersion) } } } @@ -59067,7 +56358,7 @@ func _sqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) (r int // ** Return true if the given Btree is read-only. // */ func _sqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32(int32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags)&int32(BTS_READ_ONLY) != 0) + return libc.BoolInt32(libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags)&int32(BTS_READ_ONLY) != 0) } // C documentation @@ -59076,7 +56367,7 @@ func _sqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) (r int32) { // ** Return the size of the header added to each page by this module. // */ func _sqlite3HeaderSizeBtree(tls *libc.TLS) (r int32) { - return int32((libc.Uint32FromInt64(84) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + return libc.Int32FromUint32((libc.Uint32FromInt64(84) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) } // C documentation @@ -59089,7 +56380,7 @@ func _sqlite3BtreeClearCache(tls *libc.TLS, p uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt - if int32((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE { + if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE { _sqlite3PagerClearCache(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager) } } @@ -59100,7 +56391,7 @@ func _sqlite3BtreeClearCache(tls *libc.TLS, p uintptr) { // ** Return true if the Btree passed as the only argument is sharable. // */ func _sqlite3BtreeSharable(tls *libc.TLS, p uintptr) (r int32) { - return int32((*TBtree)(unsafe.Pointer(p)).Fsharable) + return libc.Int32FromUint8((*TBtree)(unsafe.Pointer(p)).Fsharable) } // C documentation @@ -59349,14 +56640,8 @@ func _backupOnePage(tls *libc.TLS, p uintptr, iSrcPg TPgno, zSrcData uintptr, bU v1 = nDestPgsz } nCopy = v1 - iEnd = int64(iSrcPg) * int64(nSrcPgsz) + iEnd = libc.Int64FromUint32(iSrcPg) * int64(nSrcPgsz) rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* This loop runs once for each destination page spanned by the source ** page. For each iteration, variable iOff is set to the byte offset ** of the destination page. @@ -59367,8 +56652,8 @@ func _backupOnePage(tls *libc.TLS, p uintptr, iSrcPg TPgno, zSrcData uintptr, bU break } *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - iDest = uint32(iOff/int64(nDestPgsz)) + uint32(1) - if iDest == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1) { + iDest = libc.Uint32FromInt64(iOff/int64(nDestPgsz)) + uint32(1) + if iDest == libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1) { goto _2 } v3 = _sqlite3PagerGet(tls, pDestPager, iDest, bp, 0) @@ -59388,7 +56673,7 @@ func _backupOnePage(tls *libc.TLS, p uintptr, iSrcPg TPgno, zSrcData uintptr, bU ** cached parse of the page). MemPage.isInit is marked ** "MUST BE FIRST" for this purpose. */ - libc.Xmemcpy(tls, zOut, zIn, uint32(nCopy)) + libc.Xmemcpy(tls, zOut, zIn, libc.Uint32FromInt32(nCopy)) *(*Tu8)(unsafe.Pointer(_sqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp))))) = uint8(0) if iOff == 0 && bUpdate == 0 { _sqlite3Put4byte(tls, zOut+28, _sqlite3BtreeLastPage(tls, (*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc)) @@ -59435,7 +56720,6 @@ func _backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize Ti64) (r int32) { func _attachBackupObject(tls *libc.TLS, p uintptr) { var pp uintptr _ = pp - _ = libc.Int32FromInt32(0) pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc)) (*Tsqlite3_backup)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp)) *(*uintptr)(unsafe.Pointer(pp)) = p @@ -59477,7 +56761,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { /* If the source pager is currently in a write-transaction, return ** SQLITE_BUSY immediately. */ - if (*Tsqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 && int32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FinTransaction) == int32(TRANS_WRITE) { + if (*Tsqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 && libc.Int32FromUint8((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FinTransaction) == int32(TRANS_WRITE) { rc = int32(SQLITE_BUSY) } else { rc = SQLITE_OK @@ -59518,15 +56802,14 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { /* Now that there is a read-lock on the source database, query the ** source pager for the number of pages in the database. */ - nSrcPage = int32(_sqlite3BtreeLastPage(tls, (*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc)) - _ = libc.Int32FromInt32(0) + nSrcPage = libc.Int32FromUint32(_sqlite3BtreeLastPage(tls, (*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc)) ii = 0 for { - if !((nPage < 0 || ii < nPage) && (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext <= uint32(nSrcPage) && !(rc != 0)) { + if !((nPage < 0 || ii < nPage) && (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext <= libc.Uint32FromInt32(nSrcPage) && !(rc != 0)) { break } - iSrcPg = (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext /* Source page number */ - if iSrcPg != uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FpageSize+libc.Uint32FromInt32(1) { /* Source page object */ + iSrcPg = (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext /* Source page number */ + if iSrcPg != libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FpageSize+libc.Uint32FromInt32(1) { /* Source page object */ rc = _sqlite3PagerGet(tls, pSrcPager, iSrcPg, bp, int32(PAGER_GET_READONLY)) if rc == SQLITE_OK { rc = _backupOnePage(tls, p, iSrcPg, _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))), 0) @@ -59540,9 +56823,9 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { ii++ } if rc == SQLITE_OK { - (*Tsqlite3_backup)(unsafe.Pointer(p)).FnPagecount = uint32(nSrcPage) - (*Tsqlite3_backup)(unsafe.Pointer(p)).FnRemaining = uint32(nSrcPage+int32(1)) - (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext - if (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext > uint32(nSrcPage) { + (*Tsqlite3_backup)(unsafe.Pointer(p)).FnPagecount = libc.Uint32FromInt32(nSrcPage) + (*Tsqlite3_backup)(unsafe.Pointer(p)).FnRemaining = libc.Uint32FromInt32(nSrcPage+int32(1)) - (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext + if (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext > libc.Uint32FromInt32(nSrcPage) { rc = int32(SQLITE_DONE) } else { if !((*Tsqlite3_backup)(unsafe.Pointer(p)).FisAttached != 0) { @@ -59584,18 +56867,15 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { ** journalled by PagerCommitPhaseOne() before they are destroyed ** by the file truncation. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pgszSrc < pgszDest { ratio = pgszDest / pgszSrc nDestTruncate = (nSrcPage + ratio - int32(1)) / ratio - if nDestTruncate == int32(uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1)) { + if nDestTruncate == libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1)) { nDestTruncate-- } } else { nDestTruncate = nSrcPage * (pgszSrc / pgszDest) } - _ = libc.Int32FromInt32(0) if pgszSrc < pgszDest { /* If the source page-size is smaller than the destination page-size, ** two extra things may need to happen: @@ -59608,8 +56888,6 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { */ iSize = int64(pgszSrc) * int64(nSrcPage) pFile = _sqlite3PagerFile(tls, pDestPager) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* This block ensures that all data required to recreate the original ** database has been stored in the journal for pDestPager and the ** journal synced to disk. So at this point we may safely modify @@ -59617,12 +56895,12 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { ** occurs, the original database will be reconstructed from the ** journal file. */ _sqlite3PagerPagecount(tls, pDestPager, bp+4) - iPg = uint32(nDestTruncate) + iPg = libc.Uint32FromInt32(nDestTruncate) for { - if !(rc == SQLITE_OK && iPg <= uint32(*(*int32)(unsafe.Pointer(bp + 4)))) { + if !(rc == SQLITE_OK && iPg <= libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) { break } - if iPg != uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1) { + if iPg != libc.Uint32FromInt32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1) { rc = _sqlite3PagerGet(tls, pDestPager, iPg, bp+8, 0) if rc == SQLITE_OK { rc = _sqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -59650,7 +56928,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { break } *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) - iSrcPg1 = uint32(iOff/int64(pgszSrc) + libc.Int64FromInt32(1)) + iSrcPg1 = libc.Uint32FromInt64(iOff/int64(pgszSrc) + libc.Int64FromInt32(1)) rc = _sqlite3PagerGet(tls, pSrcPager, iSrcPg1, bp+12, 0) if rc == SQLITE_OK { zData = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) @@ -59670,7 +56948,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { rc = _sqlite3PagerSync(tls, pDestPager, uintptr(0)) } } else { - _sqlite3PagerTruncateImage(tls, pDestPager, uint32(nDestTruncate)) + _sqlite3PagerTruncateImage(tls, pDestPager, libc.Uint32FromInt32(nDestTruncate)) rc = _sqlite3PagerCommitPhaseOne(tls, pDestPager, uintptr(0), 0) } /* Finish committing the transaction to the destination database. */ @@ -59691,7 +56969,6 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { if bCloseTrans != 0 { _sqlite3BtreeCommitPhaseOne(tls, (*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc, uintptr(0)) _sqlite3BtreeCommitPhaseTwo(tls, (*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc, 0) - _ = libc.Int32FromInt32(0) } if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) { rc = int32(SQLITE_NOMEM) @@ -59731,10 +57008,8 @@ func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3_backup)(unsafe.Pointer(p)).FisAttached != 0 { pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*Tsqlite3_backup)(unsafe.Pointer(p)).FpSrc)) - _ = libc.Int32FromInt32(0) for *(*uintptr)(unsafe.Pointer(pp)) != p { pp = *(*uintptr)(unsafe.Pointer(pp)) + 44 - _ = libc.Int32FromInt32(0) } *(*uintptr)(unsafe.Pointer(pp)) = (*Tsqlite3_backup)(unsafe.Pointer(p)).FpNext } @@ -59770,7 +57045,7 @@ func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) (r int32) { // ** call to sqlite3_backup_step(). // */ func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) (r int32) { - return int32((*Tsqlite3_backup)(unsafe.Pointer(p)).FnRemaining) + return libc.Int32FromUint32((*Tsqlite3_backup)(unsafe.Pointer(p)).FnRemaining) } // C documentation @@ -59780,7 +57055,7 @@ func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) (r int32) { // ** recent call to sqlite3_backup_step(). // */ func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) (r int32) { - return int32((*Tsqlite3_backup)(unsafe.Pointer(p)).FnPagecount) + return libc.Int32FromUint32((*Tsqlite3_backup)(unsafe.Pointer(p)).FnPagecount) } // C documentation @@ -59801,15 +57076,11 @@ func _backupUpdate(tls *libc.TLS, p uintptr, iPage TPgno, aData uintptr) { var rc int32 var v1 uintptr _, _ = rc, v1 - _ = libc.Int32FromInt32(0) for { - _ = libc.Int32FromInt32(0) if !(_isFatalError(tls, (*Tsqlite3_backup)(unsafe.Pointer(p)).Frc) != 0) && iPage < (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext { - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDestDb)).Fmutex) rc = _backupOnePage(tls, p, iPage, aData, int32(1)) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDestDb)).Fmutex) - _ = libc.Int32FromInt32(0) if rc != SQLITE_OK { (*Tsqlite3_backup)(unsafe.Pointer(p)).Frc = rc } @@ -59852,7 +57123,6 @@ func _sqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { if !(p != 0) { break } - _ = libc.Int32FromInt32(0) (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext = uint32(1) goto _1 _1: @@ -59881,10 +57151,9 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) _, _, _ = pFd, rc, p1 _sqlite3BtreeEnter(tls, pTo) _sqlite3BtreeEnter(tls, pFrom) - _ = libc.Int32FromInt32(0) pFd = _sqlite3PagerFile(tls, _sqlite3BtreePager(tls, pTo)) if (*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods != 0 { - *(*Ti64)(unsafe.Pointer(bp + 48)) = int64(_sqlite3BtreeGetPageSize(tls, pFrom)) * int64(_sqlite3BtreeLastPage(tls, pFrom)) + *(*Ti64)(unsafe.Pointer(bp + 48)) = int64(_sqlite3BtreeGetPageSize(tls, pFrom)) * libc.Int64FromUint32(_sqlite3BtreeLastPage(tls, pFrom)) rc = _sqlite3OsFileControl(tls, pFd, int32(SQLITE_FCNTL_OVERWRITE), bp+48) if rc == int32(SQLITE_NOTFOUND) { rc = SQLITE_OK @@ -59910,7 +57179,6 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) ** checks this assumption - (p->rc) should be set to either SQLITE_DONE ** or an error code. */ Xsqlite3_backup_step(tls, bp, int32(0x7FFFFFFF)) - _ = libc.Int32FromInt32(0) rc = Xsqlite3_backup_finish(tls, bp) if rc == SQLITE_OK { p1 = (*TBtree)(unsafe.Pointer(pTo)).FpBt + 24 @@ -59918,7 +57186,6 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) } else { _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } - _ = libc.Int32FromInt32(0) goto copy_finished copy_finished: ; @@ -59966,23 +57233,19 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { var _ /* acc at bp+0 */ TStrAccum var _ /* x at bp+24 */ Ti64 _ = v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Int) != 0 { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, bp+24, p, uint32(int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Int)*int32(2))) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Int) != 0 { + libc.Xmemcpy(tls, bp+24, p, libc.Uint32FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Int)*int32(2))) (*TMem)(unsafe.Pointer(p)).Fn = _sqlite3Int64ToText(tls, *(*Ti64)(unsafe.Pointer(bp + 24)), zBuf) } else { _sqlite3StrAccumInit(tls, bp, uintptr(0), zBuf, sz, 0) - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_IntReal) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_IntReal) != 0 { v1 = float64(*(*Ti64)(unsafe.Pointer(p))) } else { v1 = *(*float64)(unsafe.Pointer(p)) } Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5131, libc.VaList(bp+40, v1)) - _ = libc.Int32FromInt32(0) *(*int8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = 0 /* Fast version of sqlite3StrAccumFinish(&acc) */ - (*TMem)(unsafe.Pointer(p)).Fn = int32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) + (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } } @@ -60004,24 +57267,17 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { func _sqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) (r int32) { var rc int32 _ = rc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if !(int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&libc.Int32FromInt32(MEM_Str) != 0) { - (*TMem)(unsafe.Pointer(pMem)).Fenc = uint8(desiredEnc) + if !(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&libc.Int32FromInt32(MEM_Str) != 0) { + (*TMem)(unsafe.Pointer(pMem)).Fenc = libc.Uint8FromInt32(desiredEnc) return SQLITE_OK } - if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) == desiredEnc { + if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) == desiredEnc { return SQLITE_OK } - _ = libc.Int32FromInt32(0) /* MemTranslate() may return SQLITE_OK or SQLITE_NOMEM. If NOMEM is returned, ** then the encoding of the value may not have changed. */ - rc = _sqlite3VdbeMemTranslate(tls, pMem, uint8(desiredEnc)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + rc = _sqlite3VdbeMemTranslate(tls, pMem, libc.Uint8FromInt32(desiredEnc)) return rc } @@ -60038,19 +57294,15 @@ func _sqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) ( func _sqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) (r int32) { var v1, p2 uintptr _, _ = v1, p2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the bPreserve flag is set to true, then the memory cell must already ** contain a valid string or blob value. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 && bPreserve != 0 && (*TMem)(unsafe.Pointer(pMem)).Fz == (*TMem)(unsafe.Pointer(pMem)).FzMalloc { if (*TMem)(unsafe.Pointer(pMem)).Fdb != 0 { - v1 = _sqlite3DbReallocOrFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz, uint64(n)) + v1 = _sqlite3DbReallocOrFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz, libc.Uint64FromInt32(n)) (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = v1 } else { - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = _sqlite3Realloc(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, uint64(n)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = _sqlite3Realloc(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, libc.Uint64FromInt32(n)) if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { Xsqlite3_free(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) } @@ -60061,7 +57313,7 @@ func _sqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(n)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(n)) } if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { _sqlite3VdbeMemSetNull(tls, pMem) @@ -60072,11 +57324,9 @@ func _sqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } if bPreserve != 0 && (*TMem)(unsafe.Pointer(pMem)).Fz != 0 { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pMem)).FzMalloc, (*TMem)(unsafe.Pointer(pMem)).Fz, uint32((*TMem)(unsafe.Pointer(pMem)).Fn)) + libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pMem)).FzMalloc, (*TMem)(unsafe.Pointer(pMem)).Fz, libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn)) } - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMem)(unsafe.Pointer(pMem)).FxDel})))(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) } (*TMem)(unsafe.Pointer(pMem)).Fz = (*TMem)(unsafe.Pointer(pMem)).FzMalloc @@ -60103,12 +57353,9 @@ func _sqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) func _sqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) (r int32) { var p1 uintptr _ = p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < szNew { return _sqlite3VdbeMemGrow(tls, pMem, szNew, 0) } - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pMem)).Fz = (*TMem)(unsafe.Pointer(pMem)).FzMalloc p1 = pMem + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & (libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal))) @@ -60127,18 +57374,18 @@ func _sqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) (r func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { var p1, p2, p3 uintptr _, _, _ = p1, p2, p3 - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term)|libc.Int32FromInt32(MEM_Ephem)|libc.Int32FromInt32(MEM_Static)) != int32(MEM_Str) { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term)|libc.Int32FromInt32(MEM_Ephem)|libc.Int32FromInt32(MEM_Static)) != int32(MEM_Str) { /* pMem must be a string, and it cannot be an ephemeral or static string */ return } - if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { + if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { return } - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { - if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= uint64((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { + if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = 0 p1 = pMem + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Term)) @@ -60197,11 +57444,8 @@ func _sqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) (r int32) { var rc, v1 int32 var p2 uintptr _, _, _ = rc, v1, p2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Zero) != 0 { v1 = _sqlite3VdbeMemExpandBlob(tls, pMem) } else { v1 = 0 @@ -60231,15 +57475,10 @@ func _sqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) (r int32) { var nByte int32 var p1 uintptr _, _ = nByte, p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Set nByte to the number of bytes required to store the expanded blob. */ nByte = (*TMem)(unsafe.Pointer(pMem)).Fn + *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)) if nByte <= 0 { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Blob) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Blob) == 0 { return SQLITE_OK } nByte = int32(1) @@ -60247,9 +57486,7 @@ func _sqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) (r int32) { if _sqlite3VdbeMemGrow(tls, pMem, nByte, int32(1)) != 0 { return int32(SQLITE_NOMEM) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - libc.Xmemset(tls, (*TMem)(unsafe.Pointer(pMem)).Fz+uintptr((*TMem)(unsafe.Pointer(pMem)).Fn), 0, uint32(*(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)))) + libc.Xmemset(tls, (*TMem)(unsafe.Pointer(pMem)).Fz+uintptr((*TMem)(unsafe.Pointer(pMem)).Fn), 0, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)))) *(*int32)(unsafe.Pointer(pMem + 12)) += *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)) p1 = pMem + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(MEM_Zero) | libc.Int32FromInt32(MEM_Term))) @@ -60262,9 +57499,7 @@ func _sqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) (r int32) { // ** Make sure the given Mem is \u0000 terminated. // */ func _sqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Term)|libc.Int32FromInt32(MEM_Str)) != int32(MEM_Str) { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Term)|libc.Int32FromInt32(MEM_Str)) != int32(MEM_Str) { return SQLITE_OK /* Nothing to do */ } else { return _vdbeMemAddTerminator(tls, pMem) @@ -60293,20 +57528,11 @@ func _sqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc Tu8, bForce Tu8) var p1, p2 uintptr _, _, _ = nByte, p1, p2 nByte = int32(32) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _sqlite3VdbeMemClearAndResize(tls, pMem, nByte) != 0 { (*TMem)(unsafe.Pointer(pMem)).Fenc = uint8(0) return int32(SQLITE_NOMEM) } _vdbeMemRenderNum(tls, nByte, (*TMem)(unsafe.Pointer(pMem)).Fz, pMem) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pMem)).Fenc = uint8(SQLITE_UTF8) p1 = pMem + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | (libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Term))) @@ -60314,7 +57540,7 @@ func _sqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc Tu8, bForce Tu8) p2 = pMem + 16 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) & ^(libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal))) } - _sqlite3VdbeChangeEncoding(tls, pMem, int32(enc)) + _sqlite3VdbeChangeEncoding(tls, pMem, libc.Int32FromUint8(enc)) return SQLITE_OK } @@ -60333,12 +57559,6 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 defer tls.Free(80) var _ /* ctx at bp+0 */ Tsqlite3_context var _ /* t at bp+32 */ TMem - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp, 0, uint32(32)) libc.Xmemset(tls, bp+32, 0, uint32(40)) (*(*TMem)(unsafe.Pointer(bp + 32))).Fflags = uint16(MEM_Null) @@ -60348,7 +57568,6 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 32))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ - _ = libc.Int32FromInt32(0) if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } @@ -60370,11 +57589,6 @@ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc bp := tls.Alloc(32) defer tls.Free(32) var _ /* ctx at bp+0 */ Tsqlite3_context - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp, 0, uint32(32)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut @@ -60397,14 +57611,10 @@ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc // ** entry point for releasing Mem resources. // */ func _vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Agg) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Agg) != 0 { _sqlite3VdbeMemFinalize(tls, p, *(*uintptr)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(p)).Fu))) - _ = libc.Int32FromInt32(0) } - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Dyn) != 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Dyn) != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMem)(unsafe.Pointer(p)).FxDel})))(tls, (*TMem)(unsafe.Pointer(p)).Fz) } (*TMem)(unsafe.Pointer(p)).Fflags = uint16(MEM_Null) @@ -60421,7 +57631,7 @@ func _vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { // ** to be freed. // */ func _vdbeMemClear(tls *libc.TLS, p uintptr) { - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { _vdbeMemClearExternAndSetNull(tls, p) } if (*TMem)(unsafe.Pointer(p)).FszMalloc != 0 { @@ -60444,8 +57654,7 @@ func _vdbeMemClear(tls *libc.TLS, p uintptr) { // ** prior to inserting new content into the Mem. // */ func _sqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 || (*TMem)(unsafe.Pointer(p)).FszMalloc != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 || (*TMem)(unsafe.Pointer(p)).FszMalloc != 0 { _vdbeMemClear(tls, p) } } @@ -60456,7 +57665,6 @@ func _sqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { // ** know in advance that the Mem is not MEM_Dyn or MEM_Agg. // */ func _sqlite3VdbeMemReleaseMalloc(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) if (*TMem)(unsafe.Pointer(p)).FszMalloc != 0 { _vdbeMemClear(tls, p) } @@ -60487,10 +57695,7 @@ func _memIntValue(tls *libc.TLS, pMem uintptr) (r Ti64) { func _sqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) (r Ti64) { var flags int32 _ = flags - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - flags = int32((*TMem)(unsafe.Pointer(pMem)).Fflags) + flags = libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) if flags&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { return *(*Ti64)(unsafe.Pointer(pMem)) } else { @@ -60526,16 +57731,13 @@ func _memRealValue(tls *libc.TLS, pMem uintptr) (r float64) { } func _sqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) (r float64) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { return *(*float64)(unsafe.Pointer(pMem)) } else { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { return float64(*(*Ti64)(unsafe.Pointer(pMem))) } else { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { return _memRealValue(tls, pMem) } else { /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ @@ -60553,10 +57755,10 @@ func _sqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) (r float64) { // ** Return the value ifNull if pMem is NULL. // */ func _sqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) (r int32) { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { return libc.BoolInt32(*(*Ti64)(unsafe.Pointer(pMem)) != 0) } - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { return ifNull } return libc.BoolInt32(_sqlite3VdbeRealValue(tls, pMem) != float64(0)) @@ -60571,13 +57773,8 @@ func _sqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) (r int3 func _sqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { var ix Ti64 _ = ix - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_IntReal) != 0 { - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_IntReal) != 0 { + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) } else { ix = _sqlite3RealToI64(tls, *(*float64)(unsafe.Pointer(pMem))) /* Only mark the value as an integer if @@ -60592,7 +57789,7 @@ func _sqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { */ if *(*float64)(unsafe.Pointer(pMem)) == float64(ix) && ix > int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) && ix < libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32) { *(*Ti64)(unsafe.Pointer(pMem)) = ix - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) } } } @@ -60603,12 +57800,8 @@ func _sqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { // ** Convert pMem to type integer. Invalidate any prior representations. // */ func _sqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer(pMem)) = _sqlite3VdbeIntValue(tls, pMem) - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) return SQLITE_OK } @@ -60619,11 +57812,8 @@ func _sqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) (r int32) { // ** Invalidate any prior representations. // */ func _sqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*float64)(unsafe.Pointer(pMem)) = _sqlite3VdbeRealValue(tls, pMem) - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Real)) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Real)) return SQLITE_OK } @@ -60682,10 +57872,7 @@ func _sqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) (r int32) { var p3 uintptr var _ /* ix at bp+0 */ Tsqlite3_int64 _, _, _, _ = rc, v1, v2, p3 - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Null)) == 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Null)) == 0 { rc = _sqlite3AtoF(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, pMem, (*TMem)(unsafe.Pointer(pMem)).Fn, (*TMem)(unsafe.Pointer(pMem)).Fenc) if v2 = (rc == 0 || rc == int32(1)) && _sqlite3Atoi64(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, bp, (*TMem)(unsafe.Pointer(pMem)).Fn, (*TMem)(unsafe.Pointer(pMem)).Fenc) <= int32(1); !v2 { v1 = _sqlite3RealToI64(tls, *(*float64)(unsafe.Pointer(pMem))) @@ -60693,12 +57880,11 @@ func _sqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) (r int32) { } if v2 || _sqlite3RealSameAsInt(tls, *(*float64)(unsafe.Pointer(pMem)), v1) != 0 { *(*Ti64)(unsafe.Pointer(pMem)) = *(*Tsqlite3_int64)(unsafe.Pointer(bp)) - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) } else { - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Real)) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Real)) } } - _ = libc.Int32FromInt32(0) p3 = pMem + 16 *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Zero))) return SQLITE_OK @@ -60717,16 +57903,15 @@ func _sqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff Tu8, encoding Tu8) (r var rc int32 var p1, p2, p3 uintptr _, _, _, _ = rc, p1, p2, p3 - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { return SQLITE_OK } - switch int32(aff) { + switch libc.Int32FromUint8(aff) { case int32(SQLITE_AFF_BLOB): /* Really a cast to BLOB */ - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Blob) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Blob) == 0 { _sqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Blob)) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Blob)) } } else { p1 = pMem + 16 @@ -60739,18 +57924,15 @@ func _sqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff Tu8, encoding Tu8) (r case int32(SQLITE_AFF_REAL): _sqlite3VdbeMemRealify(tls, pMem) default: - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p2 = pMem + 16 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&libc.Int32FromInt32(MEM_Blob)>>libc.Int32FromInt32(3)) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&libc.Int32FromInt32(MEM_Blob)>>libc.Int32FromInt32(3)) _sqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) - _ = libc.Int32FromInt32(0) p3 = pMem + 16 *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal) | libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Zero))) - if int32(encoding) != int32(SQLITE_UTF8) { + if libc.Int32FromUint8(encoding) != int32(SQLITE_UTF8) { *(*int32)(unsafe.Pointer(pMem + 12)) &= ^libc.Int32FromInt32(1) } - rc = _sqlite3VdbeChangeEncoding(tls, pMem, int32(encoding)) + rc = _sqlite3VdbeChangeEncoding(tls, pMem, libc.Int32FromUint8(encoding)) if rc != 0 { return rc } @@ -60767,7 +57949,6 @@ func _sqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff Tu8, encoding Tu8) (r // ** The minimum amount of initialization feasible is performed. // */ func _sqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags Tu16) { - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pMem)).Fflags = flags (*TMem)(unsafe.Pointer(pMem)).Fdb = db (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 @@ -60788,7 +57969,7 @@ func _sqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags Tu16) { // ** Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it. // */ func _sqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { _vdbeMemClearExternAndSetNull(tls, pMem) } else { (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) @@ -60807,7 +57988,7 @@ func _sqlite3ValueSetNull(tls *libc.TLS, p uintptr) { // */ func _sqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { _sqlite3VdbeMemRelease(tls, pMem) - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Zero)) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Zero)) (*TMem)(unsafe.Pointer(pMem)).Fn = 0 if n < 0 { n = 0 @@ -60837,7 +58018,7 @@ func _vdbeReleaseAndSetInt64(tls *libc.TLS, pMem uintptr, val Ti64) { // ** manifest type INTEGER. // */ func _sqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val Ti64) { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { _vdbeReleaseAndSetInt64(tls, pMem, val) } else { *(*Ti64)(unsafe.Pointer(pMem)) = val @@ -60870,7 +58051,6 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 - _ = libc.Int32FromInt32(0) _vdbeMemClear(tls, pMem) if zPType != 0 { v1 = zPType @@ -60879,7 +58059,7 @@ func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType } *(*uintptr)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') if xDestructor != 0 { v2 = xDestructor @@ -60916,15 +58096,13 @@ func _sqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) (r int32) { var db, p uintptr _, _ = db, p db = (*TMem)(unsafe.Pointer(pMem)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemRelease(tls, pMem) p = _sqlite3RowSetInit(tls, db) if p == uintptr(0) { return int32(SQLITE_NOMEM) } (*TMem)(unsafe.Pointer(pMem)).Fz = p - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp(_sqlite3RowSetDelete) return SQLITE_OK } @@ -60938,10 +58116,9 @@ func _sqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) (r int32) { func _sqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) (r int32) { var n int32 _ = n - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { n = (*TMem)(unsafe.Pointer(p)).Fn - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Zero) != 0 { n += *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(p)).Fu)) } return libc.BoolInt32(n > *(*int32)(unsafe.Pointer((*TMem)(unsafe.Pointer(p)).Fdb + 116))) @@ -60959,24 +58136,20 @@ func _sqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) (r int32) { // */ func _vdbeClrCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, eType int32) { _vdbeMemClearExternAndSetNull(tls, pTo) - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemShallowCopy(tls, pTo, pFrom, eType) } func _sqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32) { var p1, p2 uintptr _, _ = p1, p2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pTo)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pTo)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { _vdbeClrCopy(tls, pTo, pFrom, srcType) return } libc.Xmemcpy(tls, pTo, pFrom, uint32(libc.UintptrFromInt32(0)+20)) - if int32((*TMem)(unsafe.Pointer(pFrom)).Fflags)&int32(MEM_Static) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pFrom)).Fflags)&int32(MEM_Static) == 0 { p1 = pTo + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Static) | libc.Int32FromInt32(MEM_Ephem))) - _ = libc.Int32FromInt32(0) p2 = pTo + 16 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | srcType) } @@ -60993,15 +58166,14 @@ func _sqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) { var p1, p2 uintptr _, _, _ = rc, p1, p2 rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pTo)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pTo)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { _vdbeMemClearExternAndSetNull(tls, pTo) } libc.Xmemcpy(tls, pTo, pFrom, uint32(libc.UintptrFromInt32(0)+20)) p1 = pTo + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(MEM_Dyn)) - if int32((*TMem)(unsafe.Pointer(pTo)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { - if 0 == int32((*TMem)(unsafe.Pointer(pFrom)).Fflags)&int32(MEM_Static) { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pTo)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { + if 0 == libc.Int32FromUint16((*TMem)(unsafe.Pointer(pFrom)).Fflags)&int32(MEM_Static) { p2 = pTo + 16 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(MEM_Ephem)) rc = _sqlite3VdbeMemMakeWriteable(tls, pTo) @@ -61019,9 +58191,6 @@ func _sqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) { // ** pFrom contains an SQL NULL when this routine returns. // */ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemRelease(tls, pTo) libc.Xmemcpy(tls, pTo, pFrom, uint32(40)) (*TMem)(unsafe.Pointer(pFrom)).Fflags = uint16(MEM_Null) @@ -61059,10 +58228,6 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T var v3 int64 _, _, _, _, _, _, _ = flags, iLimit, nAlloc, nByte, v2, v3, v4 nByte = n /* New value for pMem->flags */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If z is a NULL pointer, set pMem to contain an SQL NULL. */ if !(z != 0) { _sqlite3VdbeMemSetNull(tls, pMem) @@ -61074,9 +58239,8 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T iLimit = int32(SQLITE_MAX_LENGTH) } if nByte < 0 { - _ = libc.Int32FromInt32(0) - if int32(enc) == int32(SQLITE_UTF8) { - nByte = int64(libc.Xstrlen(tls, z)) + if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { + nByte = libc.Int64FromUint32(libc.Xstrlen(tls, z)) } else { nByte = 0 for { @@ -61089,9 +58253,9 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T nByte += int64(2) } } - flags = uint16(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Term)) + flags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Term)) } else { - if int32(enc) == 0 { + if libc.Int32FromUint8(enc) == 0 { flags = uint16(MEM_Blob) enc = uint8(SQLITE_UTF8) } else { @@ -61115,8 +58279,8 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T */ if xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte - if int32(flags)&int32(MEM_Term) != 0 { - if int32(enc) == int32(SQLITE_UTF8) { + if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { + if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { v2 = int32(1) } else { v2 = int32(2) @@ -61131,7 +58295,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T if _sqlite3VdbeMemClearAndResize(tls, pMem, int32(v3)) != 0 { return int32(SQLITE_NOMEM) } - libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, z, uint32(nAlloc)) + libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, z, libc.Uint32FromInt64(nAlloc)) } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z @@ -61151,7 +58315,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T (*TMem)(unsafe.Pointer(pMem)).Fn = int32(nByte & libc.Int64FromInt32(0x7fffffff)) (*TMem)(unsafe.Pointer(pMem)).Fflags = flags (*TMem)(unsafe.Pointer(pMem)).Fenc = enc - if int32(enc) > int32(SQLITE_UTF8) && _sqlite3VdbeMemHandleBom(tls, pMem) != 0 { + if libc.Int32FromUint8(enc) > int32(SQLITE_UTF8) && _sqlite3VdbeMemHandleBom(tls, pMem) != 0 { return int32(SQLITE_NOMEM) } return SQLITE_OK @@ -61178,17 +58342,17 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 var rc, v1 int32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) - if _sqlite3BtreeMaxRecordSize(tls, pCur) < int64(offset+amt) { + if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { return _sqlite3CorruptError(tls, int32(84060)) } - v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, int32(amt+uint32(1))) + v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 if SQLITE_OK == v1 { rc = _sqlite3BtreePayload(tls, pCur, offset, amt, (*TMem)(unsafe.Pointer(pMem)).Fz) if rc == SQLITE_OK { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(amt))) = 0 /* Overrun area used when reading malformed records */ (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Blob) - (*TMem)(unsafe.Pointer(pMem)).Fn = int32(amt) + (*TMem)(unsafe.Pointer(pMem)).Fn = libc.Int32FromUint32(amt) } else { _sqlite3VdbeMemRelease(tls, pMem) } @@ -61204,16 +58368,12 @@ func _sqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt Tu32, p _ = rc *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) /* Number of bytes available on the local btree page */ rc = SQLITE_OK /* Return code */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Note: the calls to BtreeKeyFetch() and DataFetch() below assert() ** that both the BtShared and database handle mutexes are held. */ - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pMem)).Fz = _sqlite3BtreePayloadFetch(tls, pCur, bp) - _ = libc.Int32FromInt32(0) if amt <= *(*Tu32)(unsafe.Pointer(bp)) { - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Ephem)) - (*TMem)(unsafe.Pointer(pMem)).Fn = int32(amt) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Ephem)) + (*TMem)(unsafe.Pointer(pMem)).Fn = libc.Int32FromUint32(amt) } else { rc = _sqlite3VdbeMemFromBtree(tls, pCur, uint32(0), amt, pMem) } @@ -61231,13 +58391,8 @@ func _valueToText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { var v1 int32 var p2 uintptr _, _ = v1, p2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Blob)|libc.Int32FromInt32(MEM_Str)) != 0 { - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Blob)|libc.Int32FromInt32(MEM_Str)) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Zero) != 0 { v1 = _sqlite3VdbeMemExpandBlob(tls, pVal) } else { v1 = 0 @@ -61247,11 +58402,10 @@ func _valueToText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { } p2 = pVal + 16 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(MEM_Str)) - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) != int32(enc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) { - _sqlite3VdbeChangeEncoding(tls, pVal, int32(enc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) + if libc.Int32FromUint8((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) != libc.Int32FromUint8(enc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) { + _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) } - if int32(enc)&int32(SQLITE_UTF16_ALIGNED) != 0 && int32(1) == int32(1)&int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fz) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(enc)&int32(SQLITE_UTF16_ALIGNED) != 0 && int32(1) == int32(1)&int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fz) { if _sqlite3VdbeMemMakeWriteable(tls, pVal) != SQLITE_OK { return uintptr(0) } @@ -61259,11 +58413,8 @@ func _valueToText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { _sqlite3VdbeMemNulTerminate(tls, pVal) /* IMP: R-31275-44060 */ } else { _sqlite3VdbeMemStringify(tls, pVal, enc, uint8(0)) - _ = libc.Int32FromInt32(0) } - _ = libc.Int32FromInt32(0) - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == libc.Int32FromUint8(enc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) { return (*Tsqlite3_value)(unsafe.Pointer(pVal)).Fz } else { return uintptr(0) @@ -61287,14 +58438,10 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { if !(pVal != 0) { return uintptr(0) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term)) == libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term)) == libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term) && libc.Int32FromUint8((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == libc.Int32FromUint8(enc) { return (*Tsqlite3_value)(unsafe.Pointer(pVal)).Fz } - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Null) != 0 { return uintptr(0) } return _valueToText(tls, pVal, enc) @@ -61309,7 +58456,7 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** that third-party extensions can get access to it? // */ func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { return int32(1) } else { return 0 @@ -61366,16 +58513,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p != 0 { pRec = *(*uintptr)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec)) if pRec == uintptr(0) { - pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ - nCol = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = int32(uint32(40)*uint32(nCol) + (libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ + nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ + nByte = libc.Int32FromUint32(uint32(40)*libc.Uint32FromInt32(nCol) + (libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - (*TUnpackedRecord)(unsafe.Pointer(pRec)).FaMem = pRec + uintptr((libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) + (*TUnpackedRecord)(unsafe.Pointer(pRec)).FaMem = pRec + uintptr((libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) i = 0 for { if !(i < nCol) { @@ -61398,7 +58543,7 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { } *(*uintptr)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec)) = pRec } - (*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField = uint16((*TValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal + int32(1)) + (*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField = libc.Uint16FromInt32((*TValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal + int32(1)) _sqlite3VdbeMemSetNull(tls, (*TUnpackedRecord)(unsafe.Pointer(pRec)).FaMem+uintptr((*TValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal)*40) return (*TUnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr((*TValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal)*40 } @@ -61440,21 +58585,16 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ pList = uintptr(0) /* Iterator variable */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pList = *(*uintptr)(unsafe.Pointer(p + 20)) if pList != 0 { nVal = (*TExprList)(unsafe.Pointer(pList)).FnExpr } - _ = libc.Int32FromInt32(0) pFunc = _sqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(p + 8)), nVal, enc, uint8(0)) - _ = libc.Int32FromInt32(0) - if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)|libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG)) == uint32(0) || (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)|libc.Int32FromInt32(SQLITE_FUNC_RUNONLY)) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)|libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG)) == uint32(0) || (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)|libc.Int32FromInt32(SQLITE_FUNC_RUNONLY)) != uint32(0) { return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(uint32(4)*uint32(nVal))) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint32(4)*libc.Uint32FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -61489,8 +58629,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3859, libc.VaList(bp+40, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) - _ = libc.Int32FromInt32(0) - rc = _sqlite3VdbeChangeEncoding(tls, pVal, int32(enc)) + rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) if rc == SQLITE_OK && _sqlite3VdbeMemTooBig(tls, pVal) != 0 { rc = int32(SQLITE_TOOBIG) (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ @@ -61547,9 +58686,8 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity negInt = int32(1) zNeg = __ccgo_ts + 1662 rc = SQLITE_OK - _ = libc.Int32FromInt32(0) for { - v1 = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) + v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) op = v1 if !(v1 == int32(TK_UPLUS) || op == int32(TK_SPAN)) { break @@ -61557,19 +58695,17 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft } if op == int32(TK_REGISTER) { - op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2) } /* Compressed expressions only appear when parsing the DEFAULT clause ** on a table column definition, and hence only when pCtx==0. This ** check ensures that an EP_TokenOnly expression is never passed down ** into valueFromFunction(). */ - _ = libc.Int32FromInt32(0) if op == int32(TK_CAST) { - _ = libc.Int32FromInt32(0) - aff = uint8(_sqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0))) + aff = libc.Uint8FromInt8(_sqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0))) rc = _valueFromExpr(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, enc, aff, ppVal, pCtx) if *(*uintptr)(unsafe.Pointer(ppVal)) != 0 { - if int32((*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppVal)))).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppVal)))).Fflags)&int32(MEM_Zero) != 0 { v2 = _sqlite3VdbeMemExpandBlob(tls, *(*uintptr)(unsafe.Pointer(ppVal))) } else { v2 = 0 @@ -61585,10 +58721,10 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity ** for hexadecimal literals. */ if op == int32(TK_UMINUS) { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft - if int32((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_INTEGER) || int32((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_FLOAT) { - if (*TExpr)(unsafe.Pointer(pLeft)).Fflags&uint32(libc.Int32FromInt32(EP_IntValue)) != uint32(0) || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 8))))) != int32('0') || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 8)) + 1))) & ^libc.Int32FromInt32(0x20) != int32('X') { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_INTEGER) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_FLOAT) { + if (*TExpr)(unsafe.Pointer(pLeft)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) != uint32(0) || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 8))))) != int32('0') || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 8)) + 1))) & ^libc.Int32FromInt32(0x20) != int32('X') { pExpr = pLeft - op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) zNeg = __ccgo_ts + 5138 } @@ -61599,7 +58735,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { goto no_mem } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_IntValue)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) != uint32(0) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), int64(*(*int32)(unsafe.Pointer(pExpr + 8)))*int64(negInt)) } else { if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { @@ -61612,9 +58748,8 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity _sqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp)), -int32(1), zVal, uint8(SQLITE_UTF8), __ccgo_fp(_sqlite3OomClear)) } } - if int32(affinity) == int32(SQLITE_AFF_BLOB) { + if libc.Int32FromUint8(affinity) == int32(SQLITE_AFF_BLOB) { if op == int32(TK_FLOAT) { - _ = libc.Int32FromInt32(0) _sqlite3AtoF(tls, (*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fz, *(*uintptr)(unsafe.Pointer(bp)), (*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fn, uint8(SQLITE_UTF8)) (*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags = uint16(MEM_Real) } else { @@ -61628,25 +58763,24 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } else { _sqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp)), affinity, uint8(SQLITE_UTF8)) } - _ = libc.Int32FromInt32(0) - if int32((*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)) != 0 { p3 = *(*uintptr)(unsafe.Pointer(bp)) + 16 *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^libc.Int32FromInt32(MEM_Str)) } - if int32(enc) != int32(SQLITE_UTF8) { - rc = _sqlite3VdbeChangeEncoding(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(enc)) + if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { + rc = _sqlite3VdbeChangeEncoding(tls, *(*uintptr)(unsafe.Pointer(bp)), libc.Int32FromUint8(enc)) } } else { if op == int32(TK_UMINUS) { /* This branch happens for multiple negative signs. Ex: -(-5) */ if SQLITE_OK == _valueFromExpr(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, enc, affinity, bp, pCtx) && *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) { _sqlite3VdbeMemNumerify(tls, *(*uintptr)(unsafe.Pointer(bp))) - if int32((*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&int32(MEM_Real) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&int32(MEM_Real) != 0 { *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) = -*(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) } else { if *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) { *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) = -float64(int64(-libc.Int32FromInt32(1)) - (libc.Int64FromUint32(0xffffffff) | libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32))) - (*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags = uint16(int32((*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Real)) + (*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Real)) } else { *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) = -*(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) } @@ -61662,23 +58796,18 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity _sqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp))) } else { if op == int32(TK_BLOB) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(bp)) = _valueNew(tls, db, pCtx) if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { goto no_mem } zVal = *(*uintptr)(unsafe.Pointer(pExpr + 8)) + 2 nVal = _sqlite3Strlen30(tls, zVal) - int32(1) - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemSetStr(tls, *(*uintptr)(unsafe.Pointer(bp)), _sqlite3HexToBlob(tls, db, zVal, nVal), int64(nVal/int32(2)), uint8(0), __ccgo_fp(_sqlite3OomClear)) } else { if op == int32(TK_FUNCTION) && pCtx != uintptr(0) { rc = _valueFromFunction(tls, db, pExpr, enc, affinity, bp, pCtx) } else { if op == int32(TK_TRUEFALSE) { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(bp)) = _valueNew(tls, db, pCtx) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { (*Tsqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags = uint16(MEM_Int) @@ -61700,7 +58829,6 @@ no_mem: _sqlite3OomFault(tls, db) } _sqlite3DbFree(tls, db, zVal) - _ = libc.Int32FromInt32(0) if pCtx == uintptr(0) { _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } @@ -61762,14 +58890,13 @@ func _stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Skip over any TK_COLLATE nodes */ pExpr = _sqlite3ExprSkipCollate(tls, pExpr) - _ = libc.Int32FromInt32(0) if !(pExpr != 0) { *(*uintptr)(unsafe.Pointer(bp)) = _valueNew(tls, db, pAlloc) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { _sqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_VARIABLE) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableQPSG) == uint64(0) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_VARIABLE) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableQPSG) == uint64(0) { iBindVar = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) _sqlite3VdbeSetVarmask(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, iBindVar) v1 = (*TParse)(unsafe.Pointer(pParse)).FpReprepare @@ -61786,7 +58913,6 @@ func _stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity rc = _valueFromExpr(tls, db, pExpr, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, affinity, bp, pAlloc) } } - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc } @@ -61838,7 +58964,7 @@ func _sqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppR _, _, _, _, _, _ = aff, i, nExtract, pElem, rc, v2 rc = SQLITE_OK nExtract = 0 - if pExpr == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_SELECT) { + if pExpr == uintptr(0) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_SELECT) { (*(*TValueNewStat4Ctx)(unsafe.Pointer(bp))).FpParse = pParse (*(*TValueNewStat4Ctx)(unsafe.Pointer(bp))).FpIdx = pIdx (*(*TValueNewStat4Ctx)(unsafe.Pointer(bp))).FppRec = ppRec @@ -61854,7 +58980,7 @@ func _sqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppR v2 = uintptr(0) } pElem = v2 - aff = uint8(_sqlite3IndexColumnAffinity(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx, iVal+i)) + aff = libc.Uint8FromInt8(_sqlite3IndexColumnAffinity(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx, iVal+i)) (*(*TValueNewStat4Ctx)(unsafe.Pointer(bp))).FiVal = iVal + i rc = _stat4ValueFromExpr(tls, pParse, pElem, aff, bp, bp+16) if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) { @@ -61911,35 +59037,34 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC szField = uint32(0) /* Column index */ a = pRec /* Typecast byte array */ pMem = *(*uintptr)(unsafe.Pointer(ppVal)) /* Write result into this Mem object */ - _ = libc.Int32FromInt32(0) - if int32(*(*Tu8)(unsafe.Pointer(a))) < int32(libc.Uint8FromInt32(0x80)) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a))) < libc.Int32FromUint8(libc.Uint8FromInt32(0x80)) { *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(*(*Tu8)(unsafe.Pointer(a))) v1 = libc.Int32FromInt32(1) } else { - v1 = int32(_sqlite3GetVarint32(tls, a, bp+4)) + v1 = libc.Int32FromUint8(_sqlite3GetVarint32(tls, a, bp+4)) } - iHdr = uint32(uint8(v1)) - if *(*Tu32)(unsafe.Pointer(bp + 4)) > uint32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { + iHdr = uint32(libc.Uint8FromInt32(v1)) + if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { return _sqlite3CorruptError(tls, int32(84745)) } - iField = int64(*(*Tu32)(unsafe.Pointer(bp + 4))) + iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 for { if !(i <= iCol) { break } - if int32(*(*Tu8)(unsafe.Pointer(a + uintptr(iHdr)))) < int32(libc.Uint8FromInt32(0x80)) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a + uintptr(iHdr)))) < libc.Int32FromUint8(libc.Uint8FromInt32(0x80)) { *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(a + uintptr(iHdr)))) v3 = libc.Int32FromInt32(1) } else { - v3 = int32(_sqlite3GetVarint32(tls, a+uintptr(iHdr), bp)) + v3 = libc.Int32FromUint8(_sqlite3GetVarint32(tls, a+uintptr(iHdr), bp)) } - iHdr += uint32(uint8(v3)) + iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { return _sqlite3CorruptError(tls, int32(84751)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) - iField += int64(szField) + iField += libc.Int64FromUint32(szField) goto _2 _2: ; @@ -61956,7 +59081,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC return int32(SQLITE_NOMEM) } } - _sqlite3VdbeSerialGet(tls, a+uintptr(iField-int64(szField)), *(*Tu32)(unsafe.Pointer(bp)), pMem) + _sqlite3VdbeSerialGet(tls, a+uintptr(iField-libc.Int64FromUint32(szField)), *(*Tu32)(unsafe.Pointer(bp)), pMem) (*TMem)(unsafe.Pointer(pMem)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc return SQLITE_OK } @@ -61973,7 +59098,7 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { var i, nCol int32 _, _, _, _ = aMem, db, i, nCol if pRec != 0 { - nCol = int32((*TKeyInfo)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)).FnAllField) + nCol = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)).FnAllField) aMem = (*TUnpackedRecord)(unsafe.Pointer(pRec)).FaMem db = (*(*TMem)(unsafe.Pointer(aMem))).Fdb i = 0 @@ -62038,21 +59163,20 @@ func _sqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc Tu8) (r int32) { var p uintptr _ = p p = pVal - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Str) != 0 && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Str) != 0 && libc.Int32FromUint8((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == libc.Int32FromUint8(enc) { return (*TMem)(unsafe.Pointer(p)).Fn } - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Str) != 0 && int32(enc) != int32(SQLITE_UTF8) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) != int32(SQLITE_UTF8) { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Str) != 0 && libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) && libc.Int32FromUint8((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) != int32(SQLITE_UTF8) { return (*TMem)(unsafe.Pointer(p)).Fn } - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Blob) != 0 { - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Blob) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Zero) != 0 { return (*TMem)(unsafe.Pointer(p)).Fn + *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(p)).Fu)) } else { return (*TMem)(unsafe.Pointer(p)).Fn } } - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Null) != 0 { return 0 } return _valueBytes(tls, pVal, enc) @@ -62079,13 +59203,8 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 4 (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe = p - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).FpVdbe = p - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, p, int32(OP_Init), 0, int32(1)) return p } @@ -62123,11 +59242,10 @@ func _sqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags return } (*TVdbe)(unsafe.Pointer(p)).FprepFlags = prepFlags - if int32(prepFlags)&int32(SQLITE_PREPARE_SAVESQL) == 0 { + if libc.Int32FromUint8(prepFlags)&int32(SQLITE_PREPARE_SAVESQL) == 0 { (*TVdbe)(unsafe.Pointer(p)).Fexpmask = uint32(0) } - _ = libc.Int32FromInt32(0) - (*TVdbe)(unsafe.Pointer(p)).FzSql = _sqlite3DbStrNDup(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, z, uint64(n)) + (*TVdbe)(unsafe.Pointer(p)).FzSql = _sqlite3DbStrNDup(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, z, libc.Uint64FromInt32(n)) } // C documentation @@ -62146,7 +59264,6 @@ func _sqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { var pTmp, ppTmp, zTmp uintptr var tmp TVdbe _, _, _, _ = pTmp, ppTmp, tmp, zTmp - _ = libc.Int32FromInt32(0) tmp = *(*TVdbe)(unsafe.Pointer(pA)) *(*TVdbe)(unsafe.Pointer(pA)) = *(*TVdbe)(unsafe.Pointer(pB)) *(*TVdbe)(unsafe.Pointer(pB)) = tmp @@ -62187,7 +59304,7 @@ func _growOpArray(tls *libc.TLS, v uintptr, nOp int32) (r int32) { if (*TVdbe)(unsafe.Pointer(v)).FnOpAlloc != 0 { v1 = int64(2) * int64((*TVdbe)(unsafe.Pointer(v)).FnOpAlloc) } else { - v1 = int64(libc.Uint32FromInt32(1024) / libc.Uint32FromInt64(20)) + v1 = libc.Int64FromUint32(libc.Uint32FromInt32(1024) / libc.Uint32FromInt64(20)) } /* The SQLITE_TEST_REALLOC_STRESS compile-time option is designed to force ** more frequent reallocs and hence provide more opportunities for @@ -62203,12 +59320,10 @@ func _growOpArray(tls *libc.TLS, v uintptr, nOp int32) (r int32) { _sqlite3OomFault(tls, (*TParse)(unsafe.Pointer(p)).Fdb) return int32(SQLITE_NOMEM) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - pNew = _sqlite3DbRealloc(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TVdbe)(unsafe.Pointer(v)).FaOp, uint64(nNew*int64(20))) + pNew = _sqlite3DbRealloc(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TVdbe)(unsafe.Pointer(v)).FaOp, libc.Uint64FromInt64(nNew*int64(20))) if pNew != 0 { (*TParse)(unsafe.Pointer(p)).FszOpAlloc = _sqlite3DbMallocSize(tls, (*TParse)(unsafe.Pointer(p)).Fdb, pNew) - (*TVdbe)(unsafe.Pointer(v)).FnOpAlloc = int32(uint32((*TParse)(unsafe.Pointer(p)).FszOpAlloc) / uint32(20)) + (*TVdbe)(unsafe.Pointer(v)).FnOpAlloc = libc.Int32FromUint32(libc.Uint32FromInt32((*TParse)(unsafe.Pointer(p)).FszOpAlloc) / uint32(20)) (*TVdbe)(unsafe.Pointer(v)).FaOp = pNew } if pNew != 0 { @@ -62227,11 +59342,9 @@ func _growOpArray(tls *libc.TLS, v uintptr, nOp int32) (r int32) { // ** before adding the new opcode. // */ func _growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) (r int32) { - _ = libc.Int32FromInt32(0) if _growOpArray(tls, p, int32(1)) != 0 { return int32(1) } - _ = libc.Int32FromInt32(0) return _sqlite3VdbeAddOp3(tls, p, op, p1, p2, p3) } @@ -62240,7 +59353,7 @@ func _addOp4IntSlow(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 i var pOp uintptr _, _ = addr, pOp addr = _sqlite3VdbeAddOp3(tls, p, op, p1, p2, p3) - if int32((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed) == 0 { pOp = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20 (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(3)) *(*int32)(unsafe.Pointer(pOp + 16)) = p4 @@ -62279,16 +59392,12 @@ func _sqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, var pOp uintptr _, _ = i, pOp i = (*TVdbe)(unsafe.Pointer(p)).FnOp - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).FnOpAlloc <= i { return _growOp3(tls, p, op, p1, p2, p3) } - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).FnOp++ pOp = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*20 - _ = libc.Int32FromInt32(0) - (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = uint8(op) + (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = libc.Uint8FromInt32(op) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(0) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = p1 (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2 @@ -62312,8 +59421,7 @@ func _sqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int3 } (*TVdbe)(unsafe.Pointer(p)).FnOp++ pOp = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*20 - _ = libc.Int32FromInt32(0) - (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = uint8(op) + (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = libc.Uint8FromInt32(op) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(0) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = p1 (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2 @@ -62428,11 +59536,9 @@ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int var pCtx, v uintptr _, _, _, _, _ = addr, nByte, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) - nByte = int32(uint32(32) + uint32(nArg-libc.Int32FromInt32(1))*uint32(4)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(nByte)) + nByte = libc.Int32FromUint32(uint32(32) + libc.Uint32FromInt32(nArg-libc.Int32FromInt32(1))*uint32(4)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) if pCtx == uintptr(0) { - _ = libc.Int32FromInt32(0) _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 } @@ -62440,7 +59546,7 @@ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = pFunc (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = uintptr(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0 - (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = uint8(nArg) + (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = libc.Uint8FromInt32(nArg) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp = _sqlite3VdbeCurrentAddr(tls, v) if eCallCtx != 0 { v1 = int32(OP_PureFunc) @@ -62448,7 +59554,7 @@ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int v1 = int32(OP_Function) } addr = _sqlite3VdbeAddOp4(tls, v, v1, p1, p2, p3, pCtx, -int32(15)) - _sqlite3VdbeChangeP5(tls, v, uint16(eCallCtx&int32(NC_SelfRef))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(eCallCtx&int32(NC_SelfRef))) _sqlite3MayAbort(tls, pParse) return addr } @@ -62506,7 +59612,7 @@ func _sqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush Tu8, zFmt uintptr, addr = 0 /* Always include the OP_Explain opcodes if SQLITE_DEBUG is defined. ** But omit them (for performance) during production builds */ - if int32((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) || libc.Bool(0 != 0) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) || libc.Bool(0 != 0) { ap = va zMsg = _sqlite3VMPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zFmt, ap) _ = ap @@ -62622,7 +59728,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(uint32(nNewSize)*uint32(4))) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint32FromInt32(nNewSize)*uint32(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -62640,13 +59746,10 @@ func _sqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { _, _ = j, p p = (*TVdbe)(unsafe.Pointer(v)).FpParse j = ^x - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(p)).FnLabelAlloc+(*TParse)(unsafe.Pointer(p)).FnLabel < 0 { _resizeResolveLabel(tls, p, v, j) } else { - _ = libc.Int32FromInt32(0) /* Labels may only be resolved once */ + /* Labels may only be resolved once */ *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(p)).FaLabel + uintptr(j)*4)) = (*TVdbe)(unsafe.Pointer(v)).FnOp } } @@ -62673,7 +59776,7 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { if !(i < (*TVdbe)(unsafe.Pointer(p)).FnOp) { break } - if int32((*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*20))).Fopcode) == int32(OP_Expire) { + if libc.Int32FromUint8((*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*20))).Fopcode) == int32(OP_Expire) { (*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + 1*20))).Fopcode = uint8(OP_Noop) break } @@ -62714,11 +59817,10 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel - _ = libc.Int32FromInt32(0) /* tag-20230419-1 */ + /* tag-20230419-1 */ libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(1), 6, 0x40) libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(0), 7, 0x80) pOp = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr((*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1))*20 - _ = libc.Int32FromInt32(0) for int32(1) != 0 { /* Only JUMP opcodes and the short list of special opcodes in the switch ** below need to be considered. The mkopcodeh.tcl generator script groups @@ -62726,10 +59828,10 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { ** any opcode that does not need processing by virtual of the fact that ** it is larger than SQLITE_MX_JUMP_OPCODE, as a performance optimization. */ - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) <= int32(SQLITE_MX_JUMP_OPCODE) { + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) <= int32(SQLITE_MX_JUMP_OPCODE) { /* NOTE: Be sure to update mkopcodeh.tcl when adding or removing ** cases from this switch! */ - switch int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) { + switch libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) { case int32(OP_Transaction): if (*TOp)(unsafe.Pointer(pOp)).Fp2 != 0 { libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(0), 6, 0x40) @@ -62747,15 +59849,12 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(0), 6, 0x40) libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(1), 7, 0x80) case int32(OP_Init): - _ = libc.Int32FromInt32(0) goto resolve_p2_values_loop_exit case int32(OP_VUpdate): if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*20))).Fp1 if n > nMaxArgs { nMaxArgs = n @@ -62766,24 +59865,18 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* The mkopcodeh.tcl script has so arranged things that the only ** non-jump opcodes less than SQLITE_MX_JUMP_CODE are guaranteed to ** have non-negative values for P2. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* True because of tag-20230419-1 */ + /* True because of tag-20230419-1 */ (*TOp)(unsafe.Pointer(pOp)).Fp2 = *(*int32)(unsafe.Pointer(aLabel + uintptr(^(*TOp)(unsafe.Pointer(pOp)).Fp2)*4)) } /* OPFLG_JUMP opcodes never have P2==0, though OPFLG_JUMP0 opcodes ** might */ - _ = libc.Int32FromInt32(0) /* Jumps never go off the end of the bytecode array */ - _ = libc.Int32FromInt32(0) break } /* The mkopcodeh.tcl script has so arranged things that the only ** non-jump opcodes less than SQLITE_MX_JUMP_CODE are guaranteed to ** have non-negative values for P2. */ - _ = libc.Int32FromInt32(0) } - _ = libc.Int32FromInt32(0) pOp -= 20 } goto resolve_p2_values_loop_exit @@ -62795,7 +59888,6 @@ resolve_p2_values_loop_exit: } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs - _ = libc.Int32FromInt32(0) } // C documentation @@ -62804,7 +59896,6 @@ resolve_p2_values_loop_exit: // ** Return the address of the next instruction to be inserted. // */ func _sqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return (*TVdbe)(unsafe.Pointer(p)).FnOp } @@ -62848,9 +59939,7 @@ func _sqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg ui var aOp uintptr _ = aOp aOp = (*TVdbe)(unsafe.Pointer(p)).FaOp - _ = libc.Int32FromInt32(0) /* Check that sqlite3VdbeUsesBtree() was not called on this VM */ - _ = libc.Int32FromInt32(0) _resolveP2Values(tls, p, pnMaxArg) *(*int32)(unsafe.Pointer(pnOp)) = (*TVdbe)(unsafe.Pointer(p)).FnOp (*TVdbe)(unsafe.Pointer(p)).FaOp = uintptr(0) @@ -62870,8 +59959,6 @@ func _sqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLi var i int32 var pFirst, pOut, v1 uintptr _, _, _, _ = i, pFirst, pOut, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).FnOp+nOp > (*TVdbe)(unsafe.Pointer(p)).FnOpAlloc && _growOpArray(tls, p, nOp) != 0 { return uintptr(0) } @@ -62886,8 +59973,7 @@ func _sqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLi (*TVdbeOp)(unsafe.Pointer(pOut)).Fopcode = (*TVdbeOpList)(unsafe.Pointer(aOp)).Fopcode (*TVdbeOp)(unsafe.Pointer(pOut)).Fp1 = int32((*TVdbeOpList)(unsafe.Pointer(aOp)).Fp1) (*TVdbeOp)(unsafe.Pointer(pOut)).Fp2 = int32((*TVdbeOpList)(unsafe.Pointer(aOp)).Fp2) - _ = libc.Int32FromInt32(0) - if int32(_sqlite3OpcodeProperty[(*TVdbeOpList)(unsafe.Pointer(aOp)).Fopcode])&int32(OPFLG_JUMP) != 0 && int32((*TVdbeOpList)(unsafe.Pointer(aOp)).Fp2) > 0 { + if libc.Int32FromUint8(_sqlite3OpcodeProperty[(*TVdbeOpList)(unsafe.Pointer(aOp)).Fopcode])&int32(OPFLG_JUMP) != 0 && int32((*TVdbeOpList)(unsafe.Pointer(aOp)).Fp2) > 0 { *(*int32)(unsafe.Pointer(pOut + 8)) += (*TVdbe)(unsafe.Pointer(p)).FnOp } (*TVdbeOp)(unsafe.Pointer(pOut)).Fp3 = int32((*TVdbeOpList)(unsafe.Pointer(aOp)).Fp3) @@ -62913,27 +59999,22 @@ func _sqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLi // ** for a specific instruction. // */ func _sqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode Tu8) { - _ = libc.Int32FromInt32(0) (*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetOp(tls, p, addr))).Fopcode = iNewOpcode } func _sqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32) { - _ = libc.Int32FromInt32(0) (*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetOp(tls, p, addr))).Fp1 = val } func _sqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32) { - _ = libc.Int32FromInt32(0) (*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetOp(tls, p, addr))).Fp2 = val } func _sqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32) { - _ = libc.Int32FromInt32(0) (*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetOp(tls, p, addr))).Fp3 = val } func _sqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 Tu16) { - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).FnOp > 0 { (*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr((*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1))*20))).Fp5 = p5 } @@ -62950,7 +60031,7 @@ func _sqlite3VdbeTypeofColumn(tls *libc.TLS, p uintptr, iDest int32) { var pOp, p1 uintptr _, _ = pOp, p1 pOp = _sqlite3VdbeGetLastOp(tls, p) - if (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 == iDest && int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) { + if (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 == iDest && libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) { p1 = pOp + 2 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(OPFLAG_TYPEOFARG)) } @@ -62983,8 +60064,6 @@ func _sqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { // */ func _sqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { if addr == (*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).FnOp-- } else { _sqlite3VdbeChangeP2(tls, p, addr, (*TVdbe)(unsafe.Pointer(p)).FnOp) @@ -62998,7 +60077,6 @@ func _sqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { // ** the FuncDef is not ephemeral, then do nothing. // */ func _freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { - _ = libc.Int32FromInt32(0) if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_EPHEM) != uint32(0) { _sqlite3DbNNFreeNN(tls, db, pDef) } @@ -63017,13 +60095,11 @@ func _freeP4Mem(tls *libc.TLS, db uintptr, p uintptr) { } func _freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) { - _ = libc.Int32FromInt32(0) _freeEphemeralFunction(tls, db, (*Tsqlite3_context)(unsafe.Pointer(p)).FpFunc) _sqlite3DbNNFreeNN(tls, db, p) } func _freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { - _ = libc.Int32FromInt32(0) switch p4type { case -int32(15): _freeP4FuncCtx(tls, db, p4) @@ -63071,8 +60147,6 @@ func _freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { func _vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) { var pOp uintptr _ = pOp - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if aOp != 0 { pOp = aOp + uintptr(nOp-int32(1))*20 for int32(1) != 0 { /* Exit via break */ @@ -63120,7 +60194,6 @@ func _sqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 { return 0 } - _ = libc.Int32FromInt32(0) pOp = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20 _freeP4(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = P4_NOTUSED @@ -63136,7 +60209,7 @@ func _sqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) (r int32) { // ** then remove it. Return true if and only if an opcode was removed. // */ func _sqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op Tu8) (r int32) { - if (*TVdbe)(unsafe.Pointer(p)).FnOp > 0 && int32((*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr((*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1))*20))).Fopcode) == int32(op) { + if (*TVdbe)(unsafe.Pointer(p)).FnOp > 0 && libc.Int32FromUint8((*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr((*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1))*20))).Fopcode) == libc.Int32FromUint8(op) { return _sqlite3VdbeChangeToNoop(tls, p, (*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1)) } else { return 0 @@ -63165,7 +60238,6 @@ func _sqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op Tu8) (r int32) { // */ func _vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) { if (*TOp)(unsafe.Pointer(pOp)).Fp4type != 0 { - _ = libc.Int32FromInt32(0) (*TOp)(unsafe.Pointer(pOp)).Fp4type = 0 *(*uintptr)(unsafe.Pointer(pOp + 16)) = uintptr(0) } @@ -63175,7 +60247,7 @@ func _vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int if n == 0 { n = _sqlite3Strlen30(tls, zP4) } - *(*uintptr)(unsafe.Pointer(pOp + 16)) = _sqlite3DbStrNDup(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, zP4, uint64(n)) + *(*uintptr)(unsafe.Pointer(pOp + 16)) = _sqlite3DbStrNDup(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, zP4, libc.Uint64FromInt32(n)) (*TOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) } } @@ -63186,18 +60258,13 @@ func _sqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, _zP4 uintptr, n *(*uintptr)(unsafe.Pointer(bp)) = _zP4 var db, pOp uintptr _, _ = db, pOp - _ = libc.Int32FromInt32(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if n != -int32(11) { _freeP4(tls, db, n, *(*uintptr)(unsafe.Pointer(bp))) } return } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if addr < 0 { addr = (*TVdbe)(unsafe.Pointer(p)).FnOp - int32(1) } @@ -63213,7 +60280,6 @@ func _sqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, _zP4 uintptr, n (*TOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(3)) } else { if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pOp + 16)) = *(*uintptr)(unsafe.Pointer(bp)) (*TOp)(unsafe.Pointer(pOp)).Fp4type = int8(n) if n == -int32(11) { @@ -63237,15 +60303,10 @@ func _sqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, _zP4 uintptr, n func _sqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { var pOp uintptr _ = pOp - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 { _freeP4(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, n, pP4) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOp = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr((*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1))*20 - _ = libc.Int32FromInt32(0) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(n) *(*uintptr)(unsafe.Pointer(pOp + 16)) = pP4 } @@ -63261,8 +60322,6 @@ func _sqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { var pKeyInfo, v uintptr _, _ = pKeyInfo, v v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pKeyInfo = _sqlite3KeyInfoOfIndex(tls, pParse, pIdx) if pKeyInfo != 0 { _sqlite3VdbeAppendP4(tls, v, pKeyInfo, -int32(8)) @@ -63285,8 +60344,6 @@ func _sqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { // ** by running with Valgrind. // */ func _sqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) (r uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 { return uintptr(unsafe.Pointer(&_dummy)) } else { @@ -63326,11 +60383,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5145, libc.VaList(bp+32, int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5145, libc.VaList(bp+32, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { - if !(j < int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { + if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { break } pColl = *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(j)*4)) @@ -63343,12 +60399,12 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if libc.Xstrcmp(tls, zColl, __ccgo_ts+5150) == 0 { zColl = __ccgo_ts + 5157 } - if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { v3 = __ccgo_ts + 5138 } else { v3 = __ccgo_ts + 1662 } - if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { v4 = __ccgo_ts + 5159 } else { v4 = __ccgo_ts + 1662 @@ -63362,7 +60418,6 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { Xsqlite3_str_append(tls, bp, __ccgo_ts+5170, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5186, libc.VaList(bp+32, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) @@ -63378,19 +60433,18 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1390, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1423, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(pMem)))) } else { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1390, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(pMem)))) } else { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { zP4 = __ccgo_ts + 1663 } else { - _ = libc.Int32FromInt32(0) zP4 = __ccgo_ts + 5205 } } @@ -63430,7 +60484,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if zP4 != 0 { Xsqlite3_str_appendall(tls, bp, zP4) } - if int32((*(*TStrAccum)(unsafe.Pointer(bp))).FaccError)&int32(SQLITE_NOMEM) != 0 { + if libc.Int32FromUint8((*(*TStrAccum)(unsafe.Pointer(bp))).FaccError)&int32(SQLITE_NOMEM) != 0 { _sqlite3OomFault(tls, db) } return _sqlite3StrAccumFinish(tls, bp) @@ -63454,8 +60508,6 @@ var _encnames = [4]uintptr{ // ** p->btreeMask of databases that will require a lock. // */ func _sqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*TyDbMask)(unsafe.Pointer(p + 148)) |= libc.Uint32FromInt32(1) << i if i != int32(1) && _sqlite3BtreeSharable(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).FaDb + uintptr(i)*16))).FpBt) != 0 { *(*TyDbMask)(unsafe.Pointer(p + 152)) |= libc.Uint32FromInt32(1) << i @@ -63615,8 +60667,6 @@ func _releaseMemArray(tls *libc.TLS, p uintptr, N int32) { return } for { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* This block is really an inlined version of sqlite3VdbeMemRelease() ** that takes advantage of the fact that the memory cell value is ** being set to NULL after releasing any dynamic resources. @@ -63629,7 +60679,7 @@ func _releaseMemArray(tls *libc.TLS, p uintptr, N int32) { ** with no indexes using a single prepared INSERT statement, bind() ** and reset(). Inserts are grouped into a transaction. */ - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { _sqlite3VdbeMemRelease(tls, p) (*TMem)(unsafe.Pointer(p)).Fflags = uint16(MEM_Undefined) } else { @@ -63664,7 +60714,6 @@ func _sqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { var pFrame uintptr _ = pFrame pFrame = pArg - _ = libc.Int32FromInt32(0) (*TVdbeFrame)(unsafe.Pointer(pFrame)).FpParent = (*TVdbe)(unsafe.Pointer((*TVdbeFrame)(unsafe.Pointer(pFrame)).Fv)).FpDelFrame (*TVdbe)(unsafe.Pointer((*TVdbeFrame)(unsafe.Pointer(pFrame)).Fv)).FpDelFrame = pFrame } @@ -63695,10 +60744,10 @@ func _sqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, */ nRow = (*TVdbe)(unsafe.Pointer(p)).FnOp if pSub != uintptr(0) { - if int32((*TMem)(unsafe.Pointer(pSub)).Fflags)&int32(MEM_Blob) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pSub)).Fflags)&int32(MEM_Blob) != 0 { /* pSub is initiallly NULL. It is initialized to a BLOB by ** the P4_SUBPROGRAM processing logic below */ - nSub = int32(uint32((*TMem)(unsafe.Pointer(pSub)).Fn) / uint32(4)) + nSub = libc.Int32FromUint32(libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pSub)).Fn) / uint32(4)) apSub = (*TMem)(unsafe.Pointer(pSub)).Fz } i = 0 @@ -63729,15 +60778,12 @@ func _sqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, aOp = (*TVdbe)(unsafe.Pointer(p)).FaOp } else { i -= (*TVdbe)(unsafe.Pointer(p)).FnOp - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) j = 0 for { if !(i >= (*TSubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*4)))).FnOp) { break } i -= (*TSubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*4)))).FnOp - _ = libc.Int32FromInt32(0) goto _3 _3: ; @@ -63751,7 +60797,7 @@ func _sqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, ** has not already been seen. */ if pSub != uintptr(0) && int32((*(*TOp)(unsafe.Pointer(aOp + uintptr(i)*20))).Fp4type) == -int32(4) { - nByte = int32(uint32(nSub+libc.Int32FromInt32(1)) * uint32(4)) + nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nSub+libc.Int32FromInt32(1)) * uint32(4)) j1 = 0 for { if !(j1 < nSub) { @@ -63775,19 +60821,18 @@ func _sqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, v5 = nSub nSub++ *(*uintptr)(unsafe.Pointer(apSub + uintptr(v5)*4)) = *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*20 + 16)) - (*TMem)(unsafe.Pointer(pSub)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pSub)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Blob)) - (*TMem)(unsafe.Pointer(pSub)).Fn = int32(uint32(nSub) * uint32(4)) + (*TMem)(unsafe.Pointer(pSub)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pSub)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Blob)) + (*TMem)(unsafe.Pointer(pSub)).Fn = libc.Int32FromUint32(libc.Uint32FromInt32(nSub) * uint32(4)) nRow += (*TSubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*20 + 16)))).FnOp } } if eMode == 0 { break } - _ = libc.Int32FromInt32(0) - if int32((*(*TOp)(unsafe.Pointer(aOp + uintptr(i)*20))).Fopcode) == int32(OP_Explain) { + if libc.Int32FromUint8((*(*TOp)(unsafe.Pointer(aOp + uintptr(i)*20))).Fopcode) == int32(OP_Explain) { break } - if int32((*(*TOp)(unsafe.Pointer(aOp + uintptr(i)*20))).Fopcode) == int32(OP_Init) && iPc > int32(1) { + if libc.Int32FromUint8((*(*TOp)(unsafe.Pointer(aOp + uintptr(i)*20))).Fopcode) == int32(OP_Init) && iPc > int32(1) { break } } @@ -63807,9 +60852,8 @@ func _sqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { var aMem, apCsr uintptr var i int32 _, _, _ = aMem, apCsr, i - aMem = p + uintptr((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) + aMem = p + uintptr((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) apCsr = aMem + uintptr((*TVdbeFrame)(unsafe.Pointer(p)).FnChildMem)*40 - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TVdbeFrame)(unsafe.Pointer(p)).FnChildCsr) { @@ -63861,9 +60905,6 @@ func _sqlite3VdbeList(tls *libc.TLS, p uintptr) (r int32) { rc = SQLITE_OK /* Return code */ pMem = (*TVdbe)(unsafe.Pointer(p)).FaMem + 1*40 /* First Mem of result set */ bListSubprogs = libc.BoolInt32(int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0xc>>2)) == int32(1) || (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TriggerEQP) != uint64(0)) /* Current opcode */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Even though this opcode does not use dynamic strings for ** the result, result columns may become dynamic if the user calls ** sqlite3_column_text16(), causing a translation to UTF-16 encoding. @@ -63880,7 +60921,6 @@ func _sqlite3VdbeList(tls *libc.TLS, p uintptr) (r int32) { ** commandeer the 9th cell to use as storage for an array of pointers ** to trigger subprograms. The VDBE is guaranteed to have at least 9 ** cells. */ - _ = libc.Int32FromInt32(0) pSub = (*TVdbe)(unsafe.Pointer(p)).FaMem + 9*40 } else { pSub = uintptr(0) @@ -63900,18 +60940,16 @@ func _sqlite3VdbeList(tls *libc.TLS, p uintptr) (r int32) { _sqlite3VdbeMemSetInt64(tls, pMem+uintptr(1)*40, int64((*TOp)(unsafe.Pointer(pOp)).Fp2)) _sqlite3VdbeMemSetInt64(tls, pMem+uintptr(2)*40, int64((*TOp)(unsafe.Pointer(pOp)).Fp3)) _sqlite3VdbeMemSetStr(tls, pMem+uintptr(3)*40, zP4, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp(Xsqlite3_free)) - _ = libc.Int32FromInt32(0) } else { _sqlite3VdbeMemSetInt64(tls, pMem+uintptr(0)*40, int64(*(*int32)(unsafe.Pointer(bp)))) - _sqlite3VdbeMemSetStr(tls, pMem+uintptr(1)*40, _sqlite3OpcodeName(tls, int32((*TOp)(unsafe.Pointer(pOp)).Fopcode)), int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, pMem+uintptr(1)*40, _sqlite3OpcodeName(tls, libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode)), int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) _sqlite3VdbeMemSetInt64(tls, pMem+uintptr(2)*40, int64((*TOp)(unsafe.Pointer(pOp)).Fp1)) _sqlite3VdbeMemSetInt64(tls, pMem+uintptr(3)*40, int64((*TOp)(unsafe.Pointer(pOp)).Fp2)) _sqlite3VdbeMemSetInt64(tls, pMem+uintptr(4)*40, int64((*TOp)(unsafe.Pointer(pOp)).Fp3)) /* pMem+5 for p4 is done last */ - _sqlite3VdbeMemSetInt64(tls, pMem+uintptr(6)*40, int64((*TOp)(unsafe.Pointer(pOp)).Fp5)) + _sqlite3VdbeMemSetInt64(tls, pMem+uintptr(6)*40, libc.Int64FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)) _sqlite3VdbeMemSetNull(tls, pMem+uintptr(7)*40) _sqlite3VdbeMemSetStr(tls, pMem+uintptr(5)*40, zP4, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp(Xsqlite3_free)) - _ = libc.Int32FromInt32(0) } (*TVdbe)(unsafe.Pointer(p)).FpResultRow = pMem if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -63955,7 +60993,6 @@ type ReusableSpace = TReusableSpace // ** statement. // */ func _allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Tsqlite3_int64) (r uintptr) { - _ = libc.Int32FromInt32(0) if pBuf == uintptr(0) { nByte = (nByte + libc.Int64FromInt32(7)) & int64(^libc.Int32FromInt32(7)) if nByte <= (*TReusableSpace)(unsafe.Pointer(p)).FnFree { @@ -63965,7 +61002,6 @@ func _allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Tsqlite3_int64) ( *(*Tsqlite3_int64)(unsafe.Pointer(p + 12)) += nByte } } - _ = libc.Int32FromInt32(0) return pBuf } @@ -63976,11 +61012,8 @@ func _allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Tsqlite3_int64) ( // ** running it. // */ func _sqlite3VdbeRewind(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* There should be at least one opcode. */ - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).FeVdbeState = uint8(VDBE_READY_STATE) (*TVdbe)(unsafe.Pointer(p)).Fpc = -int32(1) (*TVdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK @@ -64020,15 +61053,9 @@ func _sqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { var _ /* nArg at bp+0 */ int32 var _ /* x at bp+4 */ TReusableSpace _, _, _, _, _, _ = db, n, nCursor, nMem, nVar, v1 /* Reusable bulk memory */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).FpVList = (*TParse)(unsafe.Pointer(pParse)).FpVList (*TParse)(unsafe.Pointer(pParse)).FpVList = uintptr(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb - _ = libc.Int32FromInt32(0) nVar = int32((*TParse)(unsafe.Pointer(pParse)).FnVar) nMem = (*TParse)(unsafe.Pointer(pParse)).FnMem nCursor = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -64046,12 +61073,9 @@ func _sqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { ** opcode array. This extra memory will be reallocated for other elements ** of the prepared statement. */ - n = int32((libc.Uint32FromInt64(20)*uint32((*TVdbe)(unsafe.Pointer(p)).FnOp) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) /* Bytes of opcode memory used */ - (*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FpSpace = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(n) /* Unused opcode memory */ - _ = libc.Int32FromInt32(0) - (*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FnFree = int64(((*TParse)(unsafe.Pointer(pParse)).FszOpAlloc - n) & ^libc.Int32FromInt32(7)) /* Bytes of unused memory */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + n = libc.Int32FromUint32((libc.Uint32FromInt64(20)*libc.Uint32FromInt32((*TVdbe)(unsafe.Pointer(p)).FnOp) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) /* Bytes of opcode memory used */ + (*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FpSpace = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(n) /* Unused opcode memory */ + (*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FnFree = int64(((*TParse)(unsafe.Pointer(pParse)).FszOpAlloc - n) & ^libc.Int32FromInt32(7)) /* Bytes of unused memory */ _resolveP2Values(tls, p, bp) libc.SetBitFieldPtr16Uint32(p+144, uint32(libc.BoolUint8((*TParse)(unsafe.Pointer(pParse)).FisMultiWrite != 0 && (*TParse)(unsafe.Pointer(pParse)).FmayAbort != 0)), 5, 0x20) if (*TParse)(unsafe.Pointer(pParse)).Fexplain != 0 { @@ -64059,7 +61083,7 @@ func _sqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { nMem = int32(10) } libc.SetBitFieldPtr16Uint32(p+144, uint32((*TParse)(unsafe.Pointer(pParse)).Fexplain), 2, 0xc) - (*TVdbe)(unsafe.Pointer(p)).FnResColumn = uint16(int32(12) - int32(4)*int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0xc>>2))) + (*TVdbe)(unsafe.Pointer(p)).FnResColumn = libc.Uint16FromInt32(int32(12) - int32(4)*int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0xc>>2))) } libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(0), 0, 0x3) /* Memory for registers, parameters, cursor, etc, is allocated in one or two @@ -64073,20 +61097,20 @@ func _sqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { ** reduce the amount of memory held by a prepared statement. */ (*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FnNeeded = 0 - (*TVdbe)(unsafe.Pointer(p)).FaMem = _allocSpace(tls, bp+4, uintptr(0), int64(uint32(nMem)*uint32(40))) - (*TVdbe)(unsafe.Pointer(p)).FaVar = _allocSpace(tls, bp+4, uintptr(0), int64(uint32(nVar)*uint32(40))) - (*TVdbe)(unsafe.Pointer(p)).FapArg = _allocSpace(tls, bp+4, uintptr(0), int64(uint32(*(*int32)(unsafe.Pointer(bp)))*uint32(4))) - (*TVdbe)(unsafe.Pointer(p)).FapCsr = _allocSpace(tls, bp+4, uintptr(0), int64(uint32(nCursor)*uint32(4))) + (*TVdbe)(unsafe.Pointer(p)).FaMem = _allocSpace(tls, bp+4, uintptr(0), libc.Int64FromUint32(libc.Uint32FromInt32(nMem)*uint32(40))) + (*TVdbe)(unsafe.Pointer(p)).FaVar = _allocSpace(tls, bp+4, uintptr(0), libc.Int64FromUint32(libc.Uint32FromInt32(nVar)*uint32(40))) + (*TVdbe)(unsafe.Pointer(p)).FapArg = _allocSpace(tls, bp+4, uintptr(0), libc.Int64FromUint32(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))*uint32(4))) + (*TVdbe)(unsafe.Pointer(p)).FapCsr = _allocSpace(tls, bp+4, uintptr(0), libc.Int64FromUint32(libc.Uint32FromInt32(nCursor)*uint32(4))) if (*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FnNeeded != 0 { - v1 = _sqlite3DbMallocRawNN(tls, db, uint64((*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FnNeeded)) + v1 = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64((*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FnNeeded)) (*TVdbe)(unsafe.Pointer(p)).FpFree = v1 (*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FpSpace = v1 (*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FnFree = (*(*TReusableSpace)(unsafe.Pointer(bp + 4))).FnNeeded if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - (*TVdbe)(unsafe.Pointer(p)).FaMem = _allocSpace(tls, bp+4, (*TVdbe)(unsafe.Pointer(p)).FaMem, int64(uint32(nMem)*uint32(40))) - (*TVdbe)(unsafe.Pointer(p)).FaVar = _allocSpace(tls, bp+4, (*TVdbe)(unsafe.Pointer(p)).FaVar, int64(uint32(nVar)*uint32(40))) - (*TVdbe)(unsafe.Pointer(p)).FapArg = _allocSpace(tls, bp+4, (*TVdbe)(unsafe.Pointer(p)).FapArg, int64(uint32(*(*int32)(unsafe.Pointer(bp)))*uint32(4))) - (*TVdbe)(unsafe.Pointer(p)).FapCsr = _allocSpace(tls, bp+4, (*TVdbe)(unsafe.Pointer(p)).FapCsr, int64(uint32(nCursor)*uint32(4))) + (*TVdbe)(unsafe.Pointer(p)).FaMem = _allocSpace(tls, bp+4, (*TVdbe)(unsafe.Pointer(p)).FaMem, libc.Int64FromUint32(libc.Uint32FromInt32(nMem)*uint32(40))) + (*TVdbe)(unsafe.Pointer(p)).FaVar = _allocSpace(tls, bp+4, (*TVdbe)(unsafe.Pointer(p)).FaVar, libc.Int64FromUint32(libc.Uint32FromInt32(nVar)*uint32(40))) + (*TVdbe)(unsafe.Pointer(p)).FapArg = _allocSpace(tls, bp+4, (*TVdbe)(unsafe.Pointer(p)).FapArg, libc.Int64FromUint32(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))*uint32(4))) + (*TVdbe)(unsafe.Pointer(p)).FapCsr = _allocSpace(tls, bp+4, (*TVdbe)(unsafe.Pointer(p)).FapCsr, libc.Int64FromUint32(libc.Uint32FromInt32(nCursor)*uint32(4))) } } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -64099,7 +61123,7 @@ func _sqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { _initMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar, nVar, db, uint16(MEM_Null)) (*TVdbe)(unsafe.Pointer(p)).FnMem = nMem _initMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaMem, nMem, db, uint16(MEM_Undefined)) - libc.Xmemset(tls, (*TVdbe)(unsafe.Pointer(p)).FapCsr, 0, uint32(nCursor)*uint32(4)) + libc.Xmemset(tls, (*TVdbe)(unsafe.Pointer(p)).FapCsr, 0, libc.Uint32FromInt32(nCursor)*uint32(4)) } _sqlite3VdbeRewind(tls, p) } @@ -64120,7 +61144,6 @@ func _freeCursorWithCache(tls *libc.TLS, p uintptr, pCx uintptr) { var pCache uintptr _ = pCache pCache = (*TVdbeCursor)(unsafe.Pointer(pCx)).FpCache - _ = libc.Int32FromInt32(0) libc.SetBitFieldPtr8Uint32(pCx+8, libc.Uint32FromInt32(0), 4, 0x10) (*TVdbeCursor)(unsafe.Pointer(pCx)).FpCache = uintptr(0) if (*TVdbeTxtBlbCache)(unsafe.Pointer(pCache)).FpCValue != 0 { @@ -64138,16 +61161,14 @@ func _sqlite3VdbeFreeCursorNN(tls *libc.TLS, p uintptr, pCx uintptr) { _freeCursorWithCache(tls, p, pCx) return } - switch int32((*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType) { + switch libc.Int32FromUint8((*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType) { case int32(CURTYPE_SORTER): _sqlite3VdbeSorterClose(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, pCx) case CURTYPE_BTREE: - _ = libc.Int32FromInt32(0) _sqlite3BtreeCloseCursor(tls, *(*uintptr)(unsafe.Pointer(pCx + 36))) case int32(CURTYPE_VTAB): pVCur = *(*uintptr)(unsafe.Pointer(pCx + 36)) pModule = (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pVCur)).FpVtab)).FpModule - _ = libc.Int32FromInt32(0) (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pVCur)).FpVtab)).FnRef-- (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule)).FxClose})))(tls, pVCur) break @@ -64235,7 +61256,6 @@ func _closeAllCursors(tls *libc.TLS, p uintptr) { (*TVdbe)(unsafe.Pointer(p)).FpFrame = uintptr(0) (*TVdbe)(unsafe.Pointer(p)).FnFrame = 0 } - _ = libc.Int32FromInt32(0) _closeCursorsInFrame(tls, p) _releaseMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaMem, (*TVdbe)(unsafe.Pointer(p)).FnMem) for (*TVdbe)(unsafe.Pointer(p)).FpDelFrame != 0 { @@ -64247,7 +61267,6 @@ func _closeAllCursors(tls *libc.TLS, p uintptr) { if (*TVdbe)(unsafe.Pointer(p)).FpAuxData != 0 { _sqlite3VdbeDeleteAuxData(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, p+220, -int32(1), 0) } - _ = libc.Int32FromInt32(0) } // C documentation @@ -64265,14 +61284,14 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { _, _, _ = db, n, v1 db = (*TVdbe)(unsafe.Pointer(p)).Fdb if (*TVdbe)(unsafe.Pointer(p)).FnResAlloc != 0 { - _releaseMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaColName, int32((*TVdbe)(unsafe.Pointer(p)).FnResAlloc)*int32(COLNAME_N)) + _releaseMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaColName, libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc)*int32(COLNAME_N)) _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FaColName) } n = nResColumn * int32(COLNAME_N) - v1 = uint16(nResColumn) + v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(40)*uint32(n))) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(40)*libc.Uint32FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -64295,16 +61314,11 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa var pColName uintptr var rc int32 _, _ = pColName, rc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 { - _ = libc.Int32FromInt32(0) return int32(SQLITE_NOMEM) } - _ = libc.Int32FromInt32(0) - pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*int32((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*40 + pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*40 rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) - _ = libc.Int32FromInt32(0) return rc } @@ -64355,8 +61369,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { needXcommit = int32(1) _sqlite3BtreeEnter(tls, pBt) pPager = _sqlite3BtreePager(tls, pBt) - if int32((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).Fsafety_level) != int32(PAGER_SYNCHRONOUS_OFF) && _aMJNeeded[_sqlite3PagerGetJournalMode(tls, pPager)] != 0 && _sqlite3PagerIsMemdb(tls, pPager) == 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).Fsafety_level) != int32(PAGER_SYNCHRONOUS_OFF) && _aMJNeeded[_sqlite3PagerGetJournalMode(tls, pPager)] != 0 && _sqlite3PagerIsMemdb(tls, pPager) == 0 { nTrans++ } rc = _sqlite3PagerExclusiveLock(tls, pPager) @@ -64454,7 +61467,6 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5276, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 8))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ - _ = libc.Int32FromInt32(0) rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+4) } if rc == SQLITE_OK { @@ -64482,7 +61494,6 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if zFile == uintptr(0) { goto _4 /* Ignore TEMP and :memory: databases */ } - _ = libc.Int32FromInt32(0) rc = _sqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp)), zFile, _sqlite3Strlen30(tls, zFile)+int32(1), offset) offset += int64(_sqlite3Strlen30(tls, zFile) + int32(1)) if rc != SQLITE_OK { @@ -64535,7 +61546,6 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { i++ } _sqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp))) - _ = libc.Int32FromInt32(0) if rc != SQLITE_OK { _sqlite3DbFree(tls, db, zSuper-uintptr(4)) return rc @@ -64616,9 +61626,6 @@ func _vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) (r int32) { db = (*TVdbe)(unsafe.Pointer(p)).Fdb rc = SQLITE_OK iSavepoint = (*TVdbe)(unsafe.Pointer(p)).FiStatement - int32(1) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -64689,7 +61696,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)<<libc.Int32FromInt32(8) (*TVdbe)(unsafe.Pointer(p)).FerrorAction = uint8(OE_Abort) _sqlite3VdbeError(tls, p, __ccgo_ts+5289, 0) - if int32((*TVdbe)(unsafe.Pointer(p)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) == 0 { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) == 0 { return int32(SQLITE_ERROR) } return libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)<<libc.Int32FromInt32(8) @@ -64732,7 +61739,6 @@ func _sqlite3VdbeHalt(tls *libc.TLS, p uintptr) (r int32) { ** state. We need to rollback the statement transaction, if there is ** one, or the complete transaction if there is no statement transaction. */ - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -64780,7 +61786,7 @@ func _sqlite3VdbeHalt(tls *libc.TLS, p uintptr) (r int32) { } } /* Check for immediate foreign key violations. */ - if (*TVdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || int32((*TVdbe)(unsafe.Pointer(p)).FerrorAction) == int32(OE_Fail) && !(isSpecialError != 0) { + if (*TVdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FerrorAction) == int32(OE_Fail) && !(isSpecialError != 0) { _sqlite3VdbeCheckFk(tls, p, 0) } /* If the auto-commit flag is set and this is the only active writer @@ -64790,7 +61796,7 @@ func _sqlite3VdbeHalt(tls *libc.TLS, p uintptr) (r int32) { ** above has occurred. */ if !((*Tsqlite3)(unsafe.Pointer(db)).FnVTrans > 0 && (*Tsqlite3)(unsafe.Pointer(db)).FaVTrans == uintptr(0)) && (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeWrite == libc.BoolInt32(int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0x40>>6)) == 0) { - if (*TVdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || int32((*TVdbe)(unsafe.Pointer(p)).FerrorAction) == int32(OE_Fail) && !(isSpecialError != 0) { + if (*TVdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FerrorAction) == int32(OE_Fail) && !(isSpecialError != 0) { rc = _sqlite3VdbeCheckFk(tls, p, int32(1)) if rc != SQLITE_OK { if int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0x40>>6)) != 0 { @@ -64799,9 +61805,9 @@ func _sqlite3VdbeHalt(tls *libc.TLS, p uintptr) (r int32) { } rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)<<libc.Int32FromInt32(8) } else { - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00002))<<libc.Int32FromInt32(32)) != 0 { + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00002))<<libc.Int32FromInt32(32)) != 0 { rc = int32(SQLITE_CORRUPT) - *(*Tu64)(unsafe.Pointer(db + 28)) &= ^(uint64(libc.Int32FromInt32(0x00002)) << libc.Int32FromInt32(32)) + *(*Tu64)(unsafe.Pointer(db + 28)) &= ^(libc.Uint64FromInt32(libc.Int32FromInt32(0x00002)) << libc.Int32FromInt32(32)) } else { /* The auto-commit flag is true, the vdbe program was successful ** or hit an 'OR FAIL' constraint and there are no deferred foreign @@ -64837,10 +61843,10 @@ func _sqlite3VdbeHalt(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FnStatement = 0 } else { if eStatementOp == 0 { - if (*TVdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || int32((*TVdbe)(unsafe.Pointer(p)).FerrorAction) == int32(OE_Fail) { + if (*TVdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FerrorAction) == int32(OE_Fail) { eStatementOp = int32(SAVEPOINT_RELEASE) } else { - if int32((*TVdbe)(unsafe.Pointer(p)).FerrorAction) == int32(OE_Abort) { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FerrorAction) == int32(OE_Abort) { eStatementOp = int32(SAVEPOINT_ROLLBACK) } else { _sqlite3RollbackAll(tls, db, libc.Int32FromInt32(SQLITE_ABORT)|libc.Int32FromInt32(2)<<libc.Int32FromInt32(8)) @@ -64893,9 +61899,6 @@ func _sqlite3VdbeHalt(tls *libc.TLS, p uintptr) (r int32) { if int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0x80>>7)) != 0 { (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead-- } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).FeVdbeState = uint8(VDBE_HALT_STATE) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -64907,7 +61910,6 @@ func _sqlite3VdbeHalt(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0 { _sqlite3ConnectionUnlocked(tls, db) } - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).Frc == int32(SQLITE_BUSY) { v2 = int32(SQLITE_BUSY) } else { @@ -64982,7 +61984,7 @@ func _sqlite3VdbeReset(tls *libc.TLS, p uintptr) (r int32) { ** error, then it might not have been halted properly. So halt ** it now. */ - if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_RUN_STATE) { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_RUN_STATE) { _sqlite3VdbeHalt(tls, p) } /* If the VDBE has been run even partially, then transfer the error code @@ -65019,12 +62021,8 @@ func _sqlite3VdbeFinalize(tls *libc.TLS, p uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) >= int32(VDBE_READY_STATE) { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) >= int32(VDBE_READY_STATE) { rc = _sqlite3VdbeReset(tls, p) - _ = libc.Int32FromInt32(0) } _sqlite3VdbeDelete(tls, p) return rc @@ -65053,7 +62051,7 @@ func _sqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, _ = pAux for *(*uintptr)(unsafe.Pointer(pp)) != 0 { pAux = *(*uintptr)(unsafe.Pointer(pp)) - if iOp < 0 || (*TAuxData)(unsafe.Pointer(pAux)).FiAuxOp == iOp && (*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg >= 0 && ((*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg > int32(31) || !(uint32(mask)&(libc.Uint32FromInt32(1)<<(*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg) != 0)) { + if iOp < 0 || (*TAuxData)(unsafe.Pointer(pAux)).FiAuxOp == iOp && (*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg >= 0 && ((*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg > int32(31) || !(libc.Uint32FromInt32(mask)&(libc.Uint32FromInt32(1)<<(*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg) != 0)) { if (*TAuxData)(unsafe.Pointer(pAux)).FxDeleteAux != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TAuxData)(unsafe.Pointer(pAux)).FxDeleteAux})))(tls, (*TAuxData)(unsafe.Pointer(pAux)).FpAux) } @@ -65078,10 +62076,8 @@ func _sqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, func _sqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { var pNext, pSub uintptr _, _ = pNext, pSub - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).FaColName != 0 { - _releaseMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaColName, int32((*TVdbe)(unsafe.Pointer(p)).FnResAlloc)*int32(COLNAME_N)) + _releaseMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaColName, libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc)*int32(COLNAME_N)) _sqlite3DbNNFreeNN(tls, db, (*TVdbe)(unsafe.Pointer(p)).FaColName) } pSub = (*TVdbe)(unsafe.Pointer(p)).FpProgram @@ -65097,7 +62093,7 @@ func _sqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { ; pSub = pNext } - if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != VDBE_INIT_STATE { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != VDBE_INIT_STATE { _releaseMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar, int32((*TVdbe)(unsafe.Pointer(p)).FnVar)) if (*TVdbe)(unsafe.Pointer(p)).FpVList != 0 { _sqlite3DbNNFreeNN(tls, db, (*TVdbe)(unsafe.Pointer(p)).FpVList) @@ -65120,13 +62116,9 @@ func _sqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { func _sqlite3VdbeDelete(tls *libc.TLS, p uintptr) { var db uintptr _ = db - _ = libc.Int32FromInt32(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeClearObject(tls, db, p) if (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FppVPrev)) = (*TVdbe)(unsafe.Pointer(p)).FpVNext if (*TVdbe)(unsafe.Pointer(p)).FpVNext != 0 { (*TVdbe)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FpVNext)).FppVPrev = (*TVdbe)(unsafe.Pointer(p)).FppVPrev @@ -65148,9 +62140,6 @@ func _sqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) (r int32) { var rc int32 var _ /* res at bp+0 */ int32 _ = rc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(p + 36)), (*TVdbeCursor)(unsafe.Pointer(p)).FmovetoTarget, 0, bp) if rc != 0 { return rc @@ -65178,9 +62167,6 @@ func _sqlite3VdbeHandleMovedCursor(tls *libc.TLS, p uintptr) (r int32) { var rc int32 var _ /* isDifferentRow at bp+0 */ int32 _ = rc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeCursorRestore(tls, *(*uintptr)(unsafe.Pointer(p + 36)), bp) (*TVdbeCursor)(unsafe.Pointer(p)).FcacheStatus = uint32(CACHE_STALE) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -65196,7 +62182,6 @@ func _sqlite3VdbeHandleMovedCursor(tls *libc.TLS, p uintptr) (r int32) { // ** if need be. Return any I/O error from the restore operation. // */ func _sqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) if _sqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(p + 36))) != 0 { return _sqlite3VdbeHandleMovedCursor(tls, p) } @@ -65383,14 +62368,12 @@ func _sqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type Tu32) (r Tu32) { if serial_type >= uint32(128) { return (serial_type - uint32(12)) / uint32(2) } else { - _ = libc.Int32FromInt32(0) return uint32(_sqlite3SmallTypeSizes[serial_type]) } return r } func _sqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type Tu8) (r Tu8) { - _ = libc.Int32FromInt32(0) return _sqlite3SmallTypeSizes[serial_type] } @@ -65451,8 +62434,8 @@ func _serialGet(tls *libc.TLS, buf uintptr, serial_type Tu32, pMem uintptr) { var v1 int32 var _ /* x at bp+0 */ Tu64 _, _ = y, v1 - *(*Tu64)(unsafe.Pointer(bp)) = uint64(uint32(*(*uint8)(unsafe.Pointer(buf)))<<libc.Int32FromInt32(24) | uint32(int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*uint8)(unsafe.Pointer(buf + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*uint8)(unsafe.Pointer(buf + 3)))) - y = uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24) | uint32(int32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 3))) + *(*Tu64)(unsafe.Pointer(bp)) = uint64(uint32(*(*uint8)(unsafe.Pointer(buf)))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*uint8)(unsafe.Pointer(buf + 3)))) + y = uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 3))) *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(32) + uint64(y) if serial_type == uint32(6) { /* EVIDENCE-OF: R-29851-52272 Value is a big-endian 64-bit @@ -65462,14 +62445,13 @@ func _serialGet(tls *libc.TLS, buf uintptr, serial_type Tu32, pMem uintptr) { } else { /* EVIDENCE-OF: R-57343-49114 Value is a big-endian IEEE 754-2008 64-bit ** floating point number. */ - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, pMem, bp, uint32(8)) if *(*Tu64)(unsafe.Pointer(bp))&(libc.Uint64FromInt32(0x7ff)<<libc.Int32FromInt32(52)) == libc.Uint64FromInt32(0x7ff)<<libc.Int32FromInt32(52) && *(*Tu64)(unsafe.Pointer(bp))&(libc.Uint64FromInt32(1)<<libc.Int32FromInt32(52)-libc.Uint64FromInt32(1)) != uint64(0) { v1 = int32(MEM_Null) } else { v1 = int32(MEM_Real) } - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(v1) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(v1) } } @@ -65479,10 +62461,9 @@ func _serialGet7(tls *libc.TLS, buf uintptr, pMem uintptr) (r int32) { var y Tu32 var _ /* x at bp+0 */ Tu64 _ = y - *(*Tu64)(unsafe.Pointer(bp)) = uint64(uint32(*(*uint8)(unsafe.Pointer(buf)))<<libc.Int32FromInt32(24) | uint32(int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*uint8)(unsafe.Pointer(buf + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*uint8)(unsafe.Pointer(buf + 3)))) - y = uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24) | uint32(int32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 3))) + *(*Tu64)(unsafe.Pointer(bp)) = uint64(uint32(*(*uint8)(unsafe.Pointer(buf)))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*uint8)(unsafe.Pointer(buf + 3)))) + y = uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(4) + 3))) *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<<libc.Int32FromInt32(32) + uint64(y) - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, pMem, bp, uint32(8)) if *(*Tu64)(unsafe.Pointer(bp))&(libc.Uint64FromInt32(0x7ff)<<libc.Int32FromInt32(52)) == libc.Uint64FromInt32(0x7ff)<<libc.Int32FromInt32(52) && *(*Tu64)(unsafe.Pointer(bp))&(libc.Uint64FromInt32(1)<<libc.Int32FromInt32(52)-libc.Uint64FromInt32(1)) != uint64(0) { (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) @@ -65496,7 +62477,7 @@ func _sqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type Tu32, pMem ui switch serial_type { case uint32(10): /* Internal use only: NULL with virtual table ** UPDATE no-change flag set */ - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) + (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) (*TMem)(unsafe.Pointer(pMem)).Fn = 0 *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)) = 0 return @@ -65509,31 +62490,31 @@ func _sqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type Tu32, pMem ui case uint32(1): /* EVIDENCE-OF: R-44885-25196 Value is an 8-bit twos-complement ** integer. */ - *(*Ti64)(unsafe.Pointer(pMem)) = int64(int8(*(*uint8)(unsafe.Pointer(buf)))) + *(*Ti64)(unsafe.Pointer(pMem)) = int64(libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(buf)))) (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Int) return case uint32(2): /* 2-byte signed integer */ /* EVIDENCE-OF: R-49794-35026 Value is a big-endian 16-bit ** twos-complement integer. */ - *(*Ti64)(unsafe.Pointer(pMem)) = int64(libc.Int32FromInt32(256)*int32(int8(*(*uint8)(unsafe.Pointer(buf)))) | int32(*(*uint8)(unsafe.Pointer(buf + 1)))) + *(*Ti64)(unsafe.Pointer(pMem)) = int64(libc.Int32FromInt32(256)*int32(libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(buf)))) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 1)))) (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Int) return case uint32(3): /* 3-byte signed integer */ /* EVIDENCE-OF: R-37839-54301 Value is a big-endian 24-bit ** twos-complement integer. */ - *(*Ti64)(unsafe.Pointer(pMem)) = int64(libc.Int32FromInt32(65536)*int32(int8(*(*uint8)(unsafe.Pointer(buf)))) | int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<libc.Int32FromInt32(8) | int32(*(*uint8)(unsafe.Pointer(buf + 2)))) + *(*Ti64)(unsafe.Pointer(pMem)) = int64(libc.Int32FromInt32(65536)*int32(libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(buf)))) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 1)))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 2)))) (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Int) return case uint32(4): /* 4-byte signed integer */ /* EVIDENCE-OF: R-01849-26079 Value is a big-endian 32-bit ** twos-complement integer. */ - *(*Ti64)(unsafe.Pointer(pMem)) = int64(libc.Int32FromInt32(16777216)*int32(int8(*(*uint8)(unsafe.Pointer(buf)))) | int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<libc.Int32FromInt32(16) | int32(*(*uint8)(unsafe.Pointer(buf + 2)))<<libc.Int32FromInt32(8) | int32(*(*uint8)(unsafe.Pointer(buf + 3)))) + *(*Ti64)(unsafe.Pointer(pMem)) = int64(libc.Int32FromInt32(16777216)*int32(libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(buf)))) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 1)))<<libc.Int32FromInt32(16) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 2)))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 3)))) (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Int) return case uint32(5): /* 6-byte signed integer */ /* EVIDENCE-OF: R-50385-09674 Value is a big-endian 48-bit ** twos-complement integer. */ - *(*Ti64)(unsafe.Pointer(pMem)) = int64(uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(2))))<<libc.Int32FromInt32(24)|uint32(int32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(2) + 1)))<<libc.Int32FromInt32(16))|uint32(int32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(2) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(2) + 3)))) + libc.Int64FromInt32(1)<<libc.Int32FromInt32(32)*int64(libc.Int32FromInt32(256)*int32(int8(*(*uint8)(unsafe.Pointer(buf))))|int32(*(*uint8)(unsafe.Pointer(buf + 1)))) + *(*Ti64)(unsafe.Pointer(pMem)) = libc.Int64FromUint32(uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(2))))<<libc.Int32FromInt32(24)|libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(2) + 1)))<<libc.Int32FromInt32(16))|libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(2) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*uint8)(unsafe.Pointer(buf + libc.UintptrFromInt32(2) + 3)))) + libc.Int64FromInt32(1)<<libc.Int32FromInt32(32)*int64(libc.Int32FromInt32(256)*int32(libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(buf))))|libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buf + 1)))) (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Int) return case uint32(6): /* 8-byte signed integer */ @@ -65548,12 +62529,12 @@ func _sqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type Tu32, pMem ui case uint32(9): /* Integer 1 */ /* EVIDENCE-OF: R-12976-22893 Value is the integer 0. */ /* EVIDENCE-OF: R-18143-12121 Value is the integer 1. */ - *(*Ti64)(unsafe.Pointer(pMem)) = int64(serial_type - uint32(8)) + *(*Ti64)(unsafe.Pointer(pMem)) = libc.Int64FromUint32(serial_type - uint32(8)) (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Int) return default: (*TMem)(unsafe.Pointer(pMem)).Fz = buf - (*TMem)(unsafe.Pointer(pMem)).Fn = int32((serial_type - uint32(12)) / uint32(2)) + (*TMem)(unsafe.Pointer(pMem)).Fn = libc.Int32FromUint32((serial_type - uint32(12)) / uint32(2)) (*TMem)(unsafe.Pointer(pMem)).Fflags = _aFlag[serial_type&uint32(1)] return } @@ -65565,8 +62546,8 @@ func _sqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type Tu32, pMem ui ** EVIDENCE-OF: R-28401-00140 Value is a string in the text encoding and ** (N-13)/2 bytes in length. */ var _aFlag = [2]Tu16{ - 0: uint16(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Ephem)), - 1: uint16(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Ephem)), + 0: libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Ephem)), + 1: libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Ephem)), } // C documentation @@ -65589,15 +62570,14 @@ func _sqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) (r uintptr var nByte int32 var p uintptr _, _ = nByte, p /* Number of bytes required for *p */ - nByte = int32((libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7)) + uint32(40)*uint32(int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)+libc.Int32FromInt32(1))) - p = _sqlite3DbMallocRaw(tls, (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb, uint64(nByte)) + nByte = libc.Int32FromUint32((libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + uint32(40)*libc.Uint32FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)+libc.Int32FromInt32(1))) + p = _sqlite3DbMallocRaw(tls, (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb, libc.Uint64FromInt32(nByte)) if !(p != 0) { return uintptr(0) } - (*TUnpackedRecord)(unsafe.Pointer(p)).FaMem = p + uintptr((libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) - _ = libc.Int32FromInt32(0) + (*TUnpackedRecord)(unsafe.Pointer(p)).FaMem = p + uintptr((libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) (*TUnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo = pKeyInfo - (*TUnpackedRecord)(unsafe.Pointer(p)).FnField = uint16(int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + int32(1)) + (*TUnpackedRecord)(unsafe.Pointer(p)).FnField = libc.Uint16FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + int32(1)) return p } @@ -65621,24 +62601,23 @@ func _sqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey aKey = pKey pMem = (*TUnpackedRecord)(unsafe.Pointer(p)).FaMem (*TUnpackedRecord)(unsafe.Pointer(p)).Fdefault_rc = 0 - _ = libc.Int32FromInt32(0) - if int32(*(*uint8)(unsafe.Pointer(aKey))) < int32(libc.Uint8FromInt32(0x80)) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aKey))) < libc.Int32FromUint8(libc.Uint8FromInt32(0x80)) { *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*uint8)(unsafe.Pointer(aKey))) v1 = libc.Int32FromInt32(1) } else { - v1 = int32(_sqlite3GetVarint32(tls, aKey, bp)) + v1 = libc.Int32FromUint8(_sqlite3GetVarint32(tls, aKey, bp)) } - idx = uint32(uint8(v1)) + idx = uint32(libc.Uint8FromInt32(v1)) d = *(*Tu32)(unsafe.Pointer(bp)) u = uint16(0) - for idx < *(*Tu32)(unsafe.Pointer(bp)) && d <= uint32(nKey) { - if int32(*(*uint8)(unsafe.Pointer(aKey + uintptr(idx)))) < int32(libc.Uint8FromInt32(0x80)) { + for idx < *(*Tu32)(unsafe.Pointer(bp)) && d <= libc.Uint32FromInt32(nKey) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aKey + uintptr(idx)))) < libc.Int32FromUint8(libc.Uint8FromInt32(0x80)) { *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(*(*uint8)(unsafe.Pointer(aKey + uintptr(idx)))) v2 = libc.Int32FromInt32(1) } else { - v2 = int32(_sqlite3GetVarint32(tls, aKey+uintptr(idx), bp+4)) + v2 = libc.Int32FromUint8(_sqlite3GetVarint32(tls, aKey+uintptr(idx), bp+4)) } - idx += uint32(uint8(v2)) + idx += uint32(libc.Uint8FromInt32(v2)) (*TMem)(unsafe.Pointer(pMem)).Fenc = (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc (*TMem)(unsafe.Pointer(pMem)).Fdb = (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb /* pMem->flags = 0; // sqlite3VdbeSerialGet() will set this for us */ @@ -65649,18 +62628,16 @@ func _sqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey pMem += 40 u++ v3 = u - if int32(v3) >= int32((*TUnpackedRecord)(unsafe.Pointer(p)).FnField) { + if libc.Int32FromUint16(v3) >= libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(p)).FnField) { break } } - if d > uint32(nKey) && u != 0 { - _ = libc.Int32FromInt32(0) + if d > libc.Uint32FromInt32(nKey) && u != 0 { /* In a corrupt record entry, the last pMem might have been set up using ** uninitialized memory. Overwrite its value with NULL, to prevent ** warnings from MSAN. */ _sqlite3VdbeMemSetNull(tls, pMem-uintptr(1)*40) } - _ = libc.Int32FromInt32(0) (*TUnpackedRecord)(unsafe.Pointer(p)).FnField = u } @@ -65680,7 +62657,7 @@ func _vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl ui var _ /* c1 at bp+0 */ TMem var _ /* c2 at bp+40 */ TMem _, _, _ = rc, v1, v2 - if int32((*TMem)(unsafe.Pointer(pMem1)).Fenc) == int32((*TCollSeq)(unsafe.Pointer(pColl)).Fenc) { + if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem1)).Fenc) == libc.Int32FromUint8((*TCollSeq)(unsafe.Pointer(pColl)).Fenc) { /* The strings are already in the correct encoding. Call the ** comparison function directly */ return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TCollSeq)(unsafe.Pointer(pColl)).FxCmp})))(tls, (*TCollSeq)(unsafe.Pointer(pColl)).FpUser, (*TMem)(unsafe.Pointer(pMem1)).Fn, (*TMem)(unsafe.Pointer(pMem1)).Fz, (*TMem)(unsafe.Pointer(pMem2)).Fn, (*TMem)(unsafe.Pointer(pMem2)).Fz) @@ -65747,13 +62724,11 @@ func _sqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) (r int32) { ** followed by zero content. But that only comes up for Blobs formed ** by the OP_MakeRecord opcode, and such Blobs never get passed into ** sqlite3MemCompare(). */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (int32((*TMem)(unsafe.Pointer(pB1)).Fflags)|int32((*TMem)(unsafe.Pointer(pB2)).Fflags))&int32(MEM_Zero) != 0 { - if int32((*TMem)(unsafe.Pointer(pB1)).Fflags)&int32((*TMem)(unsafe.Pointer(pB2)).Fflags)&int32(MEM_Zero) != 0 { + if (libc.Int32FromUint16((*TMem)(unsafe.Pointer(pB1)).Fflags)|libc.Int32FromUint16((*TMem)(unsafe.Pointer(pB2)).Fflags))&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pB1)).Fflags)&libc.Int32FromUint16((*TMem)(unsafe.Pointer(pB2)).Fflags)&int32(MEM_Zero) != 0 { return *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pB1)).Fu)) - *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pB2)).Fu)) } else { - if int32((*TMem)(unsafe.Pointer(pB1)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pB1)).Fflags)&int32(MEM_Zero) != 0 { if !(_isAllZero(tls, (*TMem)(unsafe.Pointer(pB2)).Fz, (*TMem)(unsafe.Pointer(pB2)).Fn) != 0) { return -int32(1) } @@ -65771,7 +62746,7 @@ func _sqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) (r int32) { } else { v1 = n1 } - c = libc.Xmemcmp(tls, (*TMem)(unsafe.Pointer(pB1)).Fz, (*TMem)(unsafe.Pointer(pB2)).Fz, uint32(v1)) + c = libc.Xmemcmp(tls, (*TMem)(unsafe.Pointer(pB1)).Fz, (*TMem)(unsafe.Pointer(pB2)).Fz, libc.Uint32FromInt32(v1)) if c != 0 { return c } @@ -65847,10 +62822,9 @@ func _sqlite3IntFloatCompare(tls *libc.TLS, i Ti64, r float64) (r1 int32) { func _sqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) (r int32) { var combined_flags, f1, f2 int32 _, _, _ = combined_flags, f1, f2 - f1 = int32((*TMem)(unsafe.Pointer(pMem1)).Fflags) - f2 = int32((*TMem)(unsafe.Pointer(pMem2)).Fflags) + f1 = libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem1)).Fflags) + f2 = libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem2)).Fflags) combined_flags = f1 | f2 - _ = libc.Int32FromInt32(0) /* If one value is NULL, it is less than the other. If both values ** are NULL, return 0. */ @@ -65914,13 +62888,10 @@ func _sqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintp if f2&int32(MEM_Str) == 0 { return -int32(1) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The collation sequence must be defined at this point, even if ** the user deletes the collation sequence after the vdbe program is ** compiled (this was not always the case). */ - _ = libc.Int32FromInt32(0) if pColl != 0 { return _vdbeCompareMemString(tls, pMem1, pMem2, pColl, uintptr(0)) } @@ -65945,27 +62916,26 @@ func _vdbeRecordDecodeInt(tls *libc.TLS, serial_type Tu32, aKey uintptr) (r Ti64 defer tls.Free(16) var _ /* x at bp+8 */ Tu64 var _ /* y at bp+0 */ Tu32 - _ = libc.Int32FromInt32(0) switch serial_type { case uint32(0): fallthrough case uint32(1): - return int64(int8(*(*Tu8)(unsafe.Pointer(aKey)))) + return int64(libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(aKey)))) case uint32(2): - return int64(libc.Int32FromInt32(256)*int32(int8(*(*Tu8)(unsafe.Pointer(aKey)))) | int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))) + return int64(libc.Int32FromInt32(256)*int32(libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(aKey)))) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))) case uint32(3): - return int64(libc.Int32FromInt32(65536)*int32(int8(*(*Tu8)(unsafe.Pointer(aKey)))) | int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(8) | int32(*(*Tu8)(unsafe.Pointer(aKey + 2)))) + return int64(libc.Int32FromInt32(65536)*int32(libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(aKey)))) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 2)))) case uint32(4): - *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(aKey)))<<libc.Int32FromInt32(24) | uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aKey + 3))) + *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(aKey)))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aKey + 3))) return int64(*(*int32)(unsafe.Pointer(bp))) case uint32(5): - return int64(uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2))))<<libc.Int32FromInt32(24)|uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 1)))<<libc.Int32FromInt32(16))|uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 3)))) + libc.Int64FromInt32(1)<<libc.Int32FromInt32(32)*int64(libc.Int32FromInt32(256)*int32(int8(*(*Tu8)(unsafe.Pointer(aKey))))|int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))) + return libc.Int64FromUint32(uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2))))<<libc.Int32FromInt32(24)|libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 1)))<<libc.Int32FromInt32(16))|libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 3)))) + libc.Int64FromInt32(1)<<libc.Int32FromInt32(32)*int64(libc.Int32FromInt32(256)*int32(libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(aKey))))|libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))) case uint32(6): - *(*Tu64)(unsafe.Pointer(bp + 8)) = uint64(uint32(*(*Tu8)(unsafe.Pointer(aKey)))<<libc.Int32FromInt32(24) | uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aKey + 3)))) - *(*Tu64)(unsafe.Pointer(bp + 8)) = *(*Tu64)(unsafe.Pointer(bp + 8))<<libc.Int32FromInt32(32) | uint64(uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24)|uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16))|uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 3)))) + *(*Tu64)(unsafe.Pointer(bp + 8)) = uint64(uint32(*(*Tu8)(unsafe.Pointer(aKey)))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aKey + 3)))) + *(*Tu64)(unsafe.Pointer(bp + 8)) = *(*Tu64)(unsafe.Pointer(bp + 8))<<libc.Int32FromInt32(32) | uint64(uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24)|libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16))|libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 3)))) return *(*Ti64)(unsafe.Pointer(bp + 8)) } - return int64(serial_type - libc.Uint32FromInt32(8)) + return libc.Int64FromUint32(serial_type - libc.Uint32FromInt32(8)) } // C documentation @@ -66015,7 +62985,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr if *(*Tu32)(unsafe.Pointer(bp + 44)) < uint32(0x80) { idx1 = uint32(2) } else { - idx1 = uint32(int32(1) + int32(_sqlite3GetVarint32(tls, aKey1+1, bp+44))) + idx1 = libc.Uint32FromInt32(int32(1) + libc.Int32FromUint8(_sqlite3GetVarint32(tls, aKey1+1, bp+44))) } *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*uint8)(unsafe.Pointer(aKey1))) d1 = *(*Tu32)(unsafe.Pointer(bp)) + _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp + 44))) @@ -66032,18 +63002,14 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr d1 = *(*Tu32)(unsafe.Pointer(bp)) i = 0 } - if d1 > uint32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89580))) + if d1 > libc.Uint32FromInt32(nKey1) { + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89580))) return 0 /* Corruption */ } /* Only needed by assert() statements */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for int32(1) != 0 { /* RHS is an integer */ - if int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { *(*Tu32)(unsafe.Pointer(bp + 48)) = uint32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1)))) if *(*Tu32)(unsafe.Pointer(bp + 48)) >= uint32(10) { if *(*Tu32)(unsafe.Pointer(bp + 48)) == uint32(10) { @@ -66073,7 +63039,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } } } else { - if int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Real) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Real) != 0 { *(*Tu32)(unsafe.Pointer(bp + 48)) = uint32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1)))) if *(*Tu32)(unsafe.Pointer(bp + 48)) >= uint32(10) { /* Serial types 12 or greater are strings and blobs (greater than @@ -66100,7 +63066,6 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr if *(*float64)(unsafe.Pointer(bp + 4)) > *(*float64)(unsafe.Pointer(pRhs)) { rc = +libc.Int32FromInt32(1) } else { - _ = libc.Int32FromInt32(0) } } } @@ -66111,7 +63076,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } } } else { - if int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Str) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Str) != 0 { *(*Tu32)(unsafe.Pointer(bp + 48)) = uint32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1)))) if *(*Tu32)(unsafe.Pointer(bp + 48)) >= uint32(0x80) { _sqlite3GetVarint32(tls, aKey1+uintptr(idx1), bp+48) @@ -66122,13 +63087,13 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr if !(*(*Tu32)(unsafe.Pointer(bp + 48))&libc.Uint32FromInt32(0x01) != 0) { rc = +libc.Int32FromInt32(1) } else { - (*(*TMem)(unsafe.Pointer(bp + 4))).Fn = int32((*(*Tu32)(unsafe.Pointer(bp + 48)) - uint32(12)) / uint32(2)) - if v5 = d1+uint32((*(*TMem)(unsafe.Pointer(bp + 4))).Fn) > uint32(nKey1); !v5 { + (*(*TMem)(unsafe.Pointer(bp + 4))).Fn = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 48)) - uint32(12)) / uint32(2)) + if v5 = d1+libc.Uint32FromInt32((*(*TMem)(unsafe.Pointer(bp + 4))).Fn) > libc.Uint32FromInt32(nKey1); !v5 { v4 = (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo pKeyInfo = v4 } - if v5 || int32((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89661))) + if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89661))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) != 0 { @@ -66144,7 +63109,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr v6 = (*TMem)(unsafe.Pointer(pRhs)).Fn } nCmp = v6 - rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*TMem)(unsafe.Pointer(pRhs)).Fz, uint32(nCmp)) + rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*TMem)(unsafe.Pointer(pRhs)).Fz, libc.Uint32FromInt32(nCmp)) if rc == 0 { rc = (*(*TMem)(unsafe.Pointer(bp + 4))).Fn - (*TMem)(unsafe.Pointer(pRhs)).Fn } @@ -66153,8 +63118,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } } } else { - if int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Blob) != 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Blob) != 0 { *(*Tu32)(unsafe.Pointer(bp + 48)) = uint32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1)))) if *(*Tu32)(unsafe.Pointer(bp + 48)) >= uint32(0x80) { _sqlite3GetVarint32(tls, aKey1+uintptr(idx1), bp+48) @@ -66162,12 +63126,12 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr if *(*Tu32)(unsafe.Pointer(bp + 48)) < uint32(12) || *(*Tu32)(unsafe.Pointer(bp + 48))&uint32(0x01) != 0 { rc = -int32(1) } else { - nStr = int32((*(*Tu32)(unsafe.Pointer(bp + 48)) - uint32(12)) / uint32(2)) - if d1+uint32(nStr) > uint32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89691))) + nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 48)) - uint32(12)) / uint32(2)) + if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89691))) return 0 /* Corruption */ } else { - if int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { if !(_isAllZero(tls, aKey1+uintptr(d1), nStr) != 0) { rc = int32(1) } else { @@ -66180,7 +63144,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr v7 = (*TMem)(unsafe.Pointer(pRhs)).Fn } nCmp1 = v7 - rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*TMem)(unsafe.Pointer(pRhs)).Fz, uint32(nCmp1)) + rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*TMem)(unsafe.Pointer(pRhs)).Fz, libc.Uint32FromInt32(nCmp1)) if rc == 0 { rc = nStr - (*TMem)(unsafe.Pointer(pRhs)).Fn } @@ -66190,7 +63154,6 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { *(*Tu32)(unsafe.Pointer(bp + 48)) = uint32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1)))) if *(*Tu32)(unsafe.Pointer(bp + 48)) == uint32(0) || *(*Tu32)(unsafe.Pointer(bp + 48)) == uint32(10) || *(*Tu32)(unsafe.Pointer(bp + 48)) == uint32(7) && _serialGet7(tls, aKey1+uintptr(d1), bp+4) != 0 { - _ = libc.Int32FromInt32(0) } else { rc = int32(1) } @@ -66199,39 +63162,36 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } } if rc != 0 { - sortFlags = int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo)).FaSortFlags + uintptr(i)))) + sortFlags = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo)).FaSortFlags + uintptr(i)))) if sortFlags != 0 { - if sortFlags&int32(KEYINFO_ORDER_BIGNULL) == 0 || sortFlags&int32(KEYINFO_ORDER_DESC) != libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp + 48)) == uint32(0) || int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Null) != 0) { + if sortFlags&int32(KEYINFO_ORDER_BIGNULL) == 0 || sortFlags&int32(KEYINFO_ORDER_DESC) != libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp + 48)) == uint32(0) || libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Null) != 0) { rc = -rc } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* See comment below */ + /* See comment below */ return rc } i++ - if i == int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) { + if i == libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) { break } pRhs += 40 d1 += _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp + 48))) - if d1 > uint32(nKey1) { + if d1 > libc.Uint32FromInt32(nKey1) { break } - idx1 += uint32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 48))))) + idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 48))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89742))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89742))) return 0 /* Corrupt index */ } } /* No memory allocation is ever used on mem1. Prove this using ** the following assert(). If the assert() fails, it indicates a ** memory leak and a need to call sqlite3VdbeMemRelease(&mem1). */ - _ = libc.Int32FromInt32(0) /* rc==0 here means that one or both of the keys ran out of fields and ** all the fields up to that point were equal. Return the default_rc ** value. */ - _ = libc.Int32FromInt32(0) (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FeqSeen = uint8(1) return int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fdefault_rc) } @@ -66260,24 +63220,23 @@ func _vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uin var _ /* x at bp+8 */ Tu64 var _ /* y at bp+0 */ Tu32 _, _, _, _, _ = aKey, lhs, res, serial_type, v - aKey = pKey1 + uintptr(int32(*(*Tu8)(unsafe.Pointer(pKey1)))&int32(0x3F)) - serial_type = int32(*(*Tu8)(unsafe.Pointer(pKey1 + 1))) - _ = libc.Int32FromInt32(0) + aKey = pKey1 + uintptr(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pKey1)))&int32(0x3F)) + serial_type = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pKey1 + 1))) switch serial_type { case int32(1): /* 1-byte signed integer */ - lhs = int64(int8(*(*Tu8)(unsafe.Pointer(aKey)))) + lhs = int64(libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(aKey)))) case int32(2): /* 2-byte signed integer */ - lhs = int64(libc.Int32FromInt32(256)*int32(int8(*(*Tu8)(unsafe.Pointer(aKey)))) | int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))) + lhs = int64(libc.Int32FromInt32(256)*int32(libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(aKey)))) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))) case int32(3): /* 3-byte signed integer */ - lhs = int64(libc.Int32FromInt32(65536)*int32(int8(*(*Tu8)(unsafe.Pointer(aKey)))) | int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(8) | int32(*(*Tu8)(unsafe.Pointer(aKey + 2)))) + lhs = int64(libc.Int32FromInt32(65536)*int32(libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(aKey)))) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 2)))) case int32(4): /* 4-byte signed integer */ - *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(aKey)))<<libc.Int32FromInt32(24) | uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aKey + 3))) + *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(aKey)))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aKey + 3))) lhs = int64(*(*int32)(unsafe.Pointer(bp))) case int32(5): /* 6-byte signed integer */ - lhs = int64(uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2))))<<libc.Int32FromInt32(24)|uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 1)))<<libc.Int32FromInt32(16))|uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 3)))) + libc.Int64FromInt32(1)<<libc.Int32FromInt32(32)*int64(libc.Int32FromInt32(256)*int32(int8(*(*Tu8)(unsafe.Pointer(aKey))))|int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))) + lhs = libc.Int64FromUint32(uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2))))<<libc.Int32FromInt32(24)|libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 1)))<<libc.Int32FromInt32(16))|libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(2) + 3)))) + libc.Int64FromInt32(1)<<libc.Int32FromInt32(32)*int64(libc.Int32FromInt32(256)*int32(libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(aKey))))|libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))) case int32(6): /* 8-byte signed integer */ - *(*Tu64)(unsafe.Pointer(bp + 8)) = uint64(uint32(*(*Tu8)(unsafe.Pointer(aKey)))<<libc.Int32FromInt32(24) | uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aKey + 3)))) - *(*Tu64)(unsafe.Pointer(bp + 8)) = *(*Tu64)(unsafe.Pointer(bp + 8))<<libc.Int32FromInt32(32) | uint64(uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24)|uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16))|uint32(int32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 3)))) + *(*Tu64)(unsafe.Pointer(bp + 8)) = uint64(uint32(*(*Tu8)(unsafe.Pointer(aKey)))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aKey + 3)))) + *(*Tu64)(unsafe.Pointer(bp + 8)) = *(*Tu64)(unsafe.Pointer(bp + 8))<<libc.Int32FromInt32(32) | uint64(uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24)|libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16))|libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8))|uint32(*(*Tu8)(unsafe.Pointer(aKey + libc.UintptrFromInt32(4) + 3)))) lhs = *(*Ti64)(unsafe.Pointer(bp + 8)) case int32(8): lhs = 0 @@ -66298,7 +63257,6 @@ func _vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uin default: return _sqlite3VdbeRecordCompare(tls, nKey1, pKey1, pPKey2) } - _ = libc.Int32FromInt32(0) v = *(*Ti64)(unsafe.Pointer(pPKey2 + 8)) if v > lhs { res = int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fr1) @@ -66306,7 +63264,7 @@ func _vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uin if v < lhs { res = int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2) } else { - if int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) > int32(1) { + if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) > int32(1) { /* The first fields of the two keys are equal. Compare the trailing ** fields. */ res = _sqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, int32(1)) @@ -66318,7 +63276,6 @@ func _vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uin } } } - _ = libc.Int32FromInt32(0) return res } @@ -66338,10 +63295,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 var _ /* serial_type at bp+0 */ int32 _, _, _, _, _, _ = aKey1, nCmp, nStr, res, szHdr, v1 aKey1 = pKey1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + *(*int32)(unsafe.Pointer(bp)) = int32(libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) goto vrcs_restart vrcs_restart: ; @@ -66351,17 +63305,16 @@ vrcs_restart: if *(*int32)(unsafe.Pointer(bp)) >= int32(12) { goto vrcs_restart } - _ = libc.Int32FromInt32(0) } res = int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fr1) /* (pKey1/nKey1) is a number or a null */ } else { if !(*(*int32)(unsafe.Pointer(bp))&libc.Int32FromInt32(0x01) != 0) { res = int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2) /* (pKey1/nKey1) is a blob */ } else { - szHdr = int32(*(*Tu8)(unsafe.Pointer(aKey1))) + szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89905))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89905))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -66370,7 +63323,7 @@ vrcs_restart: v1 = nStr } nCmp = v1 - res = libc.Xmemcmp(tls, aKey1+uintptr(szHdr), (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fu.Fz, uint32(nCmp)) + res = libc.Xmemcmp(tls, aKey1+uintptr(szHdr), (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fu.Fz, libc.Uint32FromInt32(nCmp)) if res > 0 { res = int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2) } else { @@ -66379,7 +63332,7 @@ vrcs_restart: } else { res = nStr - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn if res == 0 { - if int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) > int32(1) { + if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) > int32(1) { res = _sqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, int32(1)) } else { res = int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fdefault_rc) @@ -66396,7 +63349,6 @@ vrcs_restart: } } } - _ = libc.Int32FromInt32(0) return res } @@ -66423,10 +63375,10 @@ func _sqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) (r TRecordCompare) { ** The easiest way to enforce this limit is to consider only records with ** 13 fields or less. If the first field is an integer, the maximum legal ** header size is (12*5 + 1 + 1) bytes. */ - if int32((*TKeyInfo)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FnAllField) <= int32(13) { - flags = int32((*(*TMem)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FaMem))).Fflags) + if libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FnAllField) <= int32(13) { + flags = libc.Int32FromUint16((*(*TMem)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FaMem))).Fflags) if *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags)) != 0 { - if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags)))&int32(KEYINFO_ORDER_BIGNULL) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags)))&int32(KEYINFO_ORDER_BIGNULL) != 0 { return __ccgo_fp(_sqlite3VdbeRecordCompare) } (*TUnpackedRecord)(unsafe.Pointer(p)).Fr1 = int8(1) @@ -66440,7 +63392,6 @@ func _sqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) (r TRecordCompare) { return __ccgo_fp(_vdbeRecordCompareInt) } if flags&(libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Null)|libc.Int32FromInt32(MEM_Blob)) == 0 && *(*uintptr)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo + 20)) == uintptr(0) { - _ = libc.Int32FromInt32(0) (*TUnpackedRecord)(unsafe.Pointer(p)).Fu.Fz = (*(*TMem)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FaMem))).Fz (*TUnpackedRecord)(unsafe.Pointer(p)).Fn = (*(*TMem)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(p)).FaMem))).Fn return __ccgo_fp(_vdbeRecordCompareString) @@ -66476,12 +63427,10 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr ** Any corruption is detected in sqlite3BtreeParseCellPtr(), though, so ** this code can safely assume that nCellKey is 32-bits */ - _ = libc.Int32FromInt32(0) - nCellKey = int64(_sqlite3BtreePayloadSize(tls, pCur)) - _ = libc.Int32FromInt32(0) + nCellKey = libc.Int64FromUint32(_sqlite3BtreePayloadSize(tls, pCur)) /* Read in the complete content of the index entry */ _sqlite3VdbeMemInit(tls, bp+8, db, uint16(0)) - rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(nCellKey), bp+8) + rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp+8) if rc != 0 { return rc } @@ -66490,8 +63439,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr if *(*Tu32)(unsafe.Pointer(bp)) >= uint32(0x80) { _sqlite3GetVarint32(tls, (*(*TMem)(unsafe.Pointer(bp + 8))).Fz, bp) } - _ = libc.Int32FromInt32(0) - if *(*Tu32)(unsafe.Pointer(bp)) < uint32(3) || *(*Tu32)(unsafe.Pointer(bp)) > uint32((*(*TMem)(unsafe.Pointer(bp + 8))).Fn) { + if *(*Tu32)(unsafe.Pointer(bp)) < uint32(3) || *(*Tu32)(unsafe.Pointer(bp)) > libc.Uint32FromInt32((*(*TMem)(unsafe.Pointer(bp + 8))).Fn) { goto idx_rowid_corruption } /* The last field of the index should be an integer - the ROWID. @@ -66504,11 +63452,11 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr goto idx_rowid_corruption } lenRowid = uint32(_sqlite3SmallTypeSizes[*(*Tu32)(unsafe.Pointer(bp + 4))]) - if uint32((*(*TMem)(unsafe.Pointer(bp + 8))).Fn) < *(*Tu32)(unsafe.Pointer(bp))+lenRowid { + if libc.Uint32FromInt32((*(*TMem)(unsafe.Pointer(bp + 8))).Fn) < *(*Tu32)(unsafe.Pointer(bp))+lenRowid { goto idx_rowid_corruption } /* Fetch the integer off the end of the index record */ - _sqlite3VdbeSerialGet(tls, (*(*TMem)(unsafe.Pointer(bp + 8))).Fz+uintptr(uint32((*(*TMem)(unsafe.Pointer(bp + 8))).Fn)-lenRowid), *(*Tu32)(unsafe.Pointer(bp + 4)), bp+48) + _sqlite3VdbeSerialGet(tls, (*(*TMem)(unsafe.Pointer(bp + 8))).Fz+uintptr(libc.Uint32FromInt32((*(*TMem)(unsafe.Pointer(bp + 8))).Fn)-lenRowid), *(*Tu32)(unsafe.Pointer(bp + 4)), bp+48) *(*Ti64)(unsafe.Pointer(rowid)) = *(*Ti64)(unsafe.Pointer(bp + 48)) _sqlite3VdbeMemReleaseMalloc(tls, bp+8) return SQLITE_OK @@ -66543,10 +63491,8 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked var _ /* m at bp+0 */ TMem _, _, _ = nCellKey, pCur, rc nCellKey = 0 - _ = libc.Int32FromInt32(0) pCur = *(*uintptr)(unsafe.Pointer(pC + 36)) - _ = libc.Int32FromInt32(0) - nCellKey = int64(_sqlite3BtreePayloadSize(tls, pCur)) + nCellKey = libc.Int64FromUint32(_sqlite3BtreePayloadSize(tls, pCur)) /* nCellKey will always be between 0 and 0xffffffff because of the way ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { @@ -66554,7 +63500,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked return _sqlite3CorruptError(tls, int32(90096)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) - rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(nCellKey), bp) + rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) if rc != 0 { return rc } @@ -66570,7 +63516,6 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked // ** sqlite3_changes() on the database handle 'db'. // */ func _sqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange Ti64) { - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FnChange = nChange *(*Ti64)(unsafe.Pointer(db + 108)) += nChange } @@ -66613,7 +63558,7 @@ func _sqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { if !(p != 0) { break } - libc.SetBitFieldPtr16Uint32(p+144, uint32(iCode+libc.Int32FromInt32(1)), 0, 0x3) + libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(iCode+libc.Int32FromInt32(1)), 0, 0x3) goto _1 _1: ; @@ -66652,11 +63597,9 @@ func _sqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) (r Tu8) { func _sqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff Tu8) (r uintptr) { var pMem, pRet uintptr _, _ = pMem, pRet - _ = libc.Int32FromInt32(0) if v != 0 { pMem = (*TVdbe)(unsafe.Pointer(v)).FaVar + uintptr(iVar-int32(1))*40 - _ = libc.Int32FromInt32(0) - if 0 == int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) { + if 0 == libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) { pRet = _sqlite3ValueNew(tls, (*TVdbe)(unsafe.Pointer(v)).Fdb) if pRet != 0 { _sqlite3VdbeMemCopy(tls, pRet, pMem) @@ -66676,8 +63619,6 @@ func _sqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff Tu8) (r // ** in a better query plan. // */ func _sqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iVar >= int32(32) { *(*Tu32)(unsafe.Pointer(v + 212)) |= uint32(0x80000000) } else { @@ -66705,11 +63646,11 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { return int32(1) } pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*20 - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { + if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { zContext = __ccgo_ts + 5319 } else { - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { + if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { zContext = __ccgo_ts + 5338 } else { zContext = __ccgo_ts + 5357 @@ -66756,7 +63697,6 @@ func _vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { var i int32 var pMem uintptr _, _ = i, pMem - _ = libc.Int32FromInt32(0) if p != 0 { i = 0 for { @@ -66794,7 +63734,6 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, _, _, _, _, _ = db, i, iKey2, zTbl, v1 db = (*TVdbe)(unsafe.Pointer(v)).Fdb zTbl = (*TTable)(unsafe.Pointer(pTab)).FzName - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp, 0, uint32(84)) if libc.BoolInt32((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0)) == 0 { v1 = libc.Int64FromInt32(0) @@ -66808,16 +63747,13 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, iKey2 = iKey1 } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*(*TPreUpdate)(unsafe.Pointer(bp))).Fv = v (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = uint16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 @@ -66827,8 +63763,8 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, int32((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, int32((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -66923,16 +63859,12 @@ func _invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { defer tls.Free(16) var _ /* iElapse at bp+8 */ Tsqlite3_int64 var _ /* iNow at bp+0 */ Tsqlite3_int64 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3OsCurrentTimeInt64(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, bp) *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = (*(*Tsqlite3_int64)(unsafe.Pointer(bp)) - (*TVdbe)(unsafe.Pointer(p)).FstartTime) * int64(1000000) if (*Tsqlite3)(unsafe.Pointer(db)).FxProfile != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, Tu64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxProfile})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg, (*TVdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)))) + (*(*func(*libc.TLS, uintptr, uintptr, Tu64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxProfile})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg, (*TVdbe)(unsafe.Pointer(p)).FzSql, libc.Uint64FromInt64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)))) } - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_PROFILE) != 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_PROFILE) != 0 { (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_PROFILE), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8) } (*TVdbe)(unsafe.Pointer(p)).FstartTime = 0 @@ -66966,13 +63898,12 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90484)) + return _sqlite3MisuseError(tls, int32(90486)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { _invokeProfileCallback(tls, db, v) } - _ = libc.Int32FromInt32(0) rc = _sqlite3VdbeReset(tls, v) _sqlite3VdbeDelete(tls, v) rc = _sqlite3ApiExit(tls, db, rc) @@ -67006,7 +63937,6 @@ func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) (r int32) { } rc = _sqlite3VdbeReset(tls, v) _sqlite3VdbeRewind(tls, v) - _ = libc.Int32FromInt32(0) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) } @@ -67038,7 +63968,6 @@ func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) (r int32) { ; i++ } - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).Fexpmask != 0 { libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(1), 0, 0x3) } @@ -67057,14 +63986,13 @@ func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) (r uintptr) { var v1 int32 _, _, _, _ = p, v1, v3, p2 p = pVal - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Blob)|libc.Int32FromInt32(MEM_Str)) != 0 { - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Blob)|libc.Int32FromInt32(MEM_Str)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Zero) != 0 { v1 = _sqlite3VdbeMemExpandBlob(tls, p) } else { v1 = 0 } if v1 != SQLITE_OK { - _ = libc.Int32FromInt32(0) return uintptr(0) } p2 = p + 16 @@ -67106,19 +64034,19 @@ func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) (r uint32) { var v1 int32 _, _ = pMem, v1 pMem = pVal - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Subtype) != 0 { - v1 = int32((*TMem)(unsafe.Pointer(pMem)).FeSubtype) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Subtype) != 0 { + v1 = libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).FeSubtype) } else { v1 = 0 } - return uint32(v1) + return libc.Uint32FromInt32(v1) } func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) (r uintptr) { var p uintptr _ = p p = pVal - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Term)|libc.Int32FromInt32(MEM_Subtype)) == libc.Int32FromInt32(MEM_Null)|libc.Int32FromInt32(MEM_Term)|libc.Int32FromInt32(MEM_Subtype) && zPType != uintptr(0) && int32((*TMem)(unsafe.Pointer(p)).FeSubtype) == int32('p') && libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(p)).Fu)), zPType) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Term)|libc.Int32FromInt32(MEM_Subtype)) == libc.Int32FromInt32(MEM_Null)|libc.Int32FromInt32(MEM_Term)|libc.Int32FromInt32(MEM_Subtype) && zPType != uintptr(0) && libc.Int32FromUint8((*TMem)(unsafe.Pointer(p)).FeSubtype) == int32('p') && libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(p)).Fu)), zPType) == 0 { return (*TMem)(unsafe.Pointer(p)).Fz } else { return uintptr(0) @@ -67149,7 +64077,7 @@ func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) (r uintptr) { // ** point number string BLOB NULL // */ func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) (r int32) { - return int32(_aType[int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_AffMask)]) + return libc.Int32FromUint8(_aType[libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_AffMask)]) } var _aType = [64]Tu8{ @@ -67220,21 +64148,21 @@ var _aType = [64]Tu8{ } func Xsqlite3_value_encoding(tls *libc.TLS, pVal uintptr) (r int32) { - return int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) + return libc.Int32FromUint8((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) } // C documentation // // /* Return true if a parameter to xUpdate represents an unchanged column */ func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) (r int32) { - return libc.BoolInt32(int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Null)|libc.Int32FromInt32(MEM_Zero)) == libc.Int32FromInt32(MEM_Null)|libc.Int32FromInt32(MEM_Zero)) + return libc.BoolInt32(libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Null)|libc.Int32FromInt32(MEM_Zero)) == libc.Int32FromInt32(MEM_Null)|libc.Int32FromInt32(MEM_Zero)) } // C documentation // // /* Return true if a parameter value originated from an sqlite3_bind() */ func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) (r int32) { - return libc.BoolInt32(int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_FromBind) != 0) + return libc.BoolInt32(libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_FromBind) != 0) } // C documentation @@ -67256,7 +64184,7 @@ func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) (r uintptr) { p1 = pNew + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(MEM_Dyn)) (*Tsqlite3_value)(unsafe.Pointer(pNew)).Fdb = uintptr(0) - if int32((*Tsqlite3_value)(unsafe.Pointer(pNew)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pNew)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { p2 = pNew + 16 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) & ^(libc.Int32FromInt32(MEM_Static) | libc.Int32FromInt32(MEM_Dyn))) p3 = pNew + 16 @@ -67266,7 +64194,7 @@ func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) (r uintptr) { pNew = uintptr(0) } } else { - if int32((*Tsqlite3_value)(unsafe.Pointer(pNew)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pNew)).Fflags)&int32(MEM_Null) != 0 { /* Do not duplicate pointer values */ p4 = pNew + 16 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) & ^(libc.Int32FromInt32(MEM_Term) | libc.Int32FromInt32(MEM_Subtype))) @@ -67309,19 +64237,17 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } else { /* The only errors possible from sqlite3VdbeMemSetStr are ** SQLITE_TOOBIG and SQLITE_NOMEM */ - _ = libc.Int32FromInt32(0) Xsqlite3_result_error_nomem(tls, pCtx) } return } - _sqlite3VdbeChangeEncoding(tls, pOut, int32((*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fenc)) + _sqlite3VdbeChangeEncoding(tls, pOut, libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fenc)) if _sqlite3VdbeMemTooBig(tls, pOut) != 0 { Xsqlite3_result_error_toobig(tls, pCtx) } } func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - _ = libc.Int32FromInt32(0) if xDel == uintptr(0) { /* noop */ } else { @@ -67331,56 +64257,45 @@ func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) } } - _ = libc.Int32FromInt32(0) Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) } func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if n > uint64(0x7fffffff) { _invokeValueDestructor(tls, z, xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, int32(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) } } func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemSetDouble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, rVal) } func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { - _ = libc.Int32FromInt32(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_ERROR) _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), uint8(SQLITE_UTF8), uintptr(-libc.Int32FromInt32(1))) } func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { - _ = libc.Int32FromInt32(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_ERROR) _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), uint8(SQLITE_UTF16LE), uintptr(-libc.Int32FromInt32(1))) } func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemSetInt64(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int64(iVal)) } func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal Ti64) { - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemSetInt64(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, iVal) } func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } @@ -67388,7 +64303,6 @@ func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType u var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) @@ -67398,22 +64312,18 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { var pOut, p1 uintptr _, _ = pOut, p1 pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pOut)).FeSubtype = uint8(eSubtype & uint32(0xff)) p1 = pOut + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _ = libc.Int32FromInt32(0) _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) } func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32(enc) != int32(SQLITE_UTF8) { - if int32(enc) == int32(SQLITE_UTF16) { + if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { + if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } n &= ^libc.Uint64FromInt32(1) @@ -67421,33 +64331,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u if n > uint64(0x7fffffff) { _invokeValueDestructor(tls, z, xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, int32(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _ = libc.Int32FromInt32(0) - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) } func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _ = libc.Int32FromInt32(0) - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) } func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _ = libc.Int32FromInt32(0) - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemCopy(tls, pOut, pValue) - _sqlite3VdbeChangeEncoding(tls, pOut, int32((*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fenc)) + _sqlite3VdbeChangeEncoding(tls, pOut, libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fenc)) if _sqlite3VdbeMemTooBig(tls, pOut) != 0 { Xsqlite3_result_error_toobig(tls, pCtx) } @@ -67461,19 +64367,18 @@ func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32) { } else { v1 = 0 } - Xsqlite3_result_zeroblob64(tls, pCtx, uint64(v1)) + Xsqlite3_result_zeroblob64(tls, pCtx, libc.Uint64FromInt32(v1)) } func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n Tu64) (r int32) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - _ = libc.Int32FromInt32(0) - if n > uint64(*(*int32)(unsafe.Pointer((*TMem)(unsafe.Pointer(pOut)).Fdb + 116))) { + if n > libc.Uint64FromInt32(*(*int32)(unsafe.Pointer((*TMem)(unsafe.Pointer(pOut)).Fdb + 116))) { Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } - _sqlite3VdbeMemSetZeroBlob(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int32(n)) + _sqlite3VdbeMemSetZeroBlob(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, libc.Int32FromUint64(n)) return SQLITE_OK } @@ -67486,7 +64391,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { v1 = -int32(1) } (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = v1 - if int32((*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags)&int32(MEM_Null) != 0 { _setResultStrOrError(tls, pCtx, _sqlite3ErrStr(tls, errCode), -int32(1), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } } @@ -67495,7 +64400,6 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { - _ = libc.Int32FromInt32(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5487, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } @@ -67504,7 +64408,6 @@ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { // // /* An SQLITE_NOMEM error. */ func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_NOMEM) _sqlite3OomFault(tls, (*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fdb) @@ -67519,8 +64422,7 @@ func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { func _sqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { var p1, p2 uintptr _, _ = p1, p2 - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags)&int32(MEM_Int) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags)&int32(MEM_Int) != 0 { p1 = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(MEM_Int)) p2 = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 16 @@ -67576,17 +64478,16 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { var db uintptr var rc int32 _, _ = db, rc - _ = libc.Int32FromInt32(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb - if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { goto restart_step restart_step: ; - if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { if int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0x3>>0)) != 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = int32(SQLITE_SCHEMA) rc = int32(SQLITE_ERROR) - if int32((*TVdbe)(unsafe.Pointer(p)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) != 0 { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) != 0 { /* If this statement was prepared using saved SQL and an ** error has occurred, then return the error code in p->rc to the ** caller. Set the error code in the database handle to the same @@ -67603,11 +64504,9 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 { libc.AtomicStoreNInt32(db+304, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) } - _ = libc.Int32FromInt32(0) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&(libc.Int32FromInt32(SQLITE_TRACE_PROFILE)|libc.Int32FromInt32(SQLITE_TRACE_XPROFILE)) != 0 && !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) && (*TVdbe)(unsafe.Pointer(p)).FzSql != 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&(libc.Int32FromInt32(SQLITE_TRACE_PROFILE)|libc.Int32FromInt32(SQLITE_TRACE_XPROFILE)) != 0 && !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) && (*TVdbe)(unsafe.Pointer(p)).FzSql != 0 { _sqlite3OsCurrentTimeInt64(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, p+128) } else { - _ = libc.Int32FromInt32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive++ if int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0x40>>6)) == 0 { @@ -67619,7 +64518,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { (*TVdbe)(unsafe.Pointer(p)).Fpc = 0 (*TVdbe)(unsafe.Pointer(p)).FeVdbeState = uint8(VDBE_RUN_STATE) } else { - if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_HALT_STATE) { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_HALT_STATE) { /* We used to require that sqlite3_reset() be called before retrying ** sqlite3_step() after any error or after SQLITE_DONE. But beginning ** with version 3.7.0, we changed this so that sqlite3_reset() would @@ -67637,7 +64536,6 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { ** or SQLITE_BUSY error. */ Xsqlite3_reset(tls, p) - _ = libc.Int32FromInt32(0) goto restart_step } } @@ -67650,8 +64548,6 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec-- } if rc == int32(SQLITE_ROW) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = int32(SQLITE_ROW) return int32(SQLITE_ROW) } else { @@ -67661,13 +64557,12 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { } (*TVdbe)(unsafe.Pointer(p)).FpResultRow = uintptr(0) if rc == int32(SQLITE_DONE) && (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0 { - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).Frc = _doWalCallbacks(tls, db) if (*TVdbe)(unsafe.Pointer(p)).Frc != SQLITE_OK { rc = int32(SQLITE_ERROR) } } else { - if rc != int32(SQLITE_DONE) && int32((*TVdbe)(unsafe.Pointer(p)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) != 0 { + if rc != int32(SQLITE_DONE) && libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) != 0 { /* If this statement was prepared using saved SQL and an ** error has occurred, then return the error code in p->rc to the ** caller. Set the error code in the database handle to the same value. @@ -67679,7 +64574,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = rc if int32(SQLITE_NOMEM) == _sqlite3ApiExit(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, (*TVdbe)(unsafe.Pointer(p)).Frc) { (*TVdbe)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) - if int32((*TVdbe)(unsafe.Pointer(p)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) != 0 { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) != 0 { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } @@ -67688,7 +64583,6 @@ end_of_step: ; /* There are only a limited number of result codes allowed from the ** statements prepared using the legacy sqlite3_prepare() interface */ - _ = libc.Int32FromInt32(0) return rc & (*Tsqlite3)(unsafe.Pointer(db)).FerrMask } @@ -67708,7 +64602,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91278)) + return _sqlite3MisuseError(tls, int32(91280)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -67756,7 +64650,6 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { ** SQLITE_SCHEMA. tag-20220401a */ (*TVdbe)(unsafe.Pointer(v)).FminWriteFileFormat = uint8(254) } - _ = libc.Int32FromInt32(0) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -67769,7 +64662,6 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { // ** pointer to it. // */ func Xsqlite3_user_data(tls *libc.TLS, p uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) return (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(p)).FpFunc)).FpUserData } @@ -67786,7 +64678,6 @@ func Xsqlite3_user_data(tls *libc.TLS, p uintptr) (r uintptr) { // ** application defined function. // */ func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) return (*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(p)).FpOut)).Fdb } @@ -67807,7 +64698,6 @@ func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) (r uintptr) { // ** value, as a signal to the xUpdate routine that the column is unchanged. // */ func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return Xsqlite3_value_nochange(tls, (*Tsqlite3_context)(unsafe.Pointer(p)).FpOut) } @@ -67842,14 +64732,11 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91399)) + return _sqlite3MisuseError(tls, int32(91401)) } - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pRhs = (*Tsqlite3_value)(unsafe.Pointer(pVal)).Fz } if bNext != 0 { @@ -67857,7 +64744,6 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 } else { *(*int32)(unsafe.Pointer(bp)) = 0 rc = _sqlite3BtreeFirst(tls, (*TValueList)(unsafe.Pointer(pRhs)).FpCsr, bp) - _ = libc.Int32FromInt32(0) if _sqlite3BtreeEof(tls, (*TValueList)(unsafe.Pointer(pRhs)).FpCsr) != 0 { rc = int32(SQLITE_DONE) } @@ -67865,20 +64751,20 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 if rc == SQLITE_OK { /* Raw content of current row */ libc.Xmemset(tls, bp+4, 0, uint32(40)) sz = _sqlite3BtreePayloadSize(tls, (*TValueList)(unsafe.Pointer(pRhs)).FpCsr) - rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, (*TValueList)(unsafe.Pointer(pRhs)).FpCsr, uint32(int32(sz)), bp+4) + rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, (*TValueList)(unsafe.Pointer(pRhs)).FpCsr, libc.Uint32FromInt32(libc.Int32FromUint32(sz)), bp+4) if rc == SQLITE_OK { zBuf = (*(*TMem)(unsafe.Pointer(bp + 4))).Fz pOut = (*TValueList)(unsafe.Pointer(pRhs)).FpOut - if int32(*(*Tu8)(unsafe.Pointer(zBuf + 1))) < int32(libc.Uint8FromInt32(0x80)) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zBuf + 1))) < libc.Int32FromUint8(libc.Uint8FromInt32(0x80)) { *(*Tu32)(unsafe.Pointer(bp + 44)) = uint32(*(*Tu8)(unsafe.Pointer(zBuf + 1))) v1 = libc.Int32FromInt32(1) } else { - v1 = int32(_sqlite3GetVarint32(tls, zBuf+1, bp+44)) + v1 = libc.Int32FromUint8(_sqlite3GetVarint32(tls, zBuf+1, bp+44)) } - iOff = int32(1) + int32(uint8(v1)) + iOff = int32(1) + libc.Int32FromUint8(libc.Uint8FromInt32(v1)) _sqlite3VdbeSerialGet(tls, zBuf+uintptr(iOff), *(*Tu32)(unsafe.Pointer(bp + 44)), pOut) (*Tsqlite3_value)(unsafe.Pointer(pOut)).Fenc = (*Tsqlite3)(unsafe.Pointer((*Tsqlite3_value)(unsafe.Pointer(pOut)).Fdb)).Fenc - if int32((*Tsqlite3_value)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Ephem) != 0 && _sqlite3VdbeMemMakeWriteable(tls, pOut) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Ephem) != 0 && _sqlite3VdbeMemMakeWriteable(tls, pOut) != 0 { rc = int32(SQLITE_NOMEM) } else { *(*uintptr)(unsafe.Pointer(ppOut)) = pOut @@ -67951,7 +64837,6 @@ func _createAggContext(tls *libc.TLS, p uintptr, nByte int32) (r uintptr) { var pMem uintptr _ = pMem pMem = (*Tsqlite3_context)(unsafe.Pointer(p)).FpMem - _ = libc.Int32FromInt32(0) if nByte <= 0 { _sqlite3VdbeMemSetNull(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = uintptr(0) @@ -67960,7 +64845,7 @@ func _createAggContext(tls *libc.TLS, p uintptr, nByte int32) (r uintptr) { (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Agg) *(*uintptr)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)) = (*Tsqlite3_context)(unsafe.Pointer(p)).FpFunc if (*TMem)(unsafe.Pointer(pMem)).Fz != 0 { - libc.Xmemset(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, 0, uint32(nByte)) + libc.Xmemset(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, 0, libc.Uint32FromInt32(nByte)) } } return (*TMem)(unsafe.Pointer(pMem)).Fz @@ -67974,9 +64859,7 @@ func _createAggContext(tls *libc.TLS, p uintptr, nByte int32) (r uintptr) { // ** same context that was returned on prior calls. // */ func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) (r uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(p)).FpMem)).Fflags)&int32(MEM_Agg) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(p)).FpMem)).Fflags)&int32(MEM_Agg) == 0 { return _createAggContext(tls, p, nByte) } else { return (*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(p)).FpMem)).Fz @@ -67999,7 +64882,6 @@ func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) (r uintpt func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { var pAuxData uintptr _ = pAuxData - _ = libc.Int32FromInt32(0) if (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe == uintptr(0) { return uintptr(0) } @@ -68036,7 +64918,6 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe - _ = libc.Int32FromInt32(0) if pVdbe == uintptr(0) { goto failed } @@ -68093,7 +64974,6 @@ failed: // ** context. // */ func Xsqlite3_aggregate_count(tls *libc.TLS, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return (*TMem)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(p)).FpMem)).Fn } @@ -68109,7 +64989,7 @@ func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) (r int32) { if pVm == uintptr(0) { return 0 } - return int32((*TVdbe)(unsafe.Pointer(pVm)).FnResColumn) + return libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(pVm)).FnResColumn) } // C documentation @@ -68125,7 +65005,7 @@ func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) (r int32) { if pVm == uintptr(0) || (*TVdbe)(unsafe.Pointer(pVm)).FpResultRow == uintptr(0) { return 0 } - return int32((*TVdbe)(unsafe.Pointer(pVm)).FnResColumn) + return libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(pVm)).FnResColumn) } // C documentation @@ -68165,9 +65045,8 @@ func _columnMem(tls *libc.TLS, pStmt uintptr, i int32) (r uintptr) { if pVm == uintptr(0) { return _columnNullValue(tls) } - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(pVm)).Fdb)).Fmutex) - if (*TVdbe)(unsafe.Pointer(pVm)).FpResultRow != uintptr(0) && i < int32((*TVdbe)(unsafe.Pointer(pVm)).FnResColumn) && i >= 0 { + if (*TVdbe)(unsafe.Pointer(pVm)).FpResultRow != uintptr(0) && i < libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(pVm)).FnResColumn) && i >= 0 { pOut = (*TVdbe)(unsafe.Pointer(pVm)).FpResultRow + uintptr(i)*40 } else { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(pVm)).Fdb, int32(SQLITE_RANGE)) @@ -68206,8 +65085,6 @@ func _columnMallocFailure(tls *libc.TLS, pStmt uintptr) { */ p = pStmt if p != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).Frc = _sqlite3ApiExit(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, (*TVdbe)(unsafe.Pointer(p)).Frc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } @@ -68283,7 +65160,7 @@ func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) (r uintptr) { var pOut, p1, p2 uintptr _, _, _ = pOut, p1, p2 pOut = _columnMem(tls, pStmt, i) - if int32((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Static) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Static) != 0 { p1 = pOut + 16 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(MEM_Static)) p2 = pOut + 16 @@ -68421,7 +65298,6 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) p = pStmt db = (*TVdbe)(unsafe.Pointer(p)).Fdb - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0xc>>2)) != 0 { if useType > 0 { @@ -68437,14 +65313,14 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType goto columnName_end } if useUtf16 != 0 { - i = int32(_iExplainColNames16[N+int32(8)*int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0xc>>2))-int32(8)]) + i = libc.Int32FromUint8(_iExplainColNames16[N+int32(8)*int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0xc>>2))-int32(8)]) ret = uintptr(unsafe.Pointer(&_azExplainColNames16data)) + uintptr(i)*2 } else { ret = _azExplainColNames8[N+int32(8)*int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0xc>>2))-int32(8)] } goto columnName_end } - n = int32((*TVdbe)(unsafe.Pointer(p)).FnResColumn) + n = libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResColumn) if N < n { prior_mallocFailed = (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed N += useType * n @@ -68456,8 +65332,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType /* A malloc may have failed inside of the _text() call. If this ** is the case, clear the mallocFailed flag and return NULL. */ - _ = libc.Int32FromInt32(0) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) > int32(prior_mallocFailed) { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) > libc.Int32FromUint8(prior_mallocFailed) { _sqlite3OomClear(tls, db) ret = uintptr(0) } @@ -68572,16 +65447,16 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92003)) + return _sqlite3MisuseError(tls, int32(92005)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92007))) + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92009))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5570, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92011)) + return _sqlite3MisuseError(tls, int32(92013)) } - if i >= uint32((*TVdbe)(unsafe.Pointer(p)).FnVar) { + if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) return int32(SQLITE_RANGE) @@ -68599,7 +65474,6 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { ** as if there had been a schema change, on the first sqlite3_step() call ** following any change to the bindings of that parameter. */ - _ = libc.Int32FromInt32(0) if v2 = (*TVdbe)(unsafe.Pointer(p)).Fexpmask != uint32(0); v2 { if i >= uint32(31) { v1 = uint32(0x80000000) @@ -68623,13 +65497,13 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, var rc int32 _, _, _ = p, pVar, rc p = pStmt - rc = _vdbeUnbind(tls, p, uint32(i-libc.Int32FromInt32(1))) + rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*40 rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) - if rc == SQLITE_OK && int32(encoding) != 0 { - rc = _sqlite3VdbeChangeEncoding(tls, pVar, int32((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) + if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { + rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } if rc != 0 { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, rc) @@ -68655,8 +65529,7 @@ func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nD } func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -68664,7 +65537,7 @@ func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) var rc int32 _, _ = p, rc p = pStmt - rc = _vdbeUnbind(tls, p, uint32(i-libc.Int32FromInt32(1))) + rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { _sqlite3VdbeMemSetDouble(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, rValue) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) @@ -68681,7 +65554,7 @@ func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Tsqlite_i var rc int32 _, _ = p, rc p = pStmt - rc = _vdbeUnbind(tls, p, uint32(i-libc.Int32FromInt32(1))) + rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { _sqlite3VdbeMemSetInt64(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, iValue) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) @@ -68694,7 +65567,7 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { var rc int32 _, _ = p, rc p = pStmt - rc = _vdbeUnbind(tls, p, uint32(i-libc.Int32FromInt32(1))) + rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } @@ -68706,7 +65579,7 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, var rc int32 _, _ = p, rc p = pStmt - rc = _vdbeUnbind(tls, p, uint32(i-libc.Int32FromInt32(1))) + rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, pPtr, zPTtype, xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) @@ -68723,18 +65596,17 @@ func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nD } func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { - _ = libc.Int32FromInt32(0) - if int32(enc) != int32(SQLITE_UTF8) { - if int32(enc) == int32(SQLITE_UTF16) { + if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { + if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= uint64(^int32(libc.Uint16FromInt32(1))) + nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) } - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) } func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(uint64(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -68745,15 +65617,14 @@ func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) case int32(SQLITE_INTEGER): rc = Xsqlite3_bind_int64(tls, pStmt, i, *(*Ti64)(unsafe.Pointer(pValue))) case int32(SQLITE_FLOAT): - _ = libc.Int32FromInt32(0) - if int32((*Tsqlite3_value)(unsafe.Pointer(pValue)).Fflags)&int32(MEM_Real) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pValue)).Fflags)&int32(MEM_Real) != 0 { v1 = *(*float64)(unsafe.Pointer(pValue)) } else { v1 = float64(*(*Ti64)(unsafe.Pointer(pValue))) } rc = Xsqlite3_bind_double(tls, pStmt, i, v1) case int32(SQLITE_BLOB): - if int32((*Tsqlite3_value)(unsafe.Pointer(pValue)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pValue)).Fflags)&int32(MEM_Zero) != 0 { rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, *(*int32)(unsafe.Pointer(&(*Tsqlite3_value)(unsafe.Pointer(pValue)).Fu))) } else { rc = Xsqlite3_bind_blob(tls, pStmt, i, (*Tsqlite3_value)(unsafe.Pointer(pValue)).Fz, (*Tsqlite3_value)(unsafe.Pointer(pValue)).Fn, uintptr(-libc.Int32FromInt32(1))) @@ -68772,7 +65643,7 @@ func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) (r i var rc int32 _, _ = p, rc p = pStmt - rc = _vdbeUnbind(tls, p, uint32(i-libc.Int32FromInt32(1))) + rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { _sqlite3VdbeMemSetZeroBlob(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, n) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) @@ -68786,11 +65657,10 @@ func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Tsqlite3_ _, _ = p, rc p = pStmt Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - if n > uint64(*(*int32)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb + 116))) { + if n > libc.Uint64FromInt32(*(*int32)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb + 116))) { rc = int32(SQLITE_TOOBIG) } else { - _ = libc.Int32FromInt32(0) - rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, int32(n)) + rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, libc.Int32FromUint64(n)) } rc = _sqlite3ApiExit(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) @@ -68863,8 +65733,6 @@ func _sqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) _, _, _ = i, pFrom, pTo pFrom = pFromStmt pTo = pToStmt - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(pTo)).Fdb)).Fmutex) i = 0 for { @@ -68903,11 +65771,9 @@ func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintpt if int32((*TVdbe)(unsafe.Pointer(pFrom)).FnVar) != int32((*TVdbe)(unsafe.Pointer(pTo)).FnVar) { return int32(SQLITE_ERROR) } - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(pTo)).Fexpmask != 0 { libc.SetBitFieldPtr16Uint32(pTo+144, libc.Uint32FromInt32(1), 0, 0x3) } - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(pFrom)).Fexpmask != 0 { libc.SetBitFieldPtr16Uint32(pFrom+144, libc.Uint32FromInt32(1), 0, 0x3) } @@ -68984,18 +65850,18 @@ func Xsqlite3_stmt_explain(tls *libc.TLS, pStmt uintptr, eMode int32) (r int32) if eMode < 0 || eMode > int32(2) { rc = int32(SQLITE_ERROR) } else { - if int32((*TVdbe)(unsafe.Pointer(v)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) == 0 { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(v)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) == 0 { rc = int32(SQLITE_ERROR) } else { - if int32((*TVdbe)(unsafe.Pointer(v)).FeVdbeState) != int32(VDBE_READY_STATE) { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(v)).FeVdbeState) != int32(VDBE_READY_STATE) { rc = int32(SQLITE_BUSY) } else { if (*TVdbe)(unsafe.Pointer(v)).FnMem >= int32(10) && (eMode != int32(2) || int32(Tbft(*(*uint16)(unsafe.Pointer(v + 144))&0x100>>8)) != 0) { /* No reprepare necessary */ - libc.SetBitFieldPtr16Uint32(v+144, uint32(eMode), 2, 0xc) + libc.SetBitFieldPtr16Uint32(v+144, libc.Uint32FromInt32(eMode), 2, 0xc) rc = SQLITE_OK } else { - libc.SetBitFieldPtr16Uint32(v+144, uint32(eMode), 2, 0xc) + libc.SetBitFieldPtr16Uint32(v+144, libc.Uint32FromInt32(eMode), 2, 0xc) rc = _sqlite3Reprepare(tls, v) libc.SetBitFieldPtr16Uint32(v+144, libc.BoolUint32(eMode == libc.Int32FromInt32(2)), 8, 0x100) } @@ -69004,7 +65870,7 @@ func Xsqlite3_stmt_explain(tls *libc.TLS, pStmt uintptr, eMode int32) (r int32) } } if int32(Tbft(*(*uint16)(unsafe.Pointer(v + 144))&0xc>>2)) != 0 { - (*TVdbe)(unsafe.Pointer(v)).FnResColumn = uint16(int32(12) - int32(4)*int32(Tbft(*(*uint16)(unsafe.Pointer(v + 144))&0xc>>2))) + (*TVdbe)(unsafe.Pointer(v)).FnResColumn = libc.Uint16FromInt32(int32(12) - int32(4)*int32(Tbft(*(*uint16)(unsafe.Pointer(v + 144))&0xc>>2))) } else { (*TVdbe)(unsafe.Pointer(v)).FnResColumn = (*TVdbe)(unsafe.Pointer(v)).FnResAlloc } @@ -69021,7 +65887,7 @@ func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) (r int32) { var v uintptr _ = v v = pStmt - return libc.BoolInt32(v != uintptr(0) && int32((*TVdbe)(unsafe.Pointer(v)).FeVdbeState) == int32(VDBE_RUN_STATE)) + return libc.BoolInt32(v != uintptr(0) && libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(v)).FeVdbeState) == int32(VDBE_RUN_STATE)) } // C documentation @@ -69062,7 +65928,6 @@ func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int3 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = bp - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart _sqlite3VdbeDelete(tls, pVdbe) (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -69074,7 +65939,7 @@ func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int3 *(*Tu32)(unsafe.Pointer(pVdbe + 156 + uintptr(op)*4)) = uint32(0) } } - return int32(*(*Tu32)(unsafe.Pointer(bp))) + return libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))) } // C documentation @@ -69131,7 +65996,7 @@ func _vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr _ = pRet /* Return value */ pRet = _sqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo) if pRet != 0 { - libc.Xmemset(tls, (*TUnpackedRecord)(unsafe.Pointer(pRet)).FaMem, 0, uint32(40)*uint32(int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)+libc.Int32FromInt32(1))) + libc.Xmemset(tls, (*TUnpackedRecord)(unsafe.Pointer(pRet)).FaMem, 0, uint32(40)*libc.Uint32FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)+libc.Int32FromInt32(1))) _sqlite3VdbeRecordUnpack(tls, pKeyInfo, nKey, pKey, pRet) } return pRet @@ -69153,7 +66018,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92547)) + rc = _sqlite3MisuseError(tls, int32(92549)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { @@ -69165,7 +66030,6 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } /* If the old.* record has not yet been loaded into memory, do so now. */ if (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked == uintptr(0) { - _ = libc.Int32FromInt32(0) nRec = _sqlite3BtreePayloadSize(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 36))) aRec = _sqlite3DbMallocRaw(tls, db, uint64(nRec)) if !(aRec != 0) { @@ -69173,7 +66037,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 36)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+16, int32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+16, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -69190,11 +66054,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) } else { - if iIdx >= int32((*TUnpackedRecord)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FnField) { + if iIdx >= libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FnField) { *(*uintptr)(unsafe.Pointer(ppValue)) = _columnNullValue(tls) } else { if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FaCol + uintptr(iIdx)*12))).Faffinity) == int32(SQLITE_AFF_REAL) { - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { _sqlite3VdbeMemRealify(tls, pMem) } } @@ -69219,7 +66083,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = int32((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) } else { v1 = 0 } @@ -69284,7 +66148,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp rc = SQLITE_OK p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(92670)) + rc = _sqlite3MisuseError(tls, int32(92672)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { @@ -69300,7 +66164,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp pUnpack = (*TPreUpdate)(unsafe.Pointer(p)).FpNewUnpacked if !(pUnpack != 0) { pData = (*TVdbe)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).Fv)).FaMem + uintptr((*TPreUpdate)(unsafe.Pointer(p)).FiNewReg)*40 - if int32((*TMem)(unsafe.Pointer(pData)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pData)).Fflags)&int32(MEM_Zero) != 0 { v1 = _sqlite3VdbeMemExpandBlob(tls, pData) } else { v1 = 0 @@ -69320,7 +66184,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey2) } else { - if iIdx >= int32((*TUnpackedRecord)(unsafe.Pointer(pUnpack)).FnField) { + if iIdx >= libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pUnpack)).FnField) { pMem = _columnNullValue(tls) } } @@ -69330,17 +66194,15 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** It is not safe to return a pointer to the memory cell itself as the ** caller may modify the value text encoding. */ - _ = libc.Int32FromInt32(0) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint32(40)*uint32((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint32(40)*libc.Uint32FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out } } - _ = libc.Int32FromInt32(0) pMem = (*TPreUpdate)(unsafe.Pointer(p)).FaNew + uintptr(iIdx)*40 - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) == 0 { if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey2) } else { @@ -69399,7 +66261,6 @@ func _findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) (r int *(*int32)(unsafe.Pointer(pnToken)) = 0 for *(*int8)(unsafe.Pointer(zSql)) != 0 { n = _sqlite3GetToken(tls, zSql, bp) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) == int32(TK_VARIABLE) { *(*int32)(unsafe.Pointer(pnToken)) = n break @@ -69462,7 +66323,6 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr } } Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5610, int32(3)) - _ = libc.Int32FromInt32(0) Xsqlite3_str_append(tls, bp+8, zStart, int32(zRawSql)-int32(zStart)) } } else { @@ -69471,24 +66331,19 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr } else { for *(*int8)(unsafe.Pointer(zRawSql)) != 0 { n = _findNextHostParameter(tls, zRawSql, bp+4) - _ = libc.Int32FromInt32(0) Xsqlite3_str_append(tls, bp+8, zRawSql, n) zRawSql += uintptr(n) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { break } if int32(*(*int8)(unsafe.Pointer(zRawSql))) == int32('?') { if *(*int32)(unsafe.Pointer(bp + 4)) > int32(1) { - _ = libc.Int32FromInt32(0) _sqlite3GetInt32(tls, zRawSql+1, bp) } else { *(*int32)(unsafe.Pointer(bp)) = nextIndex } } else { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _sqlite3VdbeParameterIndex(tls, p, zRawSql, *(*int32)(unsafe.Pointer(bp + 4))) - _ = libc.Int32FromInt32(0) } zRawSql += uintptr(*(*int32)(unsafe.Pointer(bp + 4))) if *(*int32)(unsafe.Pointer(bp))+int32(1) > nextIndex { @@ -69497,20 +66352,19 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr v2 = nextIndex } nextIndex = v2 - _ = libc.Int32FromInt32(0) pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*40 - if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1663, int32(4)) } else { - if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1423, libc.VaList(bp+80, *(*Ti64)(unsafe.Pointer(pVar)))) } else { - if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5131, libc.VaList(bp+80, *(*float64)(unsafe.Pointer(pVar)))) } else { - if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - if int32(enc) != int32(SQLITE_UTF8) { + if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { libc.Xmemset(tls, bp+32, 0, uint32(40)) (*(*TMem)(unsafe.Pointer(bp + 32))).Fdb = db _sqlite3VdbeMemSetStr(tls, bp+32, (*TMem)(unsafe.Pointer(pVar)).Fz, int64((*TMem)(unsafe.Pointer(pVar)).Fn), enc, libc.UintptrFromInt32(0)) @@ -69522,14 +66376,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5614, libc.VaList(bp+80, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) - if int32(enc) != int32(SQLITE_UTF8) { + if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+32) } } else { - if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5621, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - _ = libc.Int32FromInt32(0) Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5634, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 @@ -69731,13 +66584,12 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) - if int32(eCurType) == CURTYPE_BTREE { + if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { v2 = _sqlite3BtreeCursorSize(tls) } else { v2 = 0 } - nByte = int32((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*uint32(nField) + uint32(v2)) - _ = libc.Int32FromInt32(0) + nByte = libc.Int32FromUint32((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*libc.Uint32FromInt32(nField) + libc.Uint32FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = uintptr(0) @@ -69746,14 +66598,11 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(nByte)) + v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 (*TMem)(unsafe.Pointer(pMem)).Fz = v3 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { @@ -69769,8 +66618,8 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 84 + uintptr(nField)*4 - if int32(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 36)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*uint32(nField)) + if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { + *(*uintptr)(unsafe.Pointer(pCx + 36)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*libc.Uint32FromInt32(nField)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 36))) } return pCx @@ -69821,7 +66670,6 @@ func _applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { var _ /* rValue at bp+0 */ float64 _, _, _, _, _ = enc, rc, p1, p2, p3 enc = (*TMem)(unsafe.Pointer(pRec)).Fenc - _ = libc.Int32FromInt32(0) rc = _sqlite3AtoF(tls, (*TMem)(unsafe.Pointer(pRec)).Fz, bp, (*TMem)(unsafe.Pointer(pRec)).Fn, enc) if rc <= 0 { return @@ -69874,10 +66722,9 @@ func _applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc Tu8) { var p1 uintptr _ = p1 if int32(affinity) >= int32(SQLITE_AFF_NUMERIC) { - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Int) == 0 { /*OPTIMIZATION-IF-FALSE*/ - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&(libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) == 0 { - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Str) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Int) == 0 { /*OPTIMIZATION-IF-FALSE*/ + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&(libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Str) != 0 { _applyNumericAffinity(tls, pRec, int32(1)) } } else { @@ -69893,8 +66740,8 @@ func _applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc Tu8) { ** representation. It would be harmless to repeat the conversion if ** there is already a string rep, but it is pointless to waste those ** CPU cycles. */ - if 0 == int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Str) { /*OPTIMIZATION-IF-FALSE*/ - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&(libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if 0 == libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Str) { /*OPTIMIZATION-IF-FALSE*/ + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&(libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { _sqlite3VdbeMemStringify(tls, pRec, enc, uint8(1)) } } @@ -69932,7 +66779,7 @@ func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) (r int32) { // ** not the internal Mem* type. // */ func _sqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity Tu8, enc Tu8) { - _applyAffinity(tls, pVal, int8(affinity), enc) + _applyAffinity(tls, pVal, libc.Int8FromUint8(affinity), enc) } // C documentation @@ -69949,9 +66796,7 @@ func _computeNumericType(tls *libc.TLS, pMem uintptr) (r Tu16) { var rc, v1 int32 var _ /* ix at bp+0 */ Tsqlite3_int64 _, _ = rc, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Zero) != 0 { v1 = _sqlite3VdbeMemExpandBlob(tls, pMem) } else { v1 = 0 @@ -69987,11 +66832,9 @@ func _computeNumericType(tls *libc.TLS, pMem uintptr) (r Tu16) { // ** But it does set pMem->u.r and pMem->u.i appropriately. // */ func _numericType(tls *libc.TLS, pMem uintptr) (r Tu16) { - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Null)) != 0 { - return uint16(int32((*TMem)(unsafe.Pointer(pMem)).Fflags) & (libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal) | libc.Int32FromInt32(MEM_Null))) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Null)) != 0 { + return libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) & (libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal) | libc.Int32FromInt32(MEM_Null))) } - _ = libc.Int32FromInt32(0) return _computeNumericType(tls, pMem) return uint16(0) } @@ -70011,10 +66854,8 @@ func _out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) (r uintptr) { func _out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) (r uintptr) { var pOut uintptr _ = pOut - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOut = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbeOp)(unsafe.Pointer(pOp)).Fp2)*40 - if int32((*TMem)(unsafe.Pointer(pOut)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { /*OPTIMIZATION-IF-FALSE*/ + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { /*OPTIMIZATION-IF-FALSE*/ return _out2PrereleaseWithClear(tls, pOut) } else { (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Int) @@ -70035,7 +66876,6 @@ func _filterHash(tls *libc.TLS, aMem uintptr, pOp uintptr) (r Tu64) { var p uintptr _, _, _, _ = h, i, mx, p h = uint64(0) - _ = libc.Int32FromInt32(0) i = (*TOp)(unsafe.Pointer(pOp)).Fp3 mx = i + *(*int32)(unsafe.Pointer(pOp + 16)) for { @@ -70043,17 +66883,17 @@ func _filterHash(tls *libc.TLS, aMem uintptr, pOp uintptr) (r Tu64) { break } p = aMem + uintptr(i)*40 - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - h += uint64(*(*Ti64)(unsafe.Pointer(p))) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + h += libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(p))) } else { - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Real) != 0 { - h += uint64(_sqlite3VdbeIntValue(tls, p)) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Real) != 0 { + h += libc.Uint64FromInt64(_sqlite3VdbeIntValue(tls, p)) } else { - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 { /* All strings have the same hash and all blobs have the same hash, ** though, at least, those hashes are different from each other and ** from NULL. */ - h += uint64(int32(4093) + int32((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob))) + h += libc.Uint64FromInt32(int32(4093) + libc.Int32FromUint16((*TMem)(unsafe.Pointer(p)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob))) } } } @@ -70079,9 +66919,8 @@ func _vdbeColumnFromOverflow(tls *libc.TLS, pC uintptr, iCol int32, t int32, iOf var encoding, len1, rc int32 _, _, _, _, _, _, _, _, _, _ = db, encoding, len1, pBuf, pCache, rc, v1, p2, p3, p4 db = (*TMem)(unsafe.Pointer(pDest)).Fdb - encoding = int32((*TMem)(unsafe.Pointer(pDest)).Fenc) - len1 = int32(_sqlite3VdbeSerialTypeLen(tls, uint32(t))) - _ = libc.Int32FromInt32(0) + encoding = libc.Int32FromUint8((*TMem)(unsafe.Pointer(pDest)).Fenc) + len1 = libc.Int32FromUint32(_sqlite3VdbeSerialTypeLen(tls, libc.Uint32FromInt32(t))) if len1 > *(*int32)(unsafe.Pointer(db + 116)) { return int32(SQLITE_TOOBIG) } @@ -70098,13 +66937,13 @@ func _vdbeColumnFromOverflow(tls *libc.TLS, pC uintptr, iCol int32, t int32, iOf if (*TVdbeTxtBlbCache)(unsafe.Pointer(pCache)).FpCValue != 0 { _sqlite3RCStrUnref(tls, (*TVdbeTxtBlbCache)(unsafe.Pointer(pCache)).FpCValue) } - v1 = _sqlite3RCStrNew(tls, uint64(len1+int32(3))) + v1 = _sqlite3RCStrNew(tls, libc.Uint64FromInt32(len1+int32(3))) (*TVdbeTxtBlbCache)(unsafe.Pointer(pCache)).FpCValue = v1 pBuf = v1 if pBuf == uintptr(0) { return int32(SQLITE_NOMEM) } - rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer(pC + 36)), uint32(iOffset), uint32(len1), pBuf) + rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer(pC + 36)), libc.Uint32FromInt64(iOffset), libc.Uint32FromInt32(len1), pBuf) if rc != 0 { return rc } @@ -70118,21 +66957,20 @@ func _vdbeColumnFromOverflow(tls *libc.TLS, pC uintptr, iCol int32, t int32, iOf } else { pBuf = (*TVdbeTxtBlbCache)(unsafe.Pointer(pCache)).FpCValue } - _ = libc.Int32FromInt32(0) _sqlite3RCStrRef(tls, pBuf) if t&int32(1) != 0 { - rc = _sqlite3VdbeMemSetStr(tls, pDest, pBuf, int64(len1), uint8(encoding), __ccgo_fp(_sqlite3RCStrUnref)) + rc = _sqlite3VdbeMemSetStr(tls, pDest, pBuf, int64(len1), libc.Uint8FromInt32(encoding), __ccgo_fp(_sqlite3RCStrUnref)) p2 = pDest + 16 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(MEM_Term)) } else { rc = _sqlite3VdbeMemSetStr(tls, pDest, pBuf, int64(len1), uint8(0), __ccgo_fp(_sqlite3RCStrUnref)) } } else { - rc = _sqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(pC + 36)), uint32(iOffset), uint32(len1), pDest) + rc = _sqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(pC + 36)), libc.Uint32FromInt64(iOffset), libc.Uint32FromInt32(len1), pDest) if rc != 0 { return rc } - _sqlite3VdbeSerialGet(tls, (*TMem)(unsafe.Pointer(pDest)).Fz, uint32(t), pDest) + _sqlite3VdbeSerialGet(tls, (*TMem)(unsafe.Pointer(pDest)).Fz, libc.Uint32FromInt32(t), pDest) if t&int32(1) != 0 && encoding == int32(SQLITE_UTF8) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pDest)).Fz + uintptr(len1))) = 0 p3 = pDest + 16 @@ -70245,13 +67083,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOut = uintptr(0) /* Output operand */ colCacheCtr = uint32(0) /* Column cache counter */ /*** INSERT STACK UNION HERE ***/ - _ = libc.Int32FromInt32(0) /* sqlite3_step() verifies this */ + /* sqlite3_step() verifies this */ if (*TVdbe)(unsafe.Pointer(p)).FlockMask != uint32(0) { _sqlite3VdbeEnter(tls, p) } if (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != 0 { iPrior = *(*Tu32)(unsafe.Pointer(p + 156 + 4*4)) - _ = libc.Int32FromInt32(0) nProgressLimit = uint64((*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps - iPrior%(*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps) } else { nProgressLimit = libc.Uint64FromUint32(0xffffffff) | libc.Uint64FromUint32(0xffffffff)<<libc.Int32FromInt32(32) @@ -70261,11 +67098,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** sqlite3_column_text16() failed. */ goto no_mem } - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).FiCurrentTime = 0 - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 if libc.AtomicLoadNInt32(db+304, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { goto abort_due_to_interrupt @@ -70277,8 +67111,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Errors are detected by individual opcodes, with an immediate ** jumps to abort_due_to_error. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) nVmStep++ /* Only allow tracing if SQLITE_DEBUG is defined. */ @@ -70286,7 +67118,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** if we have a special test build. */ /* Sanity checking on other operands */ - switch int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) { + switch libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) { case int32(OP_Goto): goto _2 case int32(OP_Gosub): @@ -70734,7 +67566,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** a return code SQLITE_ABORT. */ for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { - _ = libc.Int32FromInt32(0) nProgressLimit += uint64((*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps) if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxProgress})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0 { nProgressLimit = libc.Uint64FromUint32(0xffffffff) | libc.Uint64FromUint32(0xffffffff)<<libc.Int32FromInt32(32) @@ -70750,9 +67581,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _3: ; /* jump */ - _ = libc.Int32FromInt32(0) pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pIn1)).Fflags = uint16(MEM_Int) *(*Ti64)(unsafe.Pointer(pIn1)) = int64((int32(pOp) - int32(aOp)) / 20) goto jump_to_p2_and_check_for_interrupt @@ -70781,7 +67610,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _4: ; /* in1 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 != 0 { } pOp = aOp + uintptr(*(*Ti64)(unsafe.Pointer(pIn1)))*20 @@ -70803,11 +67632,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _5: ; /* jump0 */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer(pOut)) = int64((*TOp)(unsafe.Pointer(pOp)).Fp3 - int32(1)) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Int) if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { @@ -70818,8 +67643,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto jump_to_p2 jump_to_p2: ; - _ = libc.Int32FromInt32(0) /* There are never any jumps to instruction 0 */ - _ = libc.Int32FromInt32(0) /* Jumps must be in range */ + /* There are never any jumps to instruction 0 */ + /* Jumps must be in range */ pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*20 goto _187 /* Opcode: EndCoroutine P1 * * * * @@ -70835,11 +67660,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _6: ; pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCaller = aOp + uintptr(*(*Ti64)(unsafe.Pointer(pIn1)))*20 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer(pIn1)) = int64((int32(pOp)-int32((*TVdbe)(unsafe.Pointer(p)).FaOp))/20 - int32(1)) pOp = aOp + uintptr((*TVdbeOp)(unsafe.Pointer(pCaller)).Fp2-int32(1))*20 goto _187 @@ -70859,7 +67680,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _7: ; pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pIn1)).Fflags = uint16(MEM_Int) pcDest = int32(*(*Ti64)(unsafe.Pointer(pIn1))) *(*Ti64)(unsafe.Pointer(pIn1)) = int64((int32(pOp) - int32(aOp)) / 20) @@ -70876,7 +67696,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _8: ; /* in3 */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - if int32((*TMem)(unsafe.Pointer(pIn3)).Fflags)&int32(MEM_Null) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn3)).Fflags)&int32(MEM_Null) == 0 { goto _187 } /* Opcode: Halt P1 P2 * P4 P5 @@ -70914,7 +67734,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* A deliberately coded "OP_Halt SQLITE_INTERNAL * * * *" opcode indicates ** something is wrong with the code generator. Raise an assertion in order ** to bring this to the attention of fuzzers and other testing tools. */ - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).FpFrame != 0 && (*TOp)(unsafe.Pointer(pOp)).Fp1 == SQLITE_OK { /* Halt the sub-program. Return control to the parent frame. */ pFrame = (*TVdbe)(unsafe.Pointer(p)).FpFrame @@ -70936,11 +67755,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto _187 } (*TVdbe)(unsafe.Pointer(p)).Frc = (*TOp)(unsafe.Pointer(pOp)).Fp1 - (*TVdbe)(unsafe.Pointer(p)).FerrorAction = uint8((*TOp)(unsafe.Pointer(pOp)).Fp2) - _ = libc.Int32FromInt32(0) + (*TVdbe)(unsafe.Pointer(p)).FerrorAction = libc.Uint8FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp2) if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5678, libc.VaList(bp+672, _azType[int32((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5678, libc.VaList(bp+672, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5699, libc.VaList(bp+672, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } @@ -70951,12 +67769,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5706, libc.VaList(bp+672, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) } rc = _sqlite3VdbeHalt(tls, p) - _ = libc.Int32FromInt32(0) if rc == int32(SQLITE_BUSY) { (*TVdbe)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { v188 = int32(SQLITE_ERROR) } else { @@ -70984,7 +67799,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _11: ; /* out2 */ pOut = _out2Prerelease(tls, p, pOp) - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer(pOut)) = *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))) goto _187 /* Opcode: Real * P2 * P4 * @@ -70997,7 +67811,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* same as TK_FLOAT, out2 */ pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Real) - _ = libc.Int32FromInt32(0) *(*float64)(unsafe.Pointer(pOut)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))) goto _187 /* Opcode: String8 * P2 * P4 * @@ -71010,20 +67823,16 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _13: ; /* same as TK_STRING, out2 */ - _ = libc.Int32FromInt32(0) pOut = _out2Prerelease(tls, p, pOp) (*TOp)(unsafe.Pointer(pOp)).Fp1 = _sqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pOp + 16))) - if int32(encoding) != int32(SQLITE_UTF8) { + if libc.Int32FromUint8(encoding) != int32(SQLITE_UTF8) { rc = _sqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16)), int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) - _ = libc.Int32FromInt32(0) if rc != 0 { goto too_big } - if SQLITE_OK != _sqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) { + if SQLITE_OK != _sqlite3VdbeChangeEncoding(tls, pOut, libc.Int32FromUint8(encoding)) { goto no_mem } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pOut)).FszMalloc = 0 p189 = pOut + 16 *(*Tu16)(unsafe.Pointer(p189)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p189))) | libc.Int32FromInt32(MEM_Static)) @@ -71038,7 +67847,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto too_big } (*TOp)(unsafe.Pointer(pOp)).Fopcode = uint8(OP_String) - _ = libc.Int32FromInt32(0) /* Opcode: String P1 P2 P3 P4 P5 ** Synopsis: r[P2]='P4' (len=P1) ** @@ -71053,9 +67861,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _14: ; /* out2 */ - _ = libc.Int32FromInt32(0) pOut = _out2Prerelease(tls, p, pOp) - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Static) | libc.Int32FromInt32(MEM_Term)) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Static) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pOut)).Fz = *(*uintptr)(unsafe.Pointer(pOp + 16)) (*TMem)(unsafe.Pointer(pOut)).Fn = (*TOp)(unsafe.Pointer(pOp)).Fp1 (*TMem)(unsafe.Pointer(pOut)).Fenc = encoding @@ -71100,13 +67907,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; pOut = _out2Prerelease(tls, p, pOp) cnt = (*TOp)(unsafe.Pointer(pOp)).Fp3 - (*TOp)(unsafe.Pointer(pOp)).Fp2 - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { v191 = libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Cleared) } else { v191 = int32(MEM_Null) } - v190 = uint16(v191) + v190 = libc.Uint16FromInt32(v191) nullFlag = v190 (*TMem)(unsafe.Pointer(pOut)).Fflags = v190 (*TMem)(unsafe.Pointer(pOut)).Fn = 0 @@ -71128,9 +67934,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _17: ; - _ = libc.Int32FromInt32(0) pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_Undefined)|libc.Int32FromInt32(MEM_AffMask)) | int32(MEM_Null)) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_Undefined)|libc.Int32FromInt32(MEM_AffMask)) | int32(MEM_Null)) goto _187 /* Opcode: Blob P1 P2 * P4 * ** Synopsis: r[P2]=P4 (len=P1) @@ -71141,7 +67946,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _18: ; /* out2 */ - _ = libc.Int32FromInt32(0) pOut = _out2Prerelease(tls, p, pOp) if *(*uintptr)(unsafe.Pointer(pOp + 16)) == uintptr(0) { _sqlite3VdbeMemSetZeroBlob(tls, pOut, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -71160,13 +67964,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _19: ; /* Value being transferred */ - _ = libc.Int32FromInt32(0) pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1-int32(1))*40 if _sqlite3VdbeMemTooBig(tls, pVar) != 0 { goto too_big } pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - if int32((*TMem)(unsafe.Pointer(pOut)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { _sqlite3VdbeMemSetNull(tls, pOut) } libc.Xmemcpy(tls, pOut, pVar, uint32(libc.UintptrFromInt32(0)+20)) @@ -71189,16 +67992,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { n = (*TOp)(unsafe.Pointer(pOp)).Fp3 p1 = (*TOp)(unsafe.Pointer(pOp)).Fp1 p2 = (*TOp)(unsafe.Pointer(pOp)).Fp2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pIn1 = aMem + uintptr(p1)*40 pOut = aMem + uintptr(p2)*40 for { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemMove(tls, pOut, pIn1) - if int32((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Ephem) != 0 && _sqlite3VdbeMemMakeWriteable(tls, pOut) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Ephem) != 0 && _sqlite3VdbeMemMakeWriteable(tls, pOut) != 0 { goto no_mem } pIn1 += 40 @@ -71231,13 +68029,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { n1 = (*TOp)(unsafe.Pointer(pOp)).Fp3 pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - _ = libc.Int32FromInt32(0) for int32(1) != 0 { _sqlite3VdbeMemShallowCopy(tls, pOut, pIn1, int32(MEM_Ephem)) - if int32((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Ephem) != 0 && _sqlite3VdbeMemMakeWriteable(tls, pOut) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Ephem) != 0 && _sqlite3VdbeMemMakeWriteable(tls, pOut) != 0 { goto no_mem } - if int32((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Subtype) != 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(0x0002) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Subtype) != 0 && libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(0x0002) != 0 { p196 = pOut + 16 *(*Tu16)(unsafe.Pointer(p196)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p196))) & ^libc.Int32FromInt32(MEM_Subtype)) } @@ -71267,7 +68064,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* out2 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemShallowCopy(tls, pOut, pIn1, int32(MEM_Ephem)) goto _187 /* Opcode: IntCopy P1 P2 * * * @@ -71281,7 +68077,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _23: ; /* out2 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 _sqlite3VdbeMemSetInt64(tls, pOut, *(*Ti64)(unsafe.Pointer(pIn1))) goto _187 @@ -71315,15 +68110,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _25: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TVdbe)(unsafe.Pointer(p)).FcacheCtr = (*TVdbe)(unsafe.Pointer(p)).FcacheCtr + uint32(2) | uint32(1) (*TVdbe)(unsafe.Pointer(p)).FpResultRow = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_ROW) != 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_ROW) != 0 { (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_ROW), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) } (*TVdbe)(unsafe.Pointer(p)).Fpc = (int32(pOp)-int32(aOp))/20 + int32(1) @@ -71347,37 +68139,36 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pIn2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - _ = libc.Int32FromInt32(0) flags1 = (*TMem)(unsafe.Pointer(pIn1)).Fflags - if (int32(flags1)|int32((*TMem)(unsafe.Pointer(pIn2)).Fflags))&int32(MEM_Null) != 0 { + if (libc.Int32FromUint16(flags1)|libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn2)).Fflags))&int32(MEM_Null) != 0 { _sqlite3VdbeMemSetNull(tls, pOut) goto _187 } - if int32(flags1)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) == 0 { + if libc.Int32FromUint16(flags1)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) == 0 { if _sqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(0)) != 0 { goto no_mem } - flags1 = uint16(int32((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) + flags1 = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) } else { - if int32(flags1)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16(flags1)&int32(MEM_Zero) != 0 { if _sqlite3VdbeMemExpandBlob(tls, pIn1) != 0 { goto no_mem } - flags1 = uint16(int32((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) + flags1 = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) } } flags2 = (*TMem)(unsafe.Pointer(pIn2)).Fflags - if int32(flags2)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) == 0 { + if libc.Int32FromUint16(flags2)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) == 0 { if _sqlite3VdbeMemStringify(tls, pIn2, encoding, uint8(0)) != 0 { goto no_mem } - flags2 = uint16(int32((*TMem)(unsafe.Pointer(pIn2)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) + flags2 = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn2)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) } else { - if int32(flags2)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16(flags2)&int32(MEM_Zero) != 0 { if _sqlite3VdbeMemExpandBlob(tls, pIn2) != 0 { goto no_mem } - flags2 = uint16(int32((*TMem)(unsafe.Pointer(pIn2)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) + flags2 = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn2)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) } } nByte = int64((*TMem)(unsafe.Pointer(pIn1)).Fn + (*TMem)(unsafe.Pointer(pIn2)).Fn) @@ -71387,16 +68178,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if _sqlite3VdbeMemGrow(tls, pOut, int32(nByte)+int32(2), libc.BoolInt32(pOut == pIn2)) != 0 { goto no_mem } - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Str)) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Str)) if pOut != pIn2 { - libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pOut)).Fz, (*TMem)(unsafe.Pointer(pIn2)).Fz, uint32((*TMem)(unsafe.Pointer(pIn2)).Fn)) - _ = libc.Int32FromInt32(0) + libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pOut)).Fz, (*TMem)(unsafe.Pointer(pIn2)).Fz, libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pIn2)).Fn)) (*TMem)(unsafe.Pointer(pIn2)).Fflags = flags2 } - libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pOut)).Fz+uintptr((*TMem)(unsafe.Pointer(pIn2)).Fn), (*TMem)(unsafe.Pointer(pIn1)).Fz, uint32((*TMem)(unsafe.Pointer(pIn1)).Fn)) - _ = libc.Int32FromInt32(0) + libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pOut)).Fz+uintptr((*TMem)(unsafe.Pointer(pIn2)).Fn), (*TMem)(unsafe.Pointer(pIn1)).Fz, libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pIn1)).Fn)) (*TMem)(unsafe.Pointer(pIn1)).Fflags = flags1 - if int32(encoding) > int32(SQLITE_UTF8) { + if libc.Int32FromUint8(encoding) > int32(SQLITE_UTF8) { nByte &= int64(^libc.Int32FromInt32(1)) } *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pOut)).Fz + uintptr(nByte))) = 0 @@ -71459,7 +68248,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 type2 = (*TMem)(unsafe.Pointer(pIn2)).Fflags pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { + if !(libc.Int32FromUint16(type1)&libc.Int32FromUint16(type2)&int32(MEM_Int) != 0) { goto _200 } goto int_math @@ -71467,7 +68256,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) *(*Ti64)(unsafe.Pointer(bp)) = *(*Ti64)(unsafe.Pointer(pIn2)) - switch int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) { + switch libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) { case int32(OP_Add): if _sqlite3AddInt64(tls, bp, iA) != 0 { goto fp_math @@ -71499,11 +68288,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { break } *(*Ti64)(unsafe.Pointer(pOut)) = *(*Ti64)(unsafe.Pointer(bp)) - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) goto _201 _200: ; - if !((int32(type1)|int32(type2))&int32(MEM_Null) != 0) { + if !((libc.Int32FromUint16(type1)|libc.Int32FromUint16(type2))&int32(MEM_Null) != 0) { goto _202 } goto arithmetic_result_is_null @@ -71512,7 +68301,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; type1 = _numericType(tls, pIn1) type2 = _numericType(tls, pIn2) - if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { + if libc.Int32FromUint16(type1)&libc.Int32FromUint16(type2)&int32(MEM_Int) != 0 { goto int_math } goto fp_math @@ -71520,7 +68309,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; rA = _sqlite3VdbeRealValue(tls, pIn1) rB = _sqlite3VdbeRealValue(tls, pIn2) - switch int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) { + switch libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) { case int32(OP_Add): rB += rA case int32(OP_Subtract): @@ -71549,7 +68338,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto arithmetic_result_is_null } *(*float64)(unsafe.Pointer(pOut)) = rB - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Real)) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Real)) _203: ; _201: @@ -71577,7 +68366,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _32: ; - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { _sqlite3VdbeMemSetInt64(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40, 0) } @@ -71623,25 +68411,23 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pIn2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - if (int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)|int32((*TMem)(unsafe.Pointer(pIn2)).Fflags))&int32(MEM_Null) != 0 { + if (libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)|libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn2)).Fflags))&int32(MEM_Null) != 0 { _sqlite3VdbeMemSetNull(tls, pOut) goto _187 } *(*Ti64)(unsafe.Pointer(bp + 8)) = _sqlite3VdbeIntValue(tls, pIn2) iB1 = _sqlite3VdbeIntValue(tls, pIn1) op = (*TOp)(unsafe.Pointer(pOp)).Fopcode - if int32(op) == int32(OP_BitAnd) { + if libc.Int32FromUint8(op) == int32(OP_BitAnd) { *(*Ti64)(unsafe.Pointer(bp + 8)) &= iB1 } else { - if int32(op) == int32(OP_BitOr) { + if libc.Int32FromUint8(op) == int32(OP_BitOr) { *(*Ti64)(unsafe.Pointer(bp + 8)) |= iB1 } else { if iB1 != 0 { - _ = libc.Int32FromInt32(0) /* If shifting by a negative amount, shift in the other direction */ if iB1 < 0 { - _ = libc.Int32FromInt32(0) - op = uint8(libc.Int32FromInt32(2)*libc.Int32FromInt32(OP_ShiftLeft) + libc.Int32FromInt32(1) - int32(op)) + op = libc.Uint8FromInt32(libc.Int32FromInt32(2)*libc.Int32FromInt32(OP_ShiftLeft) + libc.Int32FromInt32(1) - libc.Int32FromUint8(op)) if iB1 > int64(-libc.Int32FromInt32(64)) { v204 = -iB1 } else { @@ -71650,7 +68436,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { iB1 = v204 } if iB1 >= int64(64) { - if *(*Ti64)(unsafe.Pointer(bp + 8)) >= 0 || int32(op) == int32(OP_ShiftLeft) { + if *(*Ti64)(unsafe.Pointer(bp + 8)) >= 0 || libc.Int32FromUint8(op) == int32(OP_ShiftLeft) { v205 = 0 } else { v205 = -int32(1) @@ -71658,10 +68444,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(bp + 8)) = int64(v205) } else { libc.Xmemcpy(tls, bp+16, bp+8, uint32(8)) - if int32(op) == int32(OP_ShiftLeft) { - *(*Tu64)(unsafe.Pointer(bp + 16)) <<= uint64(iB1) + if libc.Int32FromUint8(op) == int32(OP_ShiftLeft) { + *(*Tu64)(unsafe.Pointer(bp + 16)) <<= libc.Uint64FromInt64(iB1) } else { - *(*Tu64)(unsafe.Pointer(bp + 16)) >>= uint64(iB1) + *(*Tu64)(unsafe.Pointer(bp + 16)) >>= libc.Uint64FromInt64(iB1) /* Sign-extend on a right shift of a negative number */ if *(*Ti64)(unsafe.Pointer(bp + 8)) < 0 { *(*Tu64)(unsafe.Pointer(bp + 16)) |= (libc.Uint64FromUint32(0xffffffff)<<libc.Int32FromInt32(32) | libc.Uint64FromUint32(0xffffffff)) << (int64(64) - iB1) @@ -71673,7 +68459,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } *(*Ti64)(unsafe.Pointer(pOut)) = *(*Ti64)(unsafe.Pointer(bp + 8)) - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) goto _187 /* Opcode: AddImm P1 P2 * * * ** Synopsis: r[P1]=r[P1]+P2 @@ -71687,7 +68473,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* in1 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 _sqlite3VdbeMemIntegerify(tls, pIn1) - *(*Tu64)(unsafe.Pointer(pIn1)) += uint64((*TOp)(unsafe.Pointer(pOp)).Fp2) + *(*Tu64)(unsafe.Pointer(pIn1)) += libc.Uint64FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp2) goto _187 /* Opcode: MustBeInt P1 P2 * * * ** @@ -71699,9 +68485,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _38: ; /* jump0, in1 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) == 0 { _applyAffinity(tls, pIn1, int8(SQLITE_AFF_NUMERIC), encoding) - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) == 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { rc = int32(SQLITE_MISMATCH) goto abort_due_to_error @@ -71710,7 +68496,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } - (*TMem)(unsafe.Pointer(pIn1)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) + (*TMem)(unsafe.Pointer(pIn1)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) goto _187 /* Opcode: RealAffinity P1 * * * * ** @@ -71724,7 +68510,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _39: ; /* in1 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { _sqlite3VdbeMemRealify(tls, pIn1) } goto _187 @@ -71745,9 +68531,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _40: ; /* in1 */ - _ = libc.Int32FromInt32(0) pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Zero) != 0 { v206 = _sqlite3VdbeMemExpandBlob(tls, pIn1) } else { v206 = 0 @@ -71756,7 +68541,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { goto abort_due_to_error } - rc = _sqlite3VdbeMemCast(tls, pIn1, uint8((*TOp)(unsafe.Pointer(pOp)).Fp2), encoding) + rc = _sqlite3VdbeMemCast(tls, pIn1, libc.Uint8FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp2), encoding) if rc != 0 { goto abort_due_to_error } @@ -71869,7 +68654,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 flags11 = (*TMem)(unsafe.Pointer(pIn1)).Fflags flags3 = (*TMem)(unsafe.Pointer(pIn3)).Fflags - if int32(flags11)&int32(flags3)&int32(MEM_Int) != 0 { + if libc.Int32FromUint16(flags11)&libc.Int32FromUint16(flags3)&int32(MEM_Int) != 0 { /* Common case of comparison of two integers */ if *(*Ti64)(unsafe.Pointer(pIn3)) > *(*Ti64)(unsafe.Pointer(pIn1)) { if *(*uint8)(unsafe.Pointer(_sqlite3aGTb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fopcode))) != 0 { @@ -71891,19 +68676,17 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } goto _187 } - if (int32(flags11)|int32(flags3))&int32(MEM_Null) != 0 { + if (libc.Int32FromUint16(flags11)|libc.Int32FromUint16(flags3))&int32(MEM_Null) != 0 { /* One or both operands are NULL */ - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(SQLITE_NULLEQ) != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(SQLITE_NULLEQ) != 0 { /* If SQLITE_NULLEQ is set (which will only happen if the operator is ** OP_Eq or OP_Ne) then take the jump or not depending on whether ** or not both operands are null. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32(flags11)&int32(flags3)&int32(MEM_Null) != 0 && int32(flags3)&int32(MEM_Cleared) == 0 { + if libc.Int32FromUint16(flags11)&libc.Int32FromUint16(flags3)&int32(MEM_Null) != 0 && libc.Int32FromUint16(flags3)&int32(MEM_Cleared) == 0 { res = 0 /* Operands are equal */ } else { - if int32(flags3)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16(flags3)&int32(MEM_Null) != 0 { v207 = -int32(1) } else { v207 = +libc.Int32FromInt32(1) @@ -71915,7 +68698,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** then the result is always NULL. ** The jump is taken if the SQLITE_JUMPIFNULL bit is set. */ - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(SQLITE_JUMPIFNULL) != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(SQLITE_JUMPIFNULL) != 0 { goto jump_to_p2 } iCompare = int32(1) /* Operands are not equal */ @@ -71924,44 +68707,42 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } else { /* Neither operand is NULL and we couldn't do the special high-speed ** integer comparison case. So do a general-case comparison. */ - affinity = int8(int32((*TOp)(unsafe.Pointer(pOp)).Fp5) & int32(SQLITE_AFF_MASK)) + affinity = int8(libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) & int32(SQLITE_AFF_MASK)) if int32(affinity) >= int32(SQLITE_AFF_NUMERIC) { - if (int32(flags11)|int32(flags3))&int32(MEM_Str) != 0 { - if int32(flags11)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { + if (libc.Int32FromUint16(flags11)|libc.Int32FromUint16(flags3))&int32(MEM_Str) != 0 { + if libc.Int32FromUint16(flags11)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { _applyNumericAffinity(tls, pIn1, 0) - _ = libc.Int32FromInt32(0) flags3 = (*TMem)(unsafe.Pointer(pIn3)).Fflags } - if int32(flags3)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { + if libc.Int32FromUint16(flags3)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { _applyNumericAffinity(tls, pIn3, 0) } } } else { - if int32(affinity) == int32(SQLITE_AFF_TEXT) && (int32(flags11)|int32(flags3))&int32(MEM_Str) != 0 { - if int32(flags11)&int32(MEM_Str) != 0 { + if int32(affinity) == int32(SQLITE_AFF_TEXT) && (libc.Int32FromUint16(flags11)|libc.Int32FromUint16(flags3))&int32(MEM_Str) != 0 { + if libc.Int32FromUint16(flags11)&int32(MEM_Str) != 0 { p208 = pIn1 + 16 *(*Tu16)(unsafe.Pointer(p208)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p208))) & ^(libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal))) } else { - if int32(flags11)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16(flags11)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) != 0 { _sqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(1)) - flags11 = uint16(int32((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^libc.Int32FromInt32(MEM_TypeMask) | int32(flags11)&int32(MEM_TypeMask)) + flags11 = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^libc.Int32FromInt32(MEM_TypeMask) | libc.Int32FromUint16(flags11)&int32(MEM_TypeMask)) if pIn1 == pIn3 { - flags3 = uint16(int32(flags11) | int32(MEM_Str)) + flags3 = libc.Uint16FromInt32(libc.Int32FromUint16(flags11) | int32(MEM_Str)) } } } - if int32(flags3)&int32(MEM_Str) != 0 { + if libc.Int32FromUint16(flags3)&int32(MEM_Str) != 0 { p209 = pIn3 + 16 *(*Tu16)(unsafe.Pointer(p209)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p209))) & ^(libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal))) } else { - if int32(flags3)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16(flags3)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) != 0 { _sqlite3VdbeMemStringify(tls, pIn3, encoding, uint8(1)) - flags3 = uint16(int32((*TMem)(unsafe.Pointer(pIn3)).Fflags) & ^libc.Int32FromInt32(MEM_TypeMask) | int32(flags3)&int32(MEM_TypeMask)) + flags3 = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn3)).Fflags) & ^libc.Int32FromInt32(MEM_TypeMask) | libc.Int32FromUint16(flags3)&int32(MEM_TypeMask)) } } } } - _ = libc.Int32FromInt32(0) res = _sqlite3MemCompare(tls, pIn3, pIn1, *(*uintptr)(unsafe.Pointer(pOp + 16))) } /* At this point, res is negative, zero, or positive if reg[P1] is @@ -71970,25 +68751,18 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** operator actually is. The next block of code depends on the fact ** that the 6 comparison operators are consecutive integers in this ** order: NE, EQ, GT, LE, LT, GE */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if res < 0 { - res21 = int32(*(*uint8)(unsafe.Pointer(_sqlite3aLTb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fopcode)))) + res21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(_sqlite3aLTb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fopcode)))) } else { if res == 0 { - res21 = int32(*(*uint8)(unsafe.Pointer(_sqlite3aEQb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fopcode)))) + res21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(_sqlite3aEQb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fopcode)))) } else { - res21 = int32(*(*uint8)(unsafe.Pointer(_sqlite3aGTb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fopcode)))) + res21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(_sqlite3aGTb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fopcode)))) } } iCompare = res /* Undo any changes made by applyAffinity() to the input registers. */ - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pIn3)).Fflags = flags3 - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pIn1)).Fflags = flags11 if res21 != 0 { goto jump_to_p2 @@ -72008,7 +68782,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _47: ; /* same as TK_ESCAPE, jump */ - _ = libc.Int32FromInt32(0) if iCompare == 0 { goto jump_to_p2 } @@ -72026,10 +68799,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _48: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto _187 /* Opcode: Compare P1 P2 P3 P4 P5 ** Synopsis: r[P1@P3] <-> r[P2@P3] @@ -72055,19 +68824,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _49: ; /* The permutation */ - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_PERMUTE) == 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_PERMUTE) == 0 { aPermute = uintptr(0) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) aPermute = *(*uintptr)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*20 + 16)) + uintptr(1)*4 - _ = libc.Int32FromInt32(0) } n2 = (*TOp)(unsafe.Pointer(pOp)).Fp3 pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p11 = (*TOp)(unsafe.Pointer(pOp)).Fp1 p21 = (*TOp)(unsafe.Pointer(pOp)).Fp2 i = 0 @@ -72078,17 +68841,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if aPermute != 0 { v211 = *(*Tu32)(unsafe.Pointer(aPermute + uintptr(i)*4)) } else { - v211 = uint32(i) + v211 = libc.Uint32FromInt32(i) } idx = v211 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pColl = *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) - bRev = int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i)))) & int32(KEYINFO_ORDER_DESC) - iCompare = _sqlite3MemCompare(tls, aMem+uintptr(uint32(p11)+idx)*40, aMem+uintptr(uint32(p21)+idx)*40, pColl) + bRev = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i)))) & int32(KEYINFO_ORDER_DESC) + iCompare = _sqlite3MemCompare(tls, aMem+uintptr(libc.Uint32FromInt32(p11)+idx)*40, aMem+uintptr(libc.Uint32FromInt32(p21)+idx)*40, pColl) if iCompare != 0 { - if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i))))&int32(KEYINFO_ORDER_BIGNULL) != 0 && (int32((*(*TMem)(unsafe.Pointer(aMem + uintptr(uint32(p11)+idx)*40))).Fflags)&int32(MEM_Null) != 0 || int32((*(*TMem)(unsafe.Pointer(aMem + uintptr(uint32(p21)+idx)*40))).Fflags)&int32(MEM_Null) != 0) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i))))&int32(KEYINFO_ORDER_BIGNULL) != 0 && (libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(aMem + uintptr(libc.Uint32FromInt32(p11)+idx)*40))).Fflags)&int32(MEM_Null) != 0 || libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(aMem + uintptr(libc.Uint32FromInt32(p21)+idx)*40))).Fflags)&int32(MEM_Null) != 0) { iCompare = -iCompare } if bRev != 0 { @@ -72101,7 +68861,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; i++ } - _ = libc.Int32FromInt32(0) goto _187 /* Opcode: Jump P1 P2 P3 * * ** @@ -72113,8 +68872,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _50: ; /* jump */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iCompare < 0 { pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1-int32(1))*20 } else { @@ -72151,17 +68908,17 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* Right operand: 0==FALSE, 1==TRUE, 2==UNKNOWN or NULL */ v11 = _sqlite3VdbeBooleanValue(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40, int32(2)) v21 = _sqlite3VdbeBooleanValue(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40, int32(2)) - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_And) { - v11 = int32(_and_logic[v11*int32(3)+v21]) + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_And) { + v11 = libc.Int32FromUint8(_and_logic[v11*int32(3)+v21]) } else { - v11 = int32(_or_logic[v11*int32(3)+v21]) + v11 = libc.Int32FromUint8(_or_logic[v11*int32(3)+v21]) } pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 if v11 == int32(2) { - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Null)) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Null)) } else { *(*Ti64)(unsafe.Pointer(pOut)) = int64(v11) - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) } goto _187 /* Opcode: IsTrue P1 P2 P3 P4 * @@ -72186,9 +68943,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _53: ; /* in1, out2 */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemSetInt64(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40, int64(_sqlite3VdbeBooleanValue(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40, (*TOp)(unsafe.Pointer(pOp)).Fp3)^*(*int32)(unsafe.Pointer(pOp + 16)))) goto _187 /* Opcode: Not P1 P2 * * * @@ -72202,7 +68956,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* same as TK_NOT, in1, out2 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) == 0 { _sqlite3VdbeMemSetInt64(tls, pOut, libc.BoolInt64(!(_sqlite3VdbeBooleanValue(tls, pIn1, 0) != 0))) } else { _sqlite3VdbeMemSetNull(tls, pOut) @@ -72220,7 +68974,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 _sqlite3VdbeMemSetNull(tls, pOut) - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) == 0 { (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Int) *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } @@ -72244,10 +68998,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _56: ; /* Address of this instruction */ - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).FpFrame != 0 { - iAddr = uint32((int32(pOp) - int32((*TVdbe)(unsafe.Pointer(p)).FaOp)) / 20) - if int32(*(*Tu8)(unsafe.Pointer((*TVdbeFrame)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr(iAddr/uint32(8)))))&(int32(1)<<(iAddr&uint32(7))) != 0 { + iAddr = libc.Uint32FromInt32((int32(pOp) - int32((*TVdbe)(unsafe.Pointer(p)).FaOp)) / 20) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TVdbeFrame)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr(iAddr/uint32(8)))))&(int32(1)<<(iAddr&uint32(7))) != 0 { goto jump_to_p2 } p212 = (*TVdbeFrame)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr(iAddr/uint32(8)) @@ -72293,7 +69046,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _59: ; /* same as TK_ISNULL, jump, in1 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) != 0 { goto jump_to_p2 } goto _187 @@ -72330,13 +69083,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _60: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp1 >= 0 { pC = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TOp)(unsafe.Pointer(pOp)).Fp3 < int32((*TVdbeCursor)(unsafe.Pointer(pC)).FnHdrParsed) { + if (*TOp)(unsafe.Pointer(pOp)).Fp3 < libc.Int32FromUint16((*TVdbeCursor)(unsafe.Pointer(pC)).FnHdrParsed) { serialType = *(*Tu32)(unsafe.Pointer(pC + 84 + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*4)) if serialType >= uint32(12) { if serialType&uint32(1) != 0 { @@ -72348,13 +69097,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { typeMask = uint16(_aMask[serialType]) } } else { - typeMask = uint16(int32(1) << (*(*int32)(unsafe.Pointer(pOp + 16)) - int32(1))) + typeMask = libc.Uint16FromInt32(int32(1) << (*(*int32)(unsafe.Pointer(pOp + 16)) - int32(1))) } } else { - _ = libc.Int32FromInt32(0) - typeMask = uint16(int32(1) << (Xsqlite3_value_type(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40) - int32(1))) + typeMask = libc.Uint16FromInt32(int32(1) << (Xsqlite3_value_type(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40) - int32(1))) } - if int32(typeMask)&int32((*TOp)(unsafe.Pointer(pOp)).Fp5) != 0 { + if libc.Int32FromUint16(typeMask)&libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) != 0 { goto jump_to_p2 } goto _187 @@ -72367,7 +69115,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _61: ; /* in1, in2, out2, in3 */ - if int32((*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40))).Fflags)&int32(MEM_Null) != 0 || int32((*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40))).Fflags)&int32(MEM_Null) != 0 || libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fflags)&int32(MEM_Null) != 0 { _sqlite3VdbeMemSetNull(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40) } else { _sqlite3VdbeMemSetInt64(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40, 0) @@ -72381,7 +69129,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _62: ; /* same as TK_NOTNULL, jump, in1 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) == 0 { goto jump_to_p2 } goto _187 @@ -72397,7 +69145,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _63: ; - _ = libc.Int32FromInt32(0) pC1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) if pC1 != 0 && (*TVdbeCursor)(unsafe.Pointer(pC1)).FnullRow != 0 { _sqlite3VdbeMemSetNull(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40) @@ -72421,10 +69168,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _64: ; /* The VDBE cursor */ - _ = libc.Int32FromInt32(0) pC2 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) pOut = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - if pC2 == uintptr(0) || int32((*TVdbeCursor)(unsafe.Pointer(pC2)).FeCurType) != CURTYPE_BTREE { + if pC2 == uintptr(0) || libc.Int32FromUint8((*TVdbeCursor)(unsafe.Pointer(pC2)).FeCurType) != CURTYPE_BTREE { _sqlite3VdbeMemSetNull(tls, pOut) } else { if (*TVdbeCursor)(unsafe.Pointer(pC2)).FdeferredMoveto != 0 { @@ -72464,29 +69210,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _65: ; /* PseudoTable input register */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + p22 = libc.Uint32FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp2) goto op_column_restart op_column_restart: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) aOffset = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaOffset - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TVdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus != (*TVdbe)(unsafe.Pointer(p)).FcacheCtr { /*OPTIMIZATION-IF-FALSE*/ if (*TVdbeCursor)(unsafe.Pointer(pC3)).FnullRow != 0 { - if int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FeCurType) == int32(CURTYPE_PSEUDO) && (*TVdbeCursor)(unsafe.Pointer(pC3)).FseekResult > 0 { + if libc.Int32FromUint8((*TVdbeCursor)(unsafe.Pointer(pC3)).FeCurType) == int32(CURTYPE_PSEUDO) && (*TVdbeCursor)(unsafe.Pointer(pC3)).FseekResult > 0 { /* For the special case of as pseudo-cursor, the seekResult field ** identifies the register that holds the record */ pReg = aMem + uintptr((*TVdbeCursor)(unsafe.Pointer(pC3)).FseekResult)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - v213 = uint32((*TMem)(unsafe.Pointer(pReg)).Fn) + v213 = libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pReg)).Fn) (*TVdbeCursor)(unsafe.Pointer(pC3)).FszRow = v213 (*TVdbeCursor)(unsafe.Pointer(pC3)).FpayloadSize = v213 (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow = (*TMem)(unsafe.Pointer(pReg)).Fz @@ -72498,7 +69234,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } else { pCrsr = *(*uintptr)(unsafe.Pointer(pC3 + 36)) if (*TVdbeCursor)(unsafe.Pointer(pC3)).FdeferredMoveto != 0 { - _ = libc.Int32FromInt32(0) if v215 = *(*uintptr)(unsafe.Pointer(pC3 + 12)) != 0; v215 { v214 = *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC3 + 12)) + uintptr(uint32(1)+p22)*4)) iMap = v214 @@ -72521,13 +69256,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto op_column_restart } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TVdbeCursor)(unsafe.Pointer(pC3)).FpayloadSize = _sqlite3BtreePayloadSize(tls, pCrsr) (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow = _sqlite3BtreePayloadFetch(tls, pCrsr, pC3+76) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Maximum page size is 64KiB */ + /* Maximum page size is 64KiB */ } (*TVdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = (*TVdbe)(unsafe.Pointer(p)).FcacheCtr v216 = uint32(*(*Tu8)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow))) @@ -72572,7 +69303,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** database file. */ zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow - _ = libc.Int32FromInt32(0) /* Conditional skipped */ + /* Conditional skipped */ goto op_column_read_header } } else { @@ -72611,11 +69342,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto op_column_read_header op_column_read_header: ; - i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) + i1 = libc.Int32FromUint16((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) offset64 = uint64(*(*Tu32)(unsafe.Pointer(aOffset + uintptr(i1)*4))) zHdr = zData + uintptr((*TVdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset) zEndHdr = zData + uintptr(*(*Tu32)(unsafe.Pointer(aOffset))) - for cond := true; cond; cond = uint32(i1) <= p22 && zHdr < zEndHdr { + for cond := true; cond; cond = libc.Uint32FromInt32(i1) <= p22 && zHdr < zEndHdr { v222 = uint32(*(*Tu8)(unsafe.Pointer(zHdr))) *(*Tu32)(unsafe.Pointer(bp + 64)) = v222 v221 = v222 @@ -72648,8 +69379,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto op_column_corrupt } } - (*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed = uint16(i1) - (*TVdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset = uint32(int32(zHdr) - int32(zData)) + (*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed = libc.Uint16FromInt32(i1) + (*TVdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset = libc.Uint32FromInt32(int32(zHdr) - int32(zData)) if (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow == uintptr(0) { _sqlite3VdbeMemRelease(tls, bp+24) } @@ -72682,14 +69413,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** reach this point if aOffset[p2], aOffset[p2+1], and pC->aType[p2] are ** all valid. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pDest = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pDest)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pDest)).Fflags)&(libc.Int32FromInt32(MEM_Agg)|libc.Int32FromInt32(MEM_Dyn)) != 0 { _sqlite3VdbeMemSetNull(tls, pDest) } - _ = libc.Int32FromInt32(0) if (*TVdbeCursor)(unsafe.Pointer(pC3)).FszRow >= *(*Tu32)(unsafe.Pointer(aOffset + uintptr(p22+uint32(1))*4)) { /* This is the common case where the desired content fits on the original ** page - where the content is not on an overflow page */ @@ -72697,7 +69424,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if *(*Tu32)(unsafe.Pointer(bp + 64)) < uint32(12) { _sqlite3VdbeSerialGet(tls, zData, *(*Tu32)(unsafe.Pointer(bp + 64)), pDest) } else { - v224 = int32((*(*Tu32)(unsafe.Pointer(bp + 64)) - libc.Uint32FromInt32(12)) / libc.Uint32FromInt32(2)) + v224 = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 64)) - libc.Uint32FromInt32(12)) / libc.Uint32FromInt32(2)) len1 = v224 (*TMem)(unsafe.Pointer(pDest)).Fn = v224 (*TMem)(unsafe.Pointer(pDest)).Fenc = encoding @@ -72712,18 +69439,17 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } else { (*TMem)(unsafe.Pointer(pDest)).Fz = (*TMem)(unsafe.Pointer(pDest)).FzMalloc } - libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pDest)).Fz, zData, uint32(len1)) + libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pDest)).Fz, zData, libc.Uint32FromInt32(len1)) *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pDest)).Fz + uintptr(len1))) = 0 *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pDest)).Fz + uintptr(len1+int32(1)))) = 0 (*TMem)(unsafe.Pointer(pDest)).Fflags = _aFlag1[*(*Tu32)(unsafe.Pointer(bp + 64))&uint32(1)] } } else { (*TMem)(unsafe.Pointer(pDest)).Fenc = encoding - _ = libc.Int32FromInt32(0) /* This branch happens only when content is on overflow pages */ - v225 = uint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp5) & libc.Int32FromInt32(OPFLAG_BYTELENARG)) + v225 = libc.Uint8FromInt32(libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) & libc.Int32FromInt32(OPFLAG_BYTELENARG)) p5 = v225 - if int32(v225) != 0 && (int32(p5) == int32(OPFLAG_TYPEOFARG) || *(*Tu32)(unsafe.Pointer(bp + 64)) >= uint32(12) && (*(*Tu32)(unsafe.Pointer(bp + 64))&uint32(1) == uint32(0) || int32(p5) == int32(OPFLAG_BYTELENARG))) || _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp + 64))) == uint32(0) { + if libc.Int32FromUint8(v225) != 0 && (libc.Int32FromUint8(p5) == int32(OPFLAG_TYPEOFARG) || *(*Tu32)(unsafe.Pointer(bp + 64)) >= uint32(12) && (*(*Tu32)(unsafe.Pointer(bp + 64))&uint32(1) == uint32(0) || libc.Int32FromUint8(p5) == int32(OPFLAG_BYTELENARG))) || _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp + 64))) == uint32(0) { /* Content is irrelevant for ** 1. the typeof() function, ** 2. the length(X) function if X is a blob, and @@ -72739,7 +69465,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _sqlite3VdbeSerialGet(tls, uintptr(unsafe.Pointer(&_sqlite3CtypeMap)), *(*Tu32)(unsafe.Pointer(bp + 64)), pDest) } else { - rc = _vdbeColumnFromOverflow(tls, pC3, int32(p22), int32(*(*Tu32)(unsafe.Pointer(bp + 64))), int64(*(*Tu32)(unsafe.Pointer(aOffset + uintptr(p22)*4))), (*TVdbe)(unsafe.Pointer(p)).FcacheCtr, colCacheCtr, pDest) + rc = _vdbeColumnFromOverflow(tls, pC3, libc.Int32FromUint32(p22), libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp + 64))), libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(aOffset + uintptr(p22)*4))), (*TVdbe)(unsafe.Pointer(p)).FcacheCtr, colCacheCtr, pDest) if rc != 0 { if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -72762,7 +69488,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*20 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96311)) + rc = _sqlite3CorruptError(tls, int32(96313)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -72793,10 +69519,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _66: ; - _ = libc.Int32FromInt32(0) pTab = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 i2 = 0 @@ -72804,8 +69527,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(i2 < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - if int32((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { goto _226 } if (*TOp)(unsafe.Pointer(pOp)).Fp3 != 0 { @@ -72813,27 +69536,25 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto _226 } } - _ = libc.Int32FromInt32(0) _applyAffinity(tls, pIn1, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).Faffinity, encoding) - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) == 0 { switch int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*12 + 4)) & 0xf0 >> 4)) { case int32(COLTYPE_BLOB): - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Blob) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Blob) == 0 { goto vdbe_type_error } case int32(COLTYPE_INTEGER): fallthrough case int32(COLTYPE_INT): - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) == 0 { goto vdbe_type_error } case int32(COLTYPE_TEXT): - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Str) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Str) == 0 { goto vdbe_type_error } case int32(COLTYPE_REAL): - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) != 0 { /* When applying REAL affinity, if the result is still an MEM_Int ** that will fit in 6 bytes, then change the type to MEM_IntReal ** so that we keep the high-resolution integer value but know that @@ -72851,7 +69572,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu16)(unsafe.Pointer(p230)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p230))) & ^libc.Int32FromInt32(MEM_Int)) } } else { - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&(libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&(libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) == 0 { goto vdbe_type_error } } @@ -72866,7 +69587,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; i2++ } - _ = libc.Int32FromInt32(0) goto _187 goto vdbe_type_error vdbe_type_error: @@ -72886,15 +69606,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _67: ; /* The affinity to be applied */ zAffinity = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 for int32(1) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _applyAffinity(tls, pIn1, *(*int8)(unsafe.Pointer(zAffinity)), encoding) - if int32(*(*int8)(unsafe.Pointer(zAffinity))) == int32(SQLITE_AFF_REAL) && int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) != 0 { + if int32(*(*int8)(unsafe.Pointer(zAffinity))) == int32(SQLITE_AFF_REAL) && libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Int) != 0 { /* When applying REAL affinity, if the result is still an MEM_Int ** that will fit in 6 bytes, then change the type to MEM_IntReal ** so that we keep the high-resolution integer value but know that @@ -72968,21 +69683,18 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { nZero = 0 /* Number of zero bytes at the end of the record */ nField = (*TOp)(unsafe.Pointer(pOp)).Fp1 zAffinity1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) pData0 = aMem + uintptr(nField)*40 nField = (*TOp)(unsafe.Pointer(pOp)).Fp2 pLast = pData0 + uintptr(nField-int32(1))*40 /* Identify the output register */ - _ = libc.Int32FromInt32(0) pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 /* Apply the requested affinity to all inputs */ - _ = libc.Int32FromInt32(0) if zAffinity1 != 0 { pRec = pData0 for cond := true; cond; cond = *(*int8)(unsafe.Pointer(zAffinity1)) != 0 { _applyAffinity(tls, pRec, *(*int8)(unsafe.Pointer(zAffinity1)), encoding) - if int32(*(*int8)(unsafe.Pointer(zAffinity1))) == int32(SQLITE_AFF_REAL) && int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Int) != 0 { + if int32(*(*int8)(unsafe.Pointer(zAffinity1))) == int32(SQLITE_AFF_REAL) && libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Int) != 0 { p235 = pRec + 16 *(*Tu16)(unsafe.Pointer(p235)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p235))) | libc.Int32FromInt32(MEM_IntReal)) p236 = pRec + 16 @@ -72990,7 +69702,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } zAffinity1++ pRec += 40 - _ = libc.Int32FromInt32(0) } } /* Loop through the elements that will make up the record to figure @@ -73021,33 +69732,31 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ pRec = pLast for cond := true; cond; cond = int32(1) != 0 { - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Null) != 0 { - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Zero) != 0 { /* Values with MEM_Null and MEM_Zero are created by xColumn virtual ** table methods that never invoke sqlite3_result_xxxxx() while ** computing an unchanging column value in an UPDATE statement. ** Give such values a special internal-use-only serial-type of 10 ** so that they can be passed through to xUpdate and have ** a true sqlite3_value_nochange(). */ - _ = libc.Int32FromInt32(0) (*TMem)(unsafe.Pointer(pRec)).FuTemp = uint32(10) } else { (*TMem)(unsafe.Pointer(pRec)).FuTemp = uint32(0) } nHdr++ } else { - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { /* Figure out whether to use 1, 2, 4, 6 or 8 bytes. */ i3 = *(*Ti64)(unsafe.Pointer(pRec)) if i3 < 0 { - uu = uint64(^i3) + uu = libc.Uint64FromInt64(^i3) } else { - uu = uint64(i3) + uu = libc.Uint64FromInt64(i3) } nHdr++ if uu <= uint64(127) { - if i3&int64(1) == i3 && int32((*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat) >= int32(4) { + if i3&int64(1) == i3 && libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat) >= int32(4) { (*TMem)(unsafe.Pointer(pRec)).FuTemp = uint32(8) + uint32(uu) } else { nData++ @@ -73071,7 +69780,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TMem)(unsafe.Pointer(pRec)).FuTemp = uint32(5) } else { nData += uint64(8) - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_IntReal) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_IntReal) != 0 { /* If the value is IntReal and is going to take up 8 bytes to store ** as an integer, then we might as well make it an 8-byte floating ** point value */ @@ -73090,22 +69799,20 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } else { - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Real) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Real) != 0 { nHdr++ nData += uint64(8) (*TMem)(unsafe.Pointer(pRec)).FuTemp = uint32(7) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - len11 = uint32((*TMem)(unsafe.Pointer(pRec)).Fn) - serial_type = len11*uint32(2) + uint32(12) + libc.BoolUint32(int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&libc.Int32FromInt32(MEM_Str) != libc.Int32FromInt32(0)) - if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Zero) != 0 { - serial_type += uint32(*(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pRec)).Fu)) * int32(2)) + len11 = libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pRec)).Fn) + serial_type = len11*uint32(2) + uint32(12) + libc.BoolUint32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&libc.Int32FromInt32(MEM_Str) != libc.Int32FromInt32(0)) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Zero) != 0 { + serial_type += libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pRec)).Fu)) * int32(2)) if nData != 0 { if _sqlite3VdbeMemExpandBlob(tls, pRec) != 0 { goto no_mem } - len11 += uint32(*(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pRec)).Fu))) + len11 += libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pRec)).Fu))) } else { nZero += int64(*(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pRec)).Fu))) } @@ -73130,13 +69837,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { nHdr += int32(1) } else { /* Rare case of a really large header */ - nVarint = _sqlite3VarintLen(tls, uint64(nHdr)) + nVarint = _sqlite3VarintLen(tls, libc.Uint64FromInt32(nHdr)) nHdr += nVarint - if nVarint < _sqlite3VarintLen(tls, uint64(nHdr)) { + if nVarint < _sqlite3VarintLen(tls, libc.Uint64FromInt32(nHdr)) { nHdr++ } } - nByte1 = int64(uint64(nHdr) + nData) + nByte1 = libc.Int64FromUint64(libc.Uint64FromInt32(nHdr) + nData) /* Make sure the output register has a buffer large enough to store ** the new record. The output register (pOp->p3) is not allowed to ** be one of the input registers (because the following call to @@ -73169,11 +69876,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if nHdr < int32(0x80) { v240 = zHdr1 zHdr1++ - *(*Tu8)(unsafe.Pointer(v240)) = uint8(nHdr) + *(*Tu8)(unsafe.Pointer(v240)) = libc.Uint8FromInt32(nHdr) } else { - zHdr1 += uintptr(_sqlite3PutVarint(tls, zHdr1, uint64(nHdr))) + zHdr1 += uintptr(_sqlite3PutVarint(tls, zHdr1, libc.Uint64FromInt32(nHdr))) } - _ = libc.Int32FromInt32(0) pRec = pData0 for int32(1) != 0 { serial_type = (*TMem)(unsafe.Pointer(pRec)).FuTemp @@ -73189,13 +69895,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* NULL value. No change in zPayload */ } else { if serial_type == uint32(7) { - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, bp+72, pRec, uint32(8)) } else { - *(*Tu64)(unsafe.Pointer(bp + 72)) = uint64(*(*Ti64)(unsafe.Pointer(pRec))) + *(*Tu64)(unsafe.Pointer(bp + 72)) = libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(pRec))) } len11 = uint32(_sqlite3SmallTypeSizes[serial_type]) - _ = libc.Int32FromInt32(0) switch len11 { default: *(*Tu8)(unsafe.Pointer(zPayload + 7)) = uint8(*(*Tu64)(unsafe.Pointer(bp + 72)) & libc.Uint64FromInt32(0xff)) @@ -73232,15 +69936,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zHdr1++ *(*Tu8)(unsafe.Pointer(v242)) = uint8(serial_type) if serial_type >= uint32(14) && (*TMem)(unsafe.Pointer(pRec)).Fn > 0 { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, zPayload, (*TMem)(unsafe.Pointer(pRec)).Fz, uint32((*TMem)(unsafe.Pointer(pRec)).Fn)) + libc.Xmemcpy(tls, zPayload, (*TMem)(unsafe.Pointer(pRec)).Fz, libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pRec)).Fn)) zPayload += uintptr((*TMem)(unsafe.Pointer(pRec)).Fn) } } else { zHdr1 += uintptr(_sqlite3PutVarint(tls, zHdr1, uint64(serial_type))) if (*TMem)(unsafe.Pointer(pRec)).Fn != 0 { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, zPayload, (*TMem)(unsafe.Pointer(pRec)).Fz, uint32((*TMem)(unsafe.Pointer(pRec)).Fn)) + libc.Xmemcpy(tls, zPayload, (*TMem)(unsafe.Pointer(pRec)).Fz, libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pRec)).Fn)) zPayload += uintptr((*TMem)(unsafe.Pointer(pRec)).Fn) } } @@ -73250,9 +69952,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pRec += 40 } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto _187 /* Opcode: Count P1 P2 P3 * * ** Synopsis: r[P2]=count() @@ -73266,9 +69965,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _69: ; - _ = libc.Int32FromInt32(0) pCrsr1 = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) + 36)) - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp3 != 0 { *(*Ti64)(unsafe.Pointer(bp + 80)) = _sqlite3BtreeRowCountEst(tls, pCrsr1) } else { @@ -73295,11 +69992,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* Assert that the p1 parameter is valid. Also that if there is no open ** transaction, then there cannot be any savepoints. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if p12 == SAVEPOINT_BEGIN { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0 { /* A new savepoint cannot be created if there are active write @@ -73313,16 +70005,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** savepoint (and therefore should not prompt xSavepoint()) callbacks. ** If this is a transaction savepoint being opened, it is guaranteed ** that the db->aVTrans[] array is empty. */ - _ = libc.Int32FromInt32(0) rc = _sqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN, (*Tsqlite3)(unsafe.Pointer(db)).FnStatement+(*Tsqlite3)(unsafe.Pointer(db)).FnSavepoint) if rc != SQLITE_OK { goto abort_due_to_error } /* Create a new savepoint structure. */ - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(24)+uint32(nName)+uint32(1))) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(24)+libc.Uint32FromInt32(nName)+uint32(1))) if pNew != 0 { (*TSavepoint)(unsafe.Pointer(pNew)).FzName = pNew + 1*24 - libc.Xmemcpy(tls, (*TSavepoint)(unsafe.Pointer(pNew)).FzName, zName, uint32(nName+int32(1))) + libc.Xmemcpy(tls, (*TSavepoint)(unsafe.Pointer(pNew)).FzName, zName, libc.Uint32FromInt32(nName+int32(1))) /* If there is no open transaction, then mark this as a special ** "transaction savepoint". */ if (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0 { @@ -73339,7 +70030,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } else { - _ = libc.Int32FromInt32(0) iSavepoint = 0 /* Find the named savepoint. If there is no such savepoint, then an ** an error is returned to the user. */ @@ -73410,7 +70100,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ii++ } } else { - _ = libc.Int32FromInt32(0) isSchemaChange = 0 } ii = 0 @@ -73449,14 +70138,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** constraint violations present in the database to the value stored ** when the savepoint was created. */ if p12 == int32(SAVEPOINT_RELEASE) { - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FpSavepoint = (*TSavepoint)(unsafe.Pointer(pSavepoint)).FpNext _sqlite3DbFree(tls, db, pSavepoint) if !(isTransaction != 0) { (*Tsqlite3)(unsafe.Pointer(db)).FnSavepoint-- } } else { - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = (*TSavepoint)(unsafe.Pointer(pSavepoint)).FnDeferredCons (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = (*TSavepoint)(unsafe.Pointer(pSavepoint)).FnDeferredImmCons } @@ -73472,7 +70159,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { goto abort_due_to_error } - if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_HALT_STATE) { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_HALT_STATE) { rc = int32(SQLITE_DONE) goto vdbe_return } @@ -73490,13 +70177,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; desiredAutoCommit = (*TOp)(unsafe.Pointer(pOp)).Fp1 iRollback = (*TOp)(unsafe.Pointer(pOp)).Fp2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* At least this one VM is active */ - _ = libc.Int32FromInt32(0) - if desiredAutoCommit != int32((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) { + /* At least this one VM is active */ + if desiredAutoCommit != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) { if iRollback != 0 { - _ = libc.Int32FromInt32(0) _sqlite3RollbackAll(tls, db, libc.Int32FromInt32(SQLITE_ABORT)|libc.Int32FromInt32(2)<<libc.Int32FromInt32(8)) (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = uint8(1) } else { @@ -73513,13 +70196,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if v248 != SQLITE_OK { goto vdbe_return } else { - (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = uint8(desiredAutoCommit) + (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = libc.Uint8FromInt32(desiredAutoCommit) } } } if _sqlite3VdbeHalt(tls, p) == int32(SQLITE_BUSY) { (*TVdbe)(unsafe.Pointer(p)).Fpc = (int32(pOp) - int32(aOp)) / 20 - (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = uint8(libc.Int32FromInt32(1) - desiredAutoCommit) + (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = libc.Uint8FromInt32(libc.Int32FromInt32(1) - desiredAutoCommit) v249 = libc.Int32FromInt32(SQLITE_BUSY) rc = v249 (*TVdbe)(unsafe.Pointer(p)).Frc = v249 @@ -73547,7 +70230,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = int32(SQLITE_ERROR) goto abort_due_to_error } - _ = libc.Int32FromInt32(0) /* Opcode: Transaction P1 P2 P3 P4 P5 ** ** Begin a transaction on database P1 if a transaction is not already @@ -73586,13 +70268,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _72: ; *(*int32)(unsafe.Pointer(bp + 88)) = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TOp)(unsafe.Pointer(pOp)).Fp2 != 0 && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(SQLITE_QueryOnly)|uint64(libc.Int32FromInt32(0x00002))<<libc.Int32FromInt32(32)) != uint64(0) { + if (*TOp)(unsafe.Pointer(pOp)).Fp2 != 0 && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(SQLITE_QueryOnly)|libc.Uint64FromInt32(libc.Int32FromInt32(0x00002))<<libc.Int32FromInt32(32)) != uint64(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_QueryOnly) != 0 { /* Writes prohibited by the "PRAGMA query_only=TRUE" statement */ rc = int32(SQLITE_READONLY) @@ -73615,10 +70291,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } goto abort_due_to_error } - if int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0x20>>5)) != 0 && (*TOp)(unsafe.Pointer(pOp)).Fp2 != 0 && (int32((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1)) { - _ = libc.Int32FromInt32(0) + if int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0x20>>5)) != 0 && (*TOp)(unsafe.Pointer(pOp)).Fp2 != 0 && (libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1)) { if (*TVdbe)(unsafe.Pointer(p)).FiStatement == 0 { - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FnStatement++ (*TVdbe)(unsafe.Pointer(p)).FiStatement = (*Tsqlite3)(unsafe.Pointer(db)).FnSavepoint + (*Tsqlite3)(unsafe.Pointer(db)).FnStatement } @@ -73633,7 +70307,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbe)(unsafe.Pointer(p)).FnStmtDefImmCons = (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons } } - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && (*(*int32)(unsafe.Pointer(bp + 88)) != (*TOp)(unsafe.Pointer(pOp)).Fp3 || (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FiGeneration != *(*int32)(unsafe.Pointer(pOp + 16))) { /* ** IMPLEMENTATION-OF: R-03189-51135 As each SQL statement runs, the schema @@ -73683,13 +70356,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _73: ; - _ = libc.Int32FromInt32(0) iDb = (*TOp)(unsafe.Pointer(pOp)).Fp1 iCookie = (*TOp)(unsafe.Pointer(pOp)).Fp3 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3BtreeGetMeta(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpBt, iCookie, bp+92) pOut = _out2Prerelease(tls, p, pOp) *(*Ti64)(unsafe.Pointer(pOut)) = int64(*(*int32)(unsafe.Pointer(bp + 92))) @@ -73711,15 +70379,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _74: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pDb1 = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*16 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* See note about index shifting on OP_ReadCookie */ - rc = _sqlite3BtreeUpdateMeta(tls, (*TDb)(unsafe.Pointer(pDb1)).FpBt, (*TOp)(unsafe.Pointer(pOp)).Fp2, uint32((*TOp)(unsafe.Pointer(pOp)).Fp3)) + rc = _sqlite3BtreeUpdateMeta(tls, (*TDb)(unsafe.Pointer(pDb1)).FpBt, (*TOp)(unsafe.Pointer(pOp)).Fp2, libc.Uint32FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp3)) if (*TOp)(unsafe.Pointer(pOp)).Fp2 == int32(BTREE_SCHEMA_VERSION) { /* When the schema cookie changes, record the new cookie internally */ *(*Tu32)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb1)).FpSchema)) = *(*Tu32)(unsafe.Pointer(pOp + 12)) - uint32((*TOp)(unsafe.Pointer(pOp)).Fp5) @@ -73728,7 +70390,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } else { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == int32(BTREE_FILE_FORMAT) { /* Record changes in the file format */ - (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format = uint8((*TOp)(unsafe.Pointer(pOp)).Fp3) + (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format = libc.Uint8FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp3) } } if (*TOp)(unsafe.Pointer(pOp)).Fp1 == int32(1) { @@ -73827,12 +70489,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _77: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCur = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - if pCur != 0 && (*TVdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot == uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) { - _ = libc.Int32FromInt32(0) /* Guaranteed by the code generator */ - _ = libc.Int32FromInt32(0) + if pCur != 0 && (*TVdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot == libc.Uint32FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp2) { + /* Guaranteed by the code generator */ _sqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pCur + 36))) goto open_cursor_set_hints } @@ -73842,59 +70501,41 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* ncycle */ _75: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(Tbft(*(*uint16)(unsafe.Pointer(p + 144))&0x3>>0)) == int32(1) { rc = libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) goto abort_due_to_error } nField1 = 0 pKeyInfo1 = uintptr(0) - p23 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + p23 = libc.Uint32FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp2) iDb1 = (*TOp)(unsafe.Pointer(pOp)).Fp3 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pDb2 = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb1)*16 pX = (*TDb)(unsafe.Pointer(pDb2)).FpBt - _ = libc.Int32FromInt32(0) - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_OpenWrite) { - _ = libc.Int32FromInt32(0) - wrFlag = int32(BTREE_WRCSR) | int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_FORDELETE) - _ = libc.Int32FromInt32(0) - if int32((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb2)).FpSchema)).Ffile_format) < int32((*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat) { + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_OpenWrite) { + wrFlag = int32(BTREE_WRCSR) | libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_FORDELETE) + if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb2)).FpSchema)).Ffile_format) < libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat) { (*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat = (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb2)).FpSchema)).Ffile_format } } else { wrFlag = 0 } - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_P2ISREG) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_P2ISREG) != 0 { pIn2 = aMem + uintptr(p23)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemIntegerify(tls, pIn2) - p23 = uint32(int32(*(*Ti64)(unsafe.Pointer(pIn2)))) + p23 = libc.Uint32FromInt32(int32(*(*Ti64)(unsafe.Pointer(pIn2)))) /* The p2 value always comes from a prior OP_CreateBtree opcode and ** that opcode will always set the p2 value to 2 or more or else fail. ** If there were a failure, the prepared statement would have halted ** before reaching this instruction. */ - _ = libc.Int32FromInt32(0) } if int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == -int32(8) { pKeyInfo1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - nField1 = int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnAllField) + nField1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnAllField) } else { if int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == -int32(3) { nField1 = *(*int32)(unsafe.Pointer(pOp + 16)) } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Table with INTEGER PRIMARY KEY and nothing else */ pCur = _allocateCursor(tls, p, (*TOp)(unsafe.Pointer(pOp)).Fp1, nField1, uint8(CURTYPE_BTREE)) if pCur == uintptr(0) { @@ -73914,9 +70555,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto open_cursor_set_hints open_cursor_set_hints: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _sqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 36)), uint32(int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_BULKCSR)|libc.Int32FromInt32(OPFLAG_SEEKEQ)))) + _sqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 36)), libc.Uint32FromInt32(libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_BULKCSR)|libc.Int32FromInt32(OPFLAG_SEEKEQ)))) if rc != 0 { goto abort_due_to_error } @@ -73932,8 +70571,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _78: ; /* The new cursor */ pOrig = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Only ephemeral cursors can be duplicated */ + /* Only ephemeral cursors can be duplicated */ pCx = _allocateCursor(tls, p, (*TOp)(unsafe.Pointer(pOp)).Fp1, int32((*TVdbeCursor)(unsafe.Pointer(pOrig)).FnField), uint8(CURTYPE_BTREE)) if pCx == uintptr(0) { goto no_mem @@ -73943,7 +70581,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pCx)).FpKeyInfo = (*TVdbeCursor)(unsafe.Pointer(pOrig)).FpKeyInfo (*TVdbeCursor)(unsafe.Pointer(pCx)).FisTable = (*TVdbeCursor)(unsafe.Pointer(pOrig)).FisTable (*TVdbeCursor)(unsafe.Pointer(pCx)).FpgnoRoot = (*TVdbeCursor)(unsafe.Pointer(pOrig)).FpgnoRoot - libc.SetBitFieldPtr8Uint32(pCx+8, uint32(int32(TBool(*(*uint8)(unsafe.Pointer(pOrig + 8))&0x4>>2))), 2, 0x4) + libc.SetBitFieldPtr8Uint32(pCx+8, libc.Uint32FromInt32(int32(TBool(*(*uint8)(unsafe.Pointer(pOrig + 8))&0x4>>2))), 2, 0x4) *(*uintptr)(unsafe.Pointer(pCx + 12)) = *(*uintptr)(unsafe.Pointer(pOrig + 12)) libc.SetBitFieldPtr8Uint32(pCx+8, libc.Uint32FromInt32(1), 3, 0x8) libc.SetBitFieldPtr8Uint32(pOrig+8, libc.Uint32FromInt32(1), 3, 0x8) @@ -73951,7 +70589,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The sqlite3BtreeCursor() routine can only fail for the first cursor ** opened for a database. Since there is already an open cursor when this ** opcode is run, the sqlite3BtreeCursor() cannot fail */ - _ = libc.Int32FromInt32(0) goto _187 /* Opcode: OpenEphemeral P1 P2 P3 P4 P5 ** Synopsis: nColumn=P2 @@ -73990,14 +70627,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* ncycle */ _79: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* Make register reg[P3] into a value that can be used as the data ** form sqlite3BtreeInsert() where the length of the data is zero. */ - _ = libc.Int32FromInt32(0) /* Only used when number of columns is zero */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fn = 0 (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fz = __ccgo_ts + 1662 } @@ -74006,17 +70639,16 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the ephemeral table is already open and has no duplicates from ** OP_OpenDup, then erase all existing content so that the table is ** empty again, rather than creating a new table. */ - _ = libc.Int32FromInt32(0) (*TVdbeCursor)(unsafe.Pointer(pCx1)).FseqCount = 0 (*TVdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = uint32(CACHE_STALE) - rc = _sqlite3BtreeClearTable(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 12)), int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), uintptr(0)) + rc = _sqlite3BtreeClearTable(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 12)), libc.Int32FromUint32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), uintptr(0)) } else { pCx1 = _allocateCursor(tls, p, (*TOp)(unsafe.Pointer(pOp)).Fp1, (*TOp)(unsafe.Pointer(pOp)).Fp2, uint8(CURTYPE_BTREE)) if pCx1 == uintptr(0) { goto no_mem } libc.SetBitFieldPtr8Uint32(pCx1+8, libc.Uint32FromInt32(1), 0, 0x1) - rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, pCx1+12, libc.Int32FromInt32(BTREE_OMIT_JOURNAL)|libc.Int32FromInt32(BTREE_SINGLE)|int32((*TOp)(unsafe.Pointer(pOp)).Fp5), _vfsFlags) + rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, pCx1+12, libc.Int32FromInt32(BTREE_OMIT_JOURNAL)|libc.Int32FromInt32(BTREE_SINGLE)|libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5), _vfsFlags) if rc == SQLITE_OK { rc = _sqlite3BtreeBeginTrans(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 12)), int32(1), uintptr(0)) if rc == SQLITE_OK { @@ -74030,12 +70662,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { v252 = v253 (*TVdbeCursor)(unsafe.Pointer(pCx1)).FpKeyInfo = v252 if v252 != uintptr(0) { - _ = libc.Int32FromInt32(0) - rc = _sqlite3BtreeCreateTable(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 12)), pCx1+48, int32(BTREE_BLOBKEY)|int32((*TOp)(unsafe.Pointer(pOp)).Fp5)) + rc = _sqlite3BtreeCreateTable(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 12)), pCx1+48, int32(BTREE_BLOBKEY)|libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)) if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeCursor(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 12)), (*TVdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot, int32(BTREE_WRCSR), pKeyInfo2, *(*uintptr)(unsafe.Pointer(pCx1 + 36))) } (*TVdbeCursor)(unsafe.Pointer(pCx1)).FisTable = uint8(0) @@ -74045,7 +70673,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pCx1)).FisTable = uint8(1) } } - libc.SetBitFieldPtr8Uint32(pCx1+8, libc.BoolUint32(int32((*TOp)(unsafe.Pointer(pOp)).Fp5) != libc.Int32FromInt32(BTREE_UNORDERED)), 2, 0x4) + libc.SetBitFieldPtr8Uint32(pCx1+8, libc.BoolUint32(libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) != libc.Int32FromInt32(BTREE_UNORDERED)), 2, 0x4) if rc != 0 { _sqlite3BtreeClose(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 12))) } @@ -74068,15 +70696,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _81: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCx2 = _allocateCursor(tls, p, (*TOp)(unsafe.Pointer(pOp)).Fp1, (*TOp)(unsafe.Pointer(pOp)).Fp2, uint8(CURTYPE_SORTER)) if pCx2 == uintptr(0) { goto no_mem } (*TVdbeCursor)(unsafe.Pointer(pCx2)).FpKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3VdbeSorterInit(tls, db, (*TOp)(unsafe.Pointer(pOp)).Fp3, pCx2) if rc != 0 { goto abort_due_to_error @@ -74091,9 +70715,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _82: ; - _ = libc.Int32FromInt32(0) pC4 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) v255 = pC4 + 16 v254 = *(*Ti64)(unsafe.Pointer(v255)) *(*Ti64)(unsafe.Pointer(v255))++ @@ -74120,8 +70742,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _83: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCx3 = _allocateCursor(tls, p, (*TOp)(unsafe.Pointer(pOp)).Fp1, (*TOp)(unsafe.Pointer(pOp)).Fp3, uint8(CURTYPE_PSEUDO)) if pCx3 == uintptr(0) { goto no_mem @@ -74134,7 +70754,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** for pCx->eCurType==CURTYPE_BTREE inside of sqlite3VdbeCursorMoveto() ** which is a performance optimization */ *(*uintptr)(unsafe.Pointer(pCx3 + 36)) = _sqlite3BtreeFakeValidCursor(tls) - _ = libc.Int32FromInt32(0) goto _187 /* Opcode: Close P1 * * * * ** @@ -74143,7 +70762,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _84: ; /* ncycle */ - _ = libc.Int32FromInt32(0) _sqlite3VdbeFreeCursor(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) = uintptr(0) goto _187 @@ -74245,30 +70863,20 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump0, in3, group, ncycle */ _85: ; /* Only interested in == results */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC5 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - oc = int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) + oc = libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) eqOnly = 0 (*TVdbeCursor)(unsafe.Pointer(pC5)).FnullRow = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC5)).FdeferredMoveto = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC5)).FcacheStatus = uint32(CACHE_STALE) if (*TVdbeCursor)(unsafe.Pointer(pC5)).FisTable != 0 { /* The OPFLAG_SEEKEQ/BTREE_SEEK_EQ flag is only set on index cursors */ - _ = libc.Int32FromInt32(0) /* The input value in P3 might be of any type: integer, real, string, ** blob, or NULL. But it needs to be an integer before we can do ** the seek, so convert it. */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 flags31 = (*TMem)(unsafe.Pointer(pIn3)).Fflags - if int32(flags31)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { + if libc.Int32FromUint16(flags31)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { _applyNumericAffinity(tls, pIn3, 0) } iKey = _sqlite3VdbeIntValue(tls, pIn3) /* Get the integer key value */ @@ -74276,9 +70884,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TMem)(unsafe.Pointer(pIn3)).Fflags = flags31 /* But convert the type back to its original */ /* If the P3 value could not be converted into an integer without ** loss of information, then special processing is required... */ - if int32(newType)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) == 0 { - if int32(newType)&int32(MEM_Real) == 0 { - if int32(newType)&int32(MEM_Null) != 0 || oc >= int32(OP_SeekGE) { + if libc.Int32FromUint16(newType)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) == 0 { + if libc.Int32FromUint16(newType)&int32(MEM_Real) == 0 { + if libc.Int32FromUint16(newType)&int32(MEM_Null) != 0 || oc >= int32(OP_SeekGE) { goto jump_to_p2 } else { rc = _sqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC5 + 36)), bp+96) @@ -74297,24 +70905,18 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** (x <= 4.9) -> (x < 5) */ if c2 > 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if oc&int32(0x0001) == libc.Int32FromInt32(OP_SeekGT)&libc.Int32FromInt32(0x0001) { oc-- } } else { if c2 < 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if oc&int32(0x0001) == libc.Int32FromInt32(OP_SeekLT)&libc.Int32FromInt32(0x0001) { oc++ } } } } - rc = _sqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC5 + 36)), int64(uint64(iKey)), 0, bp+96) + rc = _sqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC5 + 36)), libc.Int64FromUint64(libc.Uint64FromInt64(iKey)), 0, bp+96) (*TVdbeCursor)(unsafe.Pointer(pC5)).FmovetoTarget = iKey /* Used by OP_Delete */ if rc != SQLITE_OK { goto abort_due_to_error @@ -74327,20 +70929,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ if _sqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC5 + 36)), uint32(BTREE_SEEK_EQ)) != 0 { eqOnly = int32(1) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } nField2 = *(*int32)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*(*TUnpackedRecord)(unsafe.Pointer(bp + 100))).FpKeyInfo = (*TVdbeCursor)(unsafe.Pointer(pC5)).FpKeyInfo - (*(*TUnpackedRecord)(unsafe.Pointer(bp + 100))).FnField = uint16(nField2) + (*(*TUnpackedRecord)(unsafe.Pointer(bp + 100))).FnField = libc.Uint16FromInt32(nField2) /* The next line of code computes as follows, only faster: ** if( oc==OP_SeekGT || oc==OP_SeekLE ){ ** r.default_rc = -1; @@ -74354,23 +70946,17 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { v256 = +libc.Int32FromInt32(1) } (*(*TUnpackedRecord)(unsafe.Pointer(bp + 100))).Fdefault_rc = int8(v256) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*(*TUnpackedRecord)(unsafe.Pointer(bp + 100))).FaMem = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 (*(*TUnpackedRecord)(unsafe.Pointer(bp + 100))).FeqSeen = uint8(0) rc = _sqlite3BtreeIndexMoveto(tls, *(*uintptr)(unsafe.Pointer(pC5 + 36)), bp+100, bp+96) if rc != SQLITE_OK { goto abort_due_to_error } - if eqOnly != 0 && int32((*(*TUnpackedRecord)(unsafe.Pointer(bp + 100))).FeqSeen) == 0 { - _ = libc.Int32FromInt32(0) + if eqOnly != 0 && libc.Int32FromUint8((*(*TUnpackedRecord)(unsafe.Pointer(bp + 100))).FeqSeen) == 0 { goto seek_not_found } } if oc >= int32(OP_SeekGE) { - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp + 96)) < 0 || *(*int32)(unsafe.Pointer(bp + 96)) == 0 && oc == int32(OP_SeekGT) { *(*int32)(unsafe.Pointer(bp + 96)) = 0 rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC5 + 36)), 0) @@ -74386,7 +70972,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 96)) = 0 } } else { - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp + 96)) > 0 || *(*int32)(unsafe.Pointer(bp + 96)) == 0 && oc == int32(OP_SeekLT) { *(*int32)(unsafe.Pointer(bp + 96)) = 0 rc = _sqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC5 + 36)), 0) @@ -74408,12 +70993,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto seek_not_found seek_not_found: ; - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp + 96)) != 0 { goto jump_to_p2 } else { if eqOnly != 0 { - _ = libc.Int32FromInt32(0) pOp += 20 /* Skip the OP_IdxLt or OP_IdxGT that follows */ } } @@ -74488,23 +71071,16 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _89: ; - _ = libc.Int32FromInt32(0) /* If pOp->p5 is clear, then pOp->p2 points to the first instruction past the ** OP_IdxGT that follows the OP_SeekGE. Otherwise, it points to the first ** opcode past the OP_SeekGE itself. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC6 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*(*TOp)(unsafe.Pointer(pOp + 1*20))).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if !(_sqlite3BtreeCursorIsValidNN(tls, *(*uintptr)(unsafe.Pointer(pC6 + 36))) != 0) { goto _187 } nStep = (*TOp)(unsafe.Pointer(pOp)).Fp1 - _ = libc.Int32FromInt32(0) (*(*TUnpackedRecord)(unsafe.Pointer(bp + 132))).FpKeyInfo = (*TVdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo - (*(*TUnpackedRecord)(unsafe.Pointer(bp + 132))).FnField = uint16(*(*int32)(unsafe.Pointer(pOp + 1*20 + 16))) + (*(*TUnpackedRecord)(unsafe.Pointer(bp + 132))).FnField = libc.Uint16FromInt32(*(*int32)(unsafe.Pointer(pOp + 1*20 + 16))) (*(*TUnpackedRecord)(unsafe.Pointer(bp + 132))).Fdefault_rc = 0 (*(*TUnpackedRecord)(unsafe.Pointer(bp + 132))).FaMem = aMem + uintptr((*(*TOp)(unsafe.Pointer(pOp + 1*20))).Fp3)*40 *(*int32)(unsafe.Pointer(bp + 128)) = 0 /* Not needed. Only used to silence a warning. */ @@ -74517,7 +71093,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { goto abort_due_to_error } - if !(*(*int32)(unsafe.Pointer(bp + 128)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { + if !(*(*int32)(unsafe.Pointer(bp + 128)) > 0 && libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } goto seekscan_search_fail @@ -74567,15 +71143,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _90: ; - _ = libc.Int32FromInt32(0) pC7 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TVdbeCursor)(unsafe.Pointer(pC7)).FseekHit) < (*TOp)(unsafe.Pointer(pOp)).Fp2 { - (*TVdbeCursor)(unsafe.Pointer(pC7)).FseekHit = uint16((*TOp)(unsafe.Pointer(pOp)).Fp2) + if libc.Int32FromUint16((*TVdbeCursor)(unsafe.Pointer(pC7)).FseekHit) < (*TOp)(unsafe.Pointer(pOp)).Fp2 { + (*TVdbeCursor)(unsafe.Pointer(pC7)).FseekHit = libc.Uint16FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if int32((*TVdbeCursor)(unsafe.Pointer(pC7)).FseekHit) > (*TOp)(unsafe.Pointer(pOp)).Fp3 { - (*TVdbeCursor)(unsafe.Pointer(pC7)).FseekHit = uint16((*TOp)(unsafe.Pointer(pOp)).Fp3) + if libc.Int32FromUint16((*TVdbeCursor)(unsafe.Pointer(pC7)).FseekHit) > (*TOp)(unsafe.Pointer(pOp)).Fp3 { + (*TVdbeCursor)(unsafe.Pointer(pC7)).FseekHit = libc.Uint16FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp3) } } goto _187 @@ -74587,7 +71160,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _91: ; - _ = libc.Int32FromInt32(0) pCur1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) if pCur1 == uintptr(0) || (*TVdbeCursor)(unsafe.Pointer(pCur1)).FnullRow != 0 { goto jump_to_p2_and_check_for_interrupt @@ -74685,10 +71257,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _92: ; - _ = libc.Int32FromInt32(0) pC8 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - if int32((*TVdbeCursor)(unsafe.Pointer(pC8)).FseekHit) >= *(*int32)(unsafe.Pointer(pOp + 16)) { + if libc.Int32FromUint16((*TVdbeCursor)(unsafe.Pointer(pC8)).FseekHit) >= *(*int32)(unsafe.Pointer(pOp + 16)) { goto _187 } _95: @@ -74697,31 +71267,22 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, in3, ncycle */ _93: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC9 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) (*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FaMem = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - (*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FnField = uint16(*(*int32)(unsafe.Pointer(pOp + 16))) - if int32((*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FnField) > 0 { + (*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FnField = libc.Uint16FromInt32(*(*int32)(unsafe.Pointer(pOp + 16))) + if libc.Int32FromUint16((*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FnField) > 0 { /* Key values in an array of registers */ (*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FpKeyInfo = (*TVdbeCursor)(unsafe.Pointer(pC9)).FpKeyInfo (*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).Fdefault_rc = 0 rc = _sqlite3BtreeIndexMoveto(tls, *(*uintptr)(unsafe.Pointer(pC9 + 36)), bp+160, pC9+28) } else { /* Composite key generated by OP_MakeRecord */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer((*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FaMem)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer((*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FaMem)).Fflags)&int32(MEM_Zero) != 0 { v260 = _sqlite3VdbeMemExpandBlob(tls, (*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FaMem) } else { v260 = 0 } rc = v260 - _ = libc.Int32FromInt32(0) if rc != 0 { goto no_mem } @@ -74738,10 +71299,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto abort_due_to_error } alreadyExists = libc.BoolInt32((*TVdbeCursor)(unsafe.Pointer(pC9)).FseekResult == 0) - (*TVdbeCursor)(unsafe.Pointer(pC9)).FnullRow = uint8(int32(1) - alreadyExists) + (*TVdbeCursor)(unsafe.Pointer(pC9)).FnullRow = libc.Uint8FromInt32(int32(1) - alreadyExists) (*TVdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = uint32(CACHE_STALE) - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Found) { + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Found) { if alreadyExists != 0 { goto jump_to_p2 } @@ -74749,16 +71310,16 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(alreadyExists != 0) { goto jump_to_p2 } - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_NoConflict) { + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_NoConflict) { /* For the OP_NoConflict opcode, take the jump if any of the ** input fields are NULL, since any key with a NULL will not ** conflict */ ii1 = 0 for { - if !(ii1 < int32((*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FnField)) { + if !(ii1 < libc.Int32FromUint16((*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FnField)) { break } - if int32((*(*TMem)(unsafe.Pointer((*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FaMem + uintptr(ii1)*40))).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer((*(*TUnpackedRecord)(unsafe.Pointer(bp + 160))).FaMem + uintptr(ii1)*40))).Fflags)&int32(MEM_Null) != 0 { goto jump_to_p2 } goto _261 @@ -74767,8 +71328,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ii1++ } } - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_IfNoHope) { - (*TVdbeCursor)(unsafe.Pointer(pC9)).FseekHit = uint16(*(*int32)(unsafe.Pointer(pOp + 16))) + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_IfNoHope) { + (*TVdbeCursor)(unsafe.Pointer(pC9)).FseekHit = libc.Uint16FromInt32(*(*int32)(unsafe.Pointer(pOp + 16))) } } goto _187 @@ -74822,7 +71383,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _97: ; pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - if int32((*TMem)(unsafe.Pointer(pIn3)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn3)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) == 0 { /* If pIn3->u.i does not contain an integer, compute iKey as the ** integer value of pIn3. Jump to P2 if pIn3 cannot be converted ** into an integer without loss of information. Take care to avoid @@ -74836,39 +71397,31 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** parts of the prepared statement. */ *(*Tsqlite3_value1)(unsafe.Pointer(bp + 192)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+192, int8(SQLITE_AFF_NUMERIC), encoding) - if int32((*(*TMem)(unsafe.Pointer(bp + 192))).Fflags)&int32(MEM_Int) == 0 { + if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 192))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 } - iKey1 = uint64(*(*Ti64)(unsafe.Pointer(bp + 192))) + iKey1 = libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp + 192))) goto notExistsWithKey } _96: ; /* jump, in3, ncycle */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + iKey1 = libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(pIn3))) goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCrsr2 = *(*uintptr)(unsafe.Pointer(pC10 + 36)) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp + 188)) = 0 - rc = _sqlite3BtreeTableMoveto(tls, pCrsr2, int64(iKey1), 0, bp+188) - _ = libc.Int32FromInt32(0) - (*TVdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget = int64(iKey1) /* Used by OP_Delete */ + rc = _sqlite3BtreeTableMoveto(tls, pCrsr2, libc.Int64FromUint64(iKey1), 0, bp+188) + (*TVdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget = libc.Int64FromUint64(iKey1) /* Used by OP_Delete */ (*TVdbeCursor)(unsafe.Pointer(pC10)).FnullRow = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = uint32(CACHE_STALE) (*TVdbeCursor)(unsafe.Pointer(pC10)).FdeferredMoveto = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 188)) if *(*int32)(unsafe.Pointer(bp + 188)) != 0 { - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(98565)) + rc = _sqlite3CorruptError(tls, int32(98567)) } else { goto jump_to_p2 } @@ -74887,9 +71440,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _98: ; /* out2 */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOut = _out2Prerelease(tls, p, pOp) v263 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) + 16 v262 = *(*Ti64)(unsafe.Pointer(v263)) @@ -74916,12 +71466,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(bp + 232)) = 0 *(*int32)(unsafe.Pointer(bp + 240)) = 0 pOut = _out2Prerelease(tls, p, pOp) - _ = libc.Int32FromInt32(0) pC11 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The next rowid or record number (different terms for the same ** thing) is obtained in a two-step algorithm. ** @@ -74935,7 +71480,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** succeeded. If the random rowid does exist, we select a new one ** and try again, up to 100 times. */ - _ = libc.Int32FromInt32(0) /* Some compilers complain about constants of the form 0x7fffffffffffffff. ** Others complain about 0x7ffffffffffffffffLL. The following macro seems ** to provide the constant while making all compilers happy. @@ -74948,9 +71492,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp + 240)) != 0 { *(*Ti64)(unsafe.Pointer(bp + 232)) = int64(1) /* IMP: R-61914-48074 */ } else { - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer(bp + 232)) = _sqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC11 + 36))) - if *(*Ti64)(unsafe.Pointer(bp + 232)) >= int64(libc.Uint64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)|libc.Uint64FromUint32(0xffffffff)) { + if *(*Ti64)(unsafe.Pointer(bp + 232)) >= libc.Int64FromUint64(libc.Uint64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)|libc.Uint64FromUint32(0xffffffff)) { libc.SetBitFieldPtr8Uint32(pC11+8, libc.Uint32FromInt32(1), 1, 0x2) } else { *(*Ti64)(unsafe.Pointer(bp + 232))++ /* IMP: R-29538-34987 */ @@ -74959,7 +71502,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TOp)(unsafe.Pointer(pOp)).Fp3 != 0 { /* Assert that P3 is a valid memory cell. */ - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).FpFrame != 0 { pFrame1 = (*TVdbe)(unsafe.Pointer(p)).FpFrame for { @@ -74972,17 +71514,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pFrame1 = (*TVdbeFrame)(unsafe.Pointer(pFrame1)).FpParent } /* Assert that P3 is a valid memory cell. */ - _ = libc.Int32FromInt32(0) pMem = (*TVdbeFrame)(unsafe.Pointer(pFrame1)).FaMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 } else { /* Assert that P3 is a valid memory cell. */ - _ = libc.Int32FromInt32(0) pMem = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 } - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemIntegerify(tls, pMem) - _ = libc.Int32FromInt32(0) /* mem(P3) holds an integer */ - if *(*Ti64)(unsafe.Pointer(pMem)) == int64(libc.Uint64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)|libc.Uint64FromUint32(0xffffffff)) || int32(TBool(*(*uint8)(unsafe.Pointer(pC11 + 8))&0x2>>1)) != 0 { + /* mem(P3) holds an integer */ + if *(*Ti64)(unsafe.Pointer(pMem)) == libc.Int64FromUint64(libc.Uint64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)|libc.Uint64FromUint32(0xffffffff)) || int32(TBool(*(*uint8)(unsafe.Pointer(pC11 + 8))&0x2>>1)) != 0 { rc = int32(SQLITE_FULL) /* IMP: R-17817-00630 */ goto abort_due_to_error } @@ -74996,17 +71535,17 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** largest possible integer (9223372036854775807) then the database ** engine starts picking positive candidate ROWIDs at random until ** it finds one that is not previously used. */ - _ = libc.Int32FromInt32(0) /* We cannot be in random rowid mode if this is + /* We cannot be in random rowid mode if this is ** an AUTOINCREMENT table. */ cnt1 = 0 for { Xsqlite3_randomness(tls, int32(8), bp+232) - *(*Ti64)(unsafe.Pointer(bp + 232)) &= int64(libc.Uint64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)|libc.Uint64FromUint32(0xffffffff)) >> libc.Int32FromInt32(1) + *(*Ti64)(unsafe.Pointer(bp + 232)) &= libc.Int64FromUint64(libc.Uint64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)|libc.Uint64FromUint32(0xffffffff)) >> libc.Int32FromInt32(1) *(*Ti64)(unsafe.Pointer(bp + 232))++ /* Ensure that v is greater than zero */ goto _268 _268: ; - v265 = _sqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC11 + 36)), int64(uint64(*(*Ti64)(unsafe.Pointer(bp + 232)))), 0, bp+240) + v265 = _sqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC11 + 36)), libc.Int64FromUint64(libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp + 232)))), 0, bp+240) rc = v265 if v267 = v265 == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 240)) == 0; v267 { cnt1++ @@ -75023,7 +71562,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = int32(SQLITE_FULL) /* IMP: R-38219-53002 */ goto abort_due_to_error } - _ = libc.Int32FromInt32(0) /* EV: R-40812-03570 */ + /* EV: R-40812-03570 */ } (*TVdbeCursor)(unsafe.Pointer(pC11)).FdeferredMoveto = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC11)).FcacheStatus = uint32(CACHE_STALE) @@ -75069,31 +71608,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _100: ; /* Payload to be inserted */ pData = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC12 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pKey = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*(*TBtreePayload)(unsafe.Pointer(bp + 244))).FnKey = *(*Ti64)(unsafe.Pointer(pKey)) if int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == -int32(5) && ((*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) { - _ = libc.Int32FromInt32(0) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TVdbeCursor)(unsafe.Pointer(pC12)).FiDb)*16))).FzDbSName pTab1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) } else { pTab1 = uintptr(0) zDb = uintptr(0) } /* Invoke the pre-update hook, if any */ if pTab1 != 0 { - if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 && !(int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&libc.Int32FromInt32(OPFLAG_ISUPDATE) != 0) { + if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 && !(libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&libc.Int32FromInt32(OPFLAG_ISUPDATE) != 0) { _sqlite3VdbePreUpdateHook(tls, p, pC12, int32(SQLITE_INSERT), zDb, pTab1, (*(*TBtreePayload)(unsafe.Pointer(bp + 244))).FnKey, (*TOp)(unsafe.Pointer(pOp)).Fp2, -int32(1)) } if (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback == uintptr(0) || (*TTable)(unsafe.Pointer(pTab1)).FaCol == uintptr(0) { @@ -75101,33 +71628,30 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pTab1 = uintptr(0) } } - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_ISNOOP) != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_ISNOOP) != 0 { goto _187 } - _ = libc.Int32FromInt32(0) - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NCHANGE) != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NCHANGE) != 0 { (*TVdbe)(unsafe.Pointer(p)).FnChange++ - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_LASTROWID) != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_LASTROWID) != 0 { (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = (*(*TBtreePayload)(unsafe.Pointer(bp + 244))).FnKey } } - _ = libc.Int32FromInt32(0) (*(*TBtreePayload)(unsafe.Pointer(bp + 244))).FpData = (*TMem)(unsafe.Pointer(pData)).Fz (*(*TBtreePayload)(unsafe.Pointer(bp + 244))).FnData = (*TMem)(unsafe.Pointer(pData)).Fn - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_USESEEKRESULT) != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_USESEEKRESULT) != 0 { v269 = (*TVdbeCursor)(unsafe.Pointer(pC12)).FseekResult } else { v269 = 0 } seekResult = v269 - if int32((*TMem)(unsafe.Pointer(pData)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pData)).Fflags)&int32(MEM_Zero) != 0 { (*(*TBtreePayload)(unsafe.Pointer(bp + 244))).FnZero = *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pData)).Fu)) } else { (*(*TBtreePayload)(unsafe.Pointer(bp + 244))).FnZero = 0 } (*(*TBtreePayload)(unsafe.Pointer(bp + 244))).FpKey = uintptr(0) - _ = libc.Int32FromInt32(0) - rc = _sqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC12 + 36)), bp+244, int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_APPEND)|libc.Int32FromInt32(OPFLAG_SAVEPOSITION)|libc.Int32FromInt32(OPFLAG_PREFORMAT)), seekResult) + rc = _sqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC12 + 36)), bp+244, libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_APPEND)|libc.Int32FromInt32(OPFLAG_SAVEPOSITION)|libc.Int32FromInt32(OPFLAG_PREFORMAT)), seekResult) (*TVdbeCursor)(unsafe.Pointer(pC12)).FdeferredMoveto = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC12)).FcacheStatus = uint32(CACHE_STALE) colCacheCtr++ @@ -75136,9 +71660,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto abort_due_to_error } if pTab1 != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_ISUPDATE) != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_ISUPDATE) != 0 { v270 = int32(SQLITE_UPDATE) } else { v270 = int32(SQLITE_INSERT) @@ -75159,10 +71681,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _101: ; /* Rowid value to insert with */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pDest1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) pSrc = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*4)) if (*TOp)(unsafe.Pointer(pOp)).Fp3 != 0 { @@ -75219,23 +71737,16 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _102: ; opflags = (*TOp)(unsafe.Pointer(pOp)).Fp2 - _ = libc.Int32FromInt32(0) pC13 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the update-hook or pre-update-hook will be invoked, set zDb to ** the name of the db to pass as to it. Also set local pTab to a copy ** of p4.pTab. Finally, if p5 is true, indicating that this cursor was ** last moved with OP_Next or OP_Prev, not Seek or NotFound, set ** VdbeCursor.movetoTarget to the current rowid. */ if int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == -int32(5) && ((*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) zDb1 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TVdbeCursor)(unsafe.Pointer(pC13)).FiDb)*16))).FzDbSName pTab2 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_SAVEPOSITION) != 0 && (*TVdbeCursor)(unsafe.Pointer(pC13)).FisTable != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_SAVEPOSITION) != 0 && (*TVdbeCursor)(unsafe.Pointer(pC13)).FisTable != 0 { (*TVdbeCursor)(unsafe.Pointer(pC13)).FmovetoTarget = _sqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC13 + 36))) } } else { @@ -75243,9 +71754,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pTab2 = uintptr(0) } /* Invoke the pre-update-hook if required. */ - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 && pTab2 != 0 { - _ = libc.Int32FromInt32(0) if opflags&int32(OPFLAG_ISUPDATE) != 0 { v272 = int32(SQLITE_UPDATE) } else { @@ -75257,9 +71766,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto _187 } /* Only flags that can be set are SAVEPOISTION and AUXDELETE */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC13 + 36)), uint8((*TOp)(unsafe.Pointer(pOp)).Fp5)) (*TVdbeCursor)(unsafe.Pointer(pC13)).FcacheStatus = uint32(CACHE_STALE) colCacheCtr++ @@ -75272,7 +71778,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbe)(unsafe.Pointer(p)).FnChange++ if (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0 && pTab2 != uintptr(0) && (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Tsqlite_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg, int32(SQLITE_DELETE), zDb1, (*TTable)(unsafe.Pointer(pTab2)).FzName, (*TVdbeCursor)(unsafe.Pointer(pC13)).FmovetoTarget) - _ = libc.Int32FromInt32(0) } } goto _187 @@ -75306,8 +71811,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _104: ; pC14 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 nKeyCol = *(*int32)(unsafe.Pointer(pOp + 16)) *(*int32)(unsafe.Pointer(bp + 276)) = 0 @@ -75335,10 +71838,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 pC15 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) rc = _sqlite3VdbeSorterRowkey(tls, pC15, pOut) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if rc != 0 { goto abort_due_to_error } @@ -75375,13 +71875,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _106: ; pOut = _out2Prerelease(tls, p, pOp) - _ = libc.Int32FromInt32(0) pC16 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCrsr3 = *(*uintptr)(unsafe.Pointer(pC16 + 36)) /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions @@ -75391,10 +71885,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) n3 = _sqlite3BtreePayloadSize(tls, pCrsr3) - if n3 > uint32(*(*int32)(unsafe.Pointer(db + 116))) { + if n3 > libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(db + 116))) { goto too_big } rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCrsr3, n3, pOut) @@ -75402,7 +71894,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto abort_due_to_error } if !((*TOp)(unsafe.Pointer(pOp)).Fp3 != 0) { - if int32((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Ephem) != 0 && _sqlite3VdbeMemMakeWriteable(tls, pOut) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags)&int32(MEM_Ephem) != 0 && _sqlite3VdbeMemMakeWriteable(tls, pOut) != 0 { goto no_mem } } @@ -75420,10 +71912,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _107: ; pOut = _out2Prerelease(tls, p, pOp) - _ = libc.Int32FromInt32(0) pC17 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TVdbeCursor)(unsafe.Pointer(pC17)).FnullRow != 0 { (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) goto _187 @@ -75431,19 +71920,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbeCursor)(unsafe.Pointer(pC17)).FdeferredMoveto != 0 { *(*Ti64)(unsafe.Pointer(bp + 280)) = (*TVdbeCursor)(unsafe.Pointer(pC17)).FmovetoTarget } else { - if int32((*TVdbeCursor)(unsafe.Pointer(pC17)).FeCurType) == int32(CURTYPE_VTAB) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TVdbeCursor)(unsafe.Pointer(pC17)).FeCurType) == int32(CURTYPE_VTAB) { pVtab = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC17 + 36)))).FpVtab pModule = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule - _ = libc.Int32FromInt32(0) rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule)).FxRowid})))(tls, *(*uintptr)(unsafe.Pointer(pC17 + 36)), bp+280) _sqlite3VtabImportErrmsg(tls, p, pVtab) if rc != 0 { goto abort_due_to_error } } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3VdbeCursorRestore(tls, pC17) if rc != 0 { goto abort_due_to_error @@ -75469,7 +71954,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _108: ; - _ = libc.Int32FromInt32(0) pC18 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) if pC18 == uintptr(0) { /* If the cursor is not already open, create a special kind of @@ -75485,8 +71969,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } (*TVdbeCursor)(unsafe.Pointer(pC18)).FnullRow = uint8(1) (*TVdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = uint32(CACHE_STALE) - if int32((*TVdbeCursor)(unsafe.Pointer(pC18)).FeCurType) == CURTYPE_BTREE { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TVdbeCursor)(unsafe.Pointer(pC18)).FeCurType) == CURTYPE_BTREE { _sqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC18 + 36))) } goto _187 @@ -75516,22 +71999,17 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* ncycle */ _109: ; - _ = libc.Int32FromInt32(0) pC19 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCrsr4 = *(*uintptr)(unsafe.Pointer(pC19 + 36)) *(*int32)(unsafe.Pointer(bp + 288)) = 0 - _ = libc.Int32FromInt32(0) - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_SeekEnd) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_SeekEnd) { (*TVdbeCursor)(unsafe.Pointer(pC19)).FseekResult = -int32(1) if _sqlite3BtreeCursorIsValidNN(tls, pCrsr4) != 0 { goto _187 } } rc = _sqlite3BtreeLast(tls, pCrsr4, bp+288) - (*TVdbeCursor)(unsafe.Pointer(pC19)).FnullRow = uint8(*(*int32)(unsafe.Pointer(bp + 288))) + (*TVdbeCursor)(unsafe.Pointer(pC19)).FnullRow = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp + 288))) (*TVdbeCursor)(unsafe.Pointer(pC19)).FdeferredMoveto = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = uint32(CACHE_STALE) if rc != 0 { @@ -75553,14 +72031,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _111: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC20 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) pCrsr5 = *(*uintptr)(unsafe.Pointer(pC20 + 36)) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeFirst(tls, pCrsr5, bp+292) if rc != 0 { goto abort_due_to_error @@ -75569,8 +72041,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { sz = int64(-int32(1)) /* -Infinity encoding */ } else { sz = _sqlite3BtreeRowCountEst(tls, pCrsr5) - _ = libc.Int32FromInt32(0) - sz = int64(_sqlite3LogEst(tls, uint64(sz))) + sz = int64(_sqlite3LogEst(tls, libc.Uint64FromInt64(sz))) } *(*int32)(unsafe.Pointer(bp + 292)) = libc.BoolInt32(sz >= int64((*TOp)(unsafe.Pointer(pOp)).Fp3) && sz <= int64(*(*int32)(unsafe.Pointer(pOp + 16)))) if *(*int32)(unsafe.Pointer(bp + 292)) != 0 { @@ -75620,19 +72091,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _114: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC21 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp + 296)) = int32(1) - if int32((*TVdbeCursor)(unsafe.Pointer(pC21)).FeCurType) == int32(CURTYPE_SORTER) { + if libc.Int32FromUint8((*TVdbeCursor)(unsafe.Pointer(pC21)).FeCurType) == int32(CURTYPE_SORTER) { rc = _sqlite3VdbeSorterRewind(tls, pC21, bp+296) } else { - _ = libc.Int32FromInt32(0) pCrsr6 = *(*uintptr)(unsafe.Pointer(pC21 + 36)) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeFirst(tls, pCrsr6, bp+296) (*TVdbeCursor)(unsafe.Pointer(pC21)).FdeferredMoveto = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC21)).FcacheStatus = uint32(CACHE_STALE) @@ -75640,7 +72104,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { goto abort_due_to_error } - (*TVdbeCursor)(unsafe.Pointer(pC21)).FnullRow = uint8(*(*int32)(unsafe.Pointer(bp + 296))) + (*TVdbeCursor)(unsafe.Pointer(pC21)).FnullRow = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp + 296))) if (*TOp)(unsafe.Pointer(pOp)).Fp2 > 0 { if *(*int32)(unsafe.Pointer(bp + 296)) != 0 { goto jump_to_p2 @@ -75704,29 +72168,16 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _117: ; pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) rc = _sqlite3VdbeSorterNext(tls, db, pC22) goto next_tail _115: ; /* jump, ncycle */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC22 + 36)), (*TOp)(unsafe.Pointer(pOp)).Fp3) goto next_tail _116: ; /* jump, ncycle */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 36)), (*TOp)(unsafe.Pointer(pOp)).Fp3) goto next_tail next_tail: @@ -75773,18 +72224,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _118: ; - _ = libc.Int32FromInt32(0) pC23 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pIn2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - _ = libc.Int32FromInt32(0) - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NCHANGE) != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NCHANGE) != 0 { (*TVdbe)(unsafe.Pointer(p)).FnChange++ } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pIn2)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn2)).Fflags)&int32(MEM_Zero) != 0 { v273 = _sqlite3VdbeMemExpandBlob(tls, pIn2) } else { v273 = 0 @@ -75796,14 +72241,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*(*TBtreePayload)(unsafe.Pointer(bp + 300))).FnKey = int64((*TMem)(unsafe.Pointer(pIn2)).Fn) (*(*TBtreePayload)(unsafe.Pointer(bp + 300))).FpKey = (*TMem)(unsafe.Pointer(pIn2)).Fz (*(*TBtreePayload)(unsafe.Pointer(bp + 300))).FaMem = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - (*(*TBtreePayload)(unsafe.Pointer(bp + 300))).FnMem = uint16(*(*int32)(unsafe.Pointer(pOp + 16))) - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_USESEEKRESULT) != 0 { + (*(*TBtreePayload)(unsafe.Pointer(bp + 300))).FnMem = libc.Uint16FromInt32(*(*int32)(unsafe.Pointer(pOp + 16))) + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_USESEEKRESULT) != 0 { v274 = (*TVdbeCursor)(unsafe.Pointer(pC23)).FseekResult } else { v274 = 0 } - rc = _sqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC23 + 36)), bp+300, int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_APPEND)|libc.Int32FromInt32(OPFLAG_SAVEPOSITION)|libc.Int32FromInt32(OPFLAG_PREFORMAT)), v274) - _ = libc.Int32FromInt32(0) + rc = _sqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC23 + 36)), bp+300, libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_APPEND)|libc.Int32FromInt32(OPFLAG_SAVEPOSITION)|libc.Int32FromInt32(OPFLAG_PREFORMAT)), v274) (*TVdbeCursor)(unsafe.Pointer(pC23)).FcacheStatus = uint32(CACHE_STALE) if rc != 0 { goto abort_due_to_error @@ -75818,14 +72262,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _119: ; - _ = libc.Int32FromInt32(0) pC24 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pIn2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pIn2)).Fflags)&int32(MEM_Zero) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn2)).Fflags)&int32(MEM_Zero) != 0 { v275 = _sqlite3VdbeMemExpandBlob(tls, pIn2) } else { v275 = 0 @@ -75856,16 +72295,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _120: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pC25 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCrsr7 = *(*uintptr)(unsafe.Pointer(pC25 + 36)) - _ = libc.Int32FromInt32(0) (*(*TUnpackedRecord)(unsafe.Pointer(bp + 336))).FpKeyInfo = (*TVdbeCursor)(unsafe.Pointer(pC25)).FpKeyInfo - (*(*TUnpackedRecord)(unsafe.Pointer(bp + 336))).FnField = uint16((*TOp)(unsafe.Pointer(pOp)).Fp3) + (*(*TUnpackedRecord)(unsafe.Pointer(bp + 336))).FnField = libc.Uint16FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp3) (*(*TUnpackedRecord)(unsafe.Pointer(bp + 336))).Fdefault_rc = 0 (*(*TUnpackedRecord)(unsafe.Pointer(bp + 336))).FaMem = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 rc = _sqlite3BtreeIndexMoveto(tls, pCrsr7, bp+336, bp+332) @@ -75879,11 +72312,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)<<libc.Int32FromInt32(8), int32(99657), __ccgo_ts+6113) + rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)<<libc.Int32FromInt32(8), int32(99659), __ccgo_ts+6113) goto abort_due_to_error } } - _ = libc.Int32FromInt32(0) (*TVdbeCursor)(unsafe.Pointer(pC25)).FcacheStatus = uint32(CACHE_STALE) (*TVdbeCursor)(unsafe.Pointer(pC25)).FseekResult = 0 goto _187 @@ -75919,14 +72351,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* ncycle */ _121: ; /* Rowid that P1 current points to */ - _ = libc.Int32FromInt32(0) pC26 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The IdxRowid and Seek opcodes are combined because of the commonality ** of sqlite3VdbeCursorRestore() and sqlite3VdbeIdxRowid(). */ rc = _sqlite3VdbeCursorRestore(tls, pC26) @@ -75942,28 +72367,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != SQLITE_OK { goto abort_due_to_error } - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_DeferredSeek) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_DeferredSeek) { pTabCur = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TVdbeCursor)(unsafe.Pointer(pTabCur)).FnullRow = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*Ti64)(unsafe.Pointer(bp + 368)) (*TVdbeCursor)(unsafe.Pointer(pTabCur)).FdeferredMoveto = uint8(1) (*TVdbeCursor)(unsafe.Pointer(pTabCur)).FcacheStatus = uint32(CACHE_STALE) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pTabCur + 12)) = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) (*TVdbeCursor)(unsafe.Pointer(pTabCur)).FpAltCursor = pC26 } else { pOut = _out2Prerelease(tls, p, pOp) *(*Ti64)(unsafe.Pointer(pOut)) = *(*Ti64)(unsafe.Pointer(bp + 368)) } } else { - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemSetNull(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40) } goto _187 @@ -75975,7 +72391,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _123: ; /* The P1 index cursor */ - _ = libc.Int32FromInt32(0) pC27 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) if (*TVdbeCursor)(unsafe.Pointer(pC27)).FdeferredMoveto != 0 { rc = _sqlite3VdbeFinishMoveto(tls, pC27) @@ -76036,53 +72451,38 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, ncycle */ _124: ; - _ = libc.Int32FromInt32(0) pC28 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*(*TUnpackedRecord)(unsafe.Pointer(bp + 376))).FpKeyInfo = (*TVdbeCursor)(unsafe.Pointer(pC28)).FpKeyInfo - (*(*TUnpackedRecord)(unsafe.Pointer(bp + 376))).FnField = uint16(*(*int32)(unsafe.Pointer(pOp + 16))) - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) < int32(OP_IdxLT) { - _ = libc.Int32FromInt32(0) + (*(*TUnpackedRecord)(unsafe.Pointer(bp + 376))).FnField = libc.Uint16FromInt32(*(*int32)(unsafe.Pointer(pOp + 16))) + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) < int32(OP_IdxLT) { (*(*TUnpackedRecord)(unsafe.Pointer(bp + 376))).Fdefault_rc = int8(-int32(1)) } else { - _ = libc.Int32FromInt32(0) (*(*TUnpackedRecord)(unsafe.Pointer(bp + 376))).Fdefault_rc = 0 } (*(*TUnpackedRecord)(unsafe.Pointer(bp + 376))).FaMem = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 /* Inlined version of sqlite3VdbeIdxKeyCompare() */ nCellKey = 0 - _ = libc.Int32FromInt32(0) pCur2 = *(*uintptr)(unsafe.Pointer(pC28 + 36)) - _ = libc.Int32FromInt32(0) - nCellKey = int64(_sqlite3BtreePayloadSize(tls, pCur2)) + nCellKey = libc.Int64FromUint32(_sqlite3BtreePayloadSize(tls, pCur2)) /* nCellKey will always be between 0 and 0xffffffff because of the way ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(99862)) + rc = _sqlite3CorruptError(tls, int32(99864)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+404, db, uint16(0)) - rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur2, uint32(nCellKey), bp+404) + rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur2, libc.Uint32FromInt64(nCellKey), bp+404) if rc != 0 { goto abort_due_to_error } res10 = _sqlite3VdbeRecordCompareWithSkip(tls, (*(*TMem)(unsafe.Pointer(bp + 404))).Fn, (*(*TMem)(unsafe.Pointer(bp + 404))).Fz, bp+376, 0) _sqlite3VdbeMemReleaseMalloc(tls, bp+404) /* End of inlined sqlite3VdbeIdxKeyCompare() */ - _ = libc.Int32FromInt32(0) - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode)&int32(1) == libc.Int32FromInt32(OP_IdxLT)&libc.Int32FromInt32(1) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode)&int32(1) == libc.Int32FromInt32(OP_IdxLT)&libc.Int32FromInt32(1) { res10 = -res10 } else { - _ = libc.Int32FromInt32(0) res10++ } - _ = libc.Int32FromInt32(0) if res10 > 0 { goto jump_to_p2 } @@ -76116,8 +72516,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _128: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > (*Tsqlite3)(unsafe.Pointer(db)).FnVDestroy+int32(1) { @@ -76126,7 +72524,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto abort_due_to_error } else { iDb2 = (*TOp)(unsafe.Pointer(pOp)).Fp3 - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp + 444)) = 0 /* Not needed. Only to silence a warning. */ rc = _sqlite3BtreeDropTable(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb2)*16))).FpBt, (*TOp)(unsafe.Pointer(pOp)).Fp1, bp+444) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Int) @@ -76135,10 +72532,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto abort_due_to_error } if *(*int32)(unsafe.Pointer(bp + 444)) != 0 { - _sqlite3RootPageMoved(tls, db, iDb2, uint32(*(*int32)(unsafe.Pointer(bp + 444))), uint32((*TOp)(unsafe.Pointer(pOp)).Fp1)) + _sqlite3RootPageMoved(tls, db, iDb2, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 444))), libc.Uint32FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp1)) /* All OP_Destroy operations occur on the same btree */ - _ = libc.Int32FromInt32(0) - resetSchemaOnFault = uint8(iDb2 + int32(1)) + resetSchemaOnFault = libc.Uint8FromInt32(iDb2 + int32(1)) } } goto _187 @@ -76162,13 +72558,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _129: ; *(*Ti64)(unsafe.Pointer(bp + 448)) = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - rc = _sqlite3BtreeClearTable(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*16))).FpBt, int32(uint32((*TOp)(unsafe.Pointer(pOp)).Fp1)), bp+448) + rc = _sqlite3BtreeClearTable(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*16))).FpBt, libc.Int32FromUint32(libc.Uint32FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp1)), bp+448) if (*TOp)(unsafe.Pointer(pOp)).Fp3 != 0 { *(*Ti64)(unsafe.Pointer(p + 40)) += *(*Ti64)(unsafe.Pointer(bp + 448)) if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 { - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40)) += *(*Ti64)(unsafe.Pointer(bp + 448)) } } @@ -76186,14 +72579,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _130: ; - _ = libc.Int32FromInt32(0) pC29 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - if int32((*TVdbeCursor)(unsafe.Pointer(pC29)).FeCurType) == int32(CURTYPE_SORTER) { + if libc.Int32FromUint8((*TVdbeCursor)(unsafe.Pointer(pC29)).FeCurType) == int32(CURTYPE_SORTER) { _sqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC29 + 36))) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC29 + 36))) if rc != 0 { goto abort_due_to_error @@ -76213,17 +72602,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; pOut = _out2Prerelease(tls, p, pOp) *(*TPgno)(unsafe.Pointer(bp + 456)) = uint32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pDb3 = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*16 - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeCreateTable(tls, (*TDb)(unsafe.Pointer(pDb3)).FpBt, bp+456, (*TOp)(unsafe.Pointer(pOp)).Fp3) if rc != 0 { goto abort_due_to_error } - *(*Ti64)(unsafe.Pointer(pOut)) = int64(*(*TPgno)(unsafe.Pointer(bp + 456))) + *(*Ti64)(unsafe.Pointer(pOut)) = libc.Int64FromUint32(*(*TPgno)(unsafe.Pointer(bp + 456))) goto _187 /* Opcode: SqlExec P1 P2 * P4 * ** @@ -76282,11 +72666,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** sqlite3InitCallback(). */ iDb3 = (*TOp)(unsafe.Pointer(pOp)).Fp1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(pOp + 16)) == uintptr(0) { _sqlite3SchemaClear(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FpSchema) - *(*Tu32)(unsafe.Pointer(db + 24)) &= uint32(^libc.Int32FromInt32(DBFLAG_SchemaKnownOk)) + *(*Tu32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_SchemaKnownOk)) rc = _sqlite3InitOne(tls, db, iDb3, p+120, uint32((*TOp)(unsafe.Pointer(pOp)).Fp5)) *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(0), 0, 0x3) @@ -76301,11 +72683,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(1) (*(*TInitData)(unsafe.Pointer(bp + 464))).Frc = SQLITE_OK (*(*TInitData)(unsafe.Pointer(bp + 464))).FnInitRow = uint32(0) - _ = libc.Int32FromInt32(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+464, uintptr(0)) if rc == SQLITE_OK { rc = (*(*TInitData)(unsafe.Pointer(bp + 464))).Frc @@ -76314,7 +72694,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100155)) + rc = _sqlite3CorruptError(tls, int32(100157)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -76336,7 +72716,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _134: ; - _ = libc.Int32FromInt32(0) rc = _sqlite3AnalysisLoad(tls, db, (*TOp)(unsafe.Pointer(pOp)).Fp1) if rc != 0 { goto abort_due_to_error @@ -76399,24 +72778,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _138: ; /* Register keeping track of errors remaining */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) nRoot = (*TOp)(unsafe.Pointer(pOp)).Fp2 aRoot = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pnErr = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1+int32(1))*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeIntegrityCheck(tls, db, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp5)*16))).FpBt, aRoot+1*4, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40, nRoot, int32(*(*Ti64)(unsafe.Pointer(pnErr)))+int32(1), bp+492, bp+496) _sqlite3VdbeMemSetNull(tls, pIn1) if *(*int32)(unsafe.Pointer(bp + 492)) == 0 { - _ = libc.Int32FromInt32(0) } else { if rc != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 496))) @@ -76426,7 +72794,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _sqlite3VdbeMemSetStr(tls, pIn1, *(*uintptr)(unsafe.Pointer(bp + 496)), int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp(Xsqlite3_free)) } } - _sqlite3VdbeChangeEncoding(tls, pIn1, int32(encoding)) + _sqlite3VdbeChangeEncoding(tls, pIn1, libc.Int32FromUint8(encoding)) goto check_for_interrupt /* Opcode: RowSetAdd P1 P2 * * * ** Synopsis: rowset(P1)=r[P2] @@ -76440,13 +72808,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* in1, in2 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pIn2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Blob) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Blob) == 0 { if _sqlite3VdbeMemSetRowSet(tls, pIn1) != 0 { goto no_mem } } - _ = libc.Int32FromInt32(0) _sqlite3RowSetInsert(tls, (*TMem)(unsafe.Pointer(pIn1)).Fz, *(*Ti64)(unsafe.Pointer(pIn2))) goto _187 /* Opcode: RowSetRead P1 P2 P3 * * @@ -76460,8 +72826,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _140: ; pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Blob) == 0 || _sqlite3RowSetNext(tls, (*TMem)(unsafe.Pointer(pIn1)).Fz, bp+504) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Blob) == 0 || _sqlite3RowSetNext(tls, (*TMem)(unsafe.Pointer(pIn1)).Fz, bp+504) == 0 { /* The boolean index is empty */ _sqlite3VdbeMemSetNull(tls, pIn1) goto jump_to_p2_and_check_for_interrupt @@ -76498,18 +72863,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 iSet = *(*int32)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) /* If there is anything other than a rowset object in memory cell P1, ** delete it now and initialize P1 with an empty rowset */ - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Blob) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Blob) == 0 { if _sqlite3VdbeMemSetRowSet(tls, pIn1) != 0 { goto no_mem } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iSet != 0 { exists = _sqlite3RowSetTest(tls, (*TMem)(unsafe.Pointer(pIn1)).Fz, iSet, *(*Ti64)(unsafe.Pointer(pIn3))) if exists != 0 { @@ -76541,7 +72902,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* Token identifying trigger */ pProgram = *(*uintptr)(unsafe.Pointer(pOp + 16)) pRt = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 - _ = libc.Int32FromInt32(0) /* If the p5 flag is clear, then recursive invocation of triggers is ** disabled for backwards compatibility (p5 is set if this sub-program ** is really a trigger, not a foreign key action, and the flag set @@ -76578,24 +72938,23 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** of the current program, and the memory required at runtime to execute ** the trigger program. If this trigger has been fired before, then pRt ** is already allocated. Otherwise, it must be initialized. */ - if int32((*TMem)(unsafe.Pointer(pRt)).Fflags)&int32(MEM_Blob) == 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRt)).Fflags)&int32(MEM_Blob) == 0 { /* SubProgram.nMem is set to the number of memory cells used by the ** program stored in SubProgram.aOp. As well as these, one memory ** cell is required for each cursor used by the program. Set local ** variable nMem (and later, VdbeFrame.nChildMem) to this value. */ nMem = (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem + (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr - _ = libc.Int32FromInt32(0) if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = int32((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7)) + uint32(nMem)*uint32(40) + uint32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint32(4) + uint32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, uint64(nByte2)) + nByte2 = libc.Int32FromUint32((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(nMem)*uint32(40) + libc.Uint32FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint32(4) + libc.Uint32FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) - (*TMem)(unsafe.Pointer(pRt)).Fflags = uint16(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) + (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) @@ -76610,8 +72969,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FaOp = (*TVdbe)(unsafe.Pointer(p)).FaOp (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnOp = (*TVdbe)(unsafe.Pointer(p)).FnOp (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken = (*TSubProgram)(unsafe.Pointer(pProgram)).Ftoken - pEnd = pFrame2 + uintptr((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) + uintptr((*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem)*40 - pMem1 = pFrame2 + uintptr((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) + pEnd = pFrame2 + uintptr((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) + uintptr((*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem)*40 + pMem1 = pFrame2 + uintptr((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) for { if !(pMem1 != pEnd) { break @@ -76625,29 +72984,24 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { pFrame2 = (*TMem)(unsafe.Pointer(pRt)).Fz - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } (*TVdbe)(unsafe.Pointer(p)).FnFrame++ (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FpParent = (*TVdbe)(unsafe.Pointer(p)).FpFrame (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FlastRowid = (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChange = (*TVdbe)(unsafe.Pointer(p)).FnChange (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnDbChange = (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).FnChange - _ = libc.Int32FromInt32(0) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FpAuxData = (*TVdbe)(unsafe.Pointer(p)).FpAuxData (*TVdbe)(unsafe.Pointer(p)).FpAuxData = uintptr(0) (*TVdbe)(unsafe.Pointer(p)).FnChange = 0 (*TVdbe)(unsafe.Pointer(p)).FpFrame = pFrame2 - v278 = pFrame2 + uintptr((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) + v278 = pFrame2 + uintptr((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) aMem = v278 (*TVdbe)(unsafe.Pointer(p)).FaMem = v278 (*TVdbe)(unsafe.Pointer(p)).FnMem = (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem - (*TVdbe)(unsafe.Pointer(p)).FnCursor = int32(uint16((*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildCsr)) + (*TVdbe)(unsafe.Pointer(p)).FnCursor = libc.Int32FromUint16(libc.Uint16FromInt32((*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildCsr)) (*TVdbe)(unsafe.Pointer(p)).FapCsr = aMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem)*40 (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce = (*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*4 - libc.Xmemset(tls, (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce, 0, uint32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) + libc.Xmemset(tls, (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce, 0, libc.Uint32FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) v279 = (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp aOp = v279 (*TVdbe)(unsafe.Pointer(p)).FaOp = v279 @@ -76745,7 +73099,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } else { pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 } - _ = libc.Int32FromInt32(0) _sqlite3VdbeMemIntegerify(tls, pIn1) pIn2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 _sqlite3VdbeMemIntegerify(tls, pIn2) @@ -76766,7 +73119,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _147: ; /* jump, in1 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) if *(*Ti64)(unsafe.Pointer(pIn1)) > 0 { *(*Ti64)(unsafe.Pointer(pIn1)) -= int64((*TOp)(unsafe.Pointer(pOp)).Fp3) goto jump_to_p2 @@ -76795,8 +73147,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 pOut = _out2Prerelease(tls, p, pOp) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer(bp + 512)) = *(*Ti64)(unsafe.Pointer(pIn1)) if v282 = *(*Ti64)(unsafe.Pointer(bp + 512)) <= 0; !v282 { if *(*Ti64)(unsafe.Pointer(pIn3)) > 0 { @@ -76829,7 +73179,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _149: ; /* jump, in1 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) if *(*Ti64)(unsafe.Pointer(pIn1)) != 0 { if *(*Ti64)(unsafe.Pointer(pIn1)) > 0 { *(*Ti64)(unsafe.Pointer(pIn1))-- @@ -76846,7 +73195,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _150: ; /* jump, in1 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) if *(*Ti64)(unsafe.Pointer(pIn1)) > int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) { *(*Ti64)(unsafe.Pointer(pIn1))-- } @@ -76897,12 +73245,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; _151: ; - _ = libc.Int32FromInt32(0) - n4 = int32((*TOp)(unsafe.Pointer(pOp)).Fp5) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - pCtx = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(n4)*uint32(4)+(libc.Uint32FromInt64(32)+libc.Uint32FromInt64(40)-libc.Uint32FromInt64(4)))) + n4 = libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) + pCtx = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint32FromInt32(n4)*uint32(4)+(libc.Uint32FromInt64(32)+libc.Uint32FromInt64(40)-libc.Uint32FromInt64(4)))) if pCtx == uintptr(0) { goto no_mem } @@ -76915,15 +73259,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FskipFlag = uint8(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0 (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fenc = encoding - (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = uint8(n4) + (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = libc.Uint8FromInt32(n4) (*TOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(15)) *(*uintptr)(unsafe.Pointer(pOp + 16)) = pCtx /* OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 */ - _ = libc.Int32FromInt32(0) (*TOp)(unsafe.Pointer(pOp)).Fopcode = uint8(OP_AggStep1) _153: ; - _ = libc.Int32FromInt32(0) pCtx1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) pMem2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 /* If this function is inside of a trigger, the register array in aMem[] @@ -76932,7 +73274,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** reinitializes the relevant parts of the sqlite3_context object */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpMem != pMem2 { (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpMem = pMem2 - i4 = int32((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - int32(1) + i4 = libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - int32(1) for { if !(i4 >= 0) { break @@ -76945,13 +73287,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } (*TMem)(unsafe.Pointer(pMem2)).Fn++ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxInverse})))(tls, pCtx1, int32((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+28) + (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxInverse})))(tls, pCtx1, libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+28) } else { - (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxSFunc})))(tls, pCtx1, int32((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+28) + (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxSFunc})))(tls, pCtx1, libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+28) } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { @@ -76959,7 +73298,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { - _ = libc.Int32FromInt32(0) i4 = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*20))).Fp1 if i4 != 0 { _sqlite3VdbeMemSetInt64(tls, aMem+uintptr(i4)*40, int64(1)) @@ -76973,8 +73311,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto abort_due_to_error } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto _187 /* Opcode: AggFinal P1 P2 * P4 * ** Synopsis: accum=r[P1] N=P2 @@ -77006,10 +73342,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; _154: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pMem3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp3 != 0 { rc = _sqlite3VdbeMemAggValue(tls, pMem3, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40, *(*uintptr)(unsafe.Pointer(pOp + 16))) pMem3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 @@ -77020,7 +73353,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+672, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } - _sqlite3VdbeChangeEncoding(tls, pMem3, int32(encoding)) + _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) goto _187 /* Opcode: Checkpoint P1 P2 P3 * * ** @@ -77035,12 +73368,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _156: ; /* Write results here */ - _ = libc.Int32FromInt32(0) (*(*[3]int32)(unsafe.Pointer(bp + 520)))[0] = 0 v284 = -libc.Int32FromInt32(1) (*(*[3]int32)(unsafe.Pointer(bp + 520)))[int32(2)] = v284 (*(*[3]int32)(unsafe.Pointer(bp + 520)))[int32(1)] = v284 - _ = libc.Int32FromInt32(0) rc = _sqlite3Checkpoint(tls, db, (*TOp)(unsafe.Pointer(pOp)).Fp1, (*TOp)(unsafe.Pointer(pOp)).Fp2, bp+520+1*4, bp+520+2*4) if rc != 0 { if rc != int32(SQLITE_BUSY) { @@ -77078,16 +73409,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* Name of database file for pPager */ pOut = _out2Prerelease(tls, p, pOp) eNew = (*TOp)(unsafe.Pointer(pOp)).Fp3 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pBt1 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*16))).FpBt pPager = _sqlite3BtreePager(tls, pBt1) eOld = _sqlite3PagerGetJournalMode(tls, pPager) if eNew == -int32(1) { eNew = eOld } - _ = libc.Int32FromInt32(0) if !(_sqlite3PagerOkToChangeJournalMode(tls, pPager) != 0) { eNew = eOld } @@ -77129,7 +73456,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* Open a transaction on the database file. Regardless of the journal ** mode, this transaction always uses a rollback journal. */ - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK { if eNew == int32(PAGER_JOURNALMODE_WAL) { v287 = int32(2) @@ -77144,11 +73470,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { eNew = eOld } eNew = _sqlite3PagerSetJournalMode(tls, pPager, eNew) - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Static) | libc.Int32FromInt32(MEM_Term)) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Static) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pOut)).Fz = _sqlite3JournalModename(tls, eNew) (*TMem)(unsafe.Pointer(pOut)).Fn = _sqlite3Strlen30(tls, (*TMem)(unsafe.Pointer(pOut)).Fz) (*TMem)(unsafe.Pointer(pOut)).Fenc = uint8(SQLITE_UTF8) - _sqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) + _sqlite3VdbeChangeEncoding(tls, pOut, libc.Int32FromUint8(encoding)) if rc != 0 { goto abort_due_to_error } @@ -77164,7 +73490,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _158: ; - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp2 != 0 { v288 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 } else { @@ -77183,9 +73508,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _159: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pBt2 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*16))).FpBt rc = _sqlite3BtreeIncrVacuum(tls, pBt2) if rc != 0 { @@ -77214,11 +73536,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _160: ; - _ = libc.Int32FromInt32(0) if !((*TOp)(unsafe.Pointer(pOp)).Fp1 != 0) { _sqlite3ExpirePreparedStatements(tls, db, (*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - libc.SetBitFieldPtr16Uint32(p+144, uint32((*TOp)(unsafe.Pointer(pOp)).Fp2+libc.Int32FromInt32(1)), 0, 0x3) + libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp2+libc.Int32FromInt32(1)), 0, 0x3) } goto _187 /* Opcode: CursorLock P1 * * * * @@ -77228,10 +73549,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _161: ; - _ = libc.Int32FromInt32(0) pC30 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC30 + 36))) goto _187 /* Opcode: CursorUnlock P1 * * * * @@ -77241,10 +73559,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _162: ; - _ = libc.Int32FromInt32(0) pC31 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC31 + 36))) goto _187 /* Opcode: TableLock P1 P2 P3 P4 * @@ -77264,12 +73579,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _163: ; - isWriteLock = uint8((*TOp)(unsafe.Pointer(pOp)).Fp3) - if isWriteLock != 0 || uint64(0) == (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00004))<<libc.Int32FromInt32(32)) { + isWriteLock = libc.Uint8FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp3) + if isWriteLock != 0 || uint64(0) == (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00004))<<libc.Int32FromInt32(32)) { p13 = (*TOp)(unsafe.Pointer(pOp)).Fp1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeLockTable(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(p13)*16))).FpBt, (*TOp)(unsafe.Pointer(pOp)).Fp2, isWriteLock) if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { @@ -77311,12 +73623,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*(*TMem)(unsafe.Pointer(bp + 532))).Fdb = db /* Because P2 is always a static string, it is impossible for the ** sqlite3VdbeMemCopy() to fail */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3VdbeMemCopy(tls, bp+532, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40) - _ = libc.Int32FromInt32(0) zTab = Xsqlite3_value_text(tls, bp+532) - _ = libc.Int32FromInt32(0) if zTab != 0 { rc = _sqlite3VtabCallCreate(tls, db, (*TOp)(unsafe.Pointer(pOp)).Fp1, zTab, p+120) } @@ -77335,7 +73643,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FnVDestroy++ rc = _sqlite3VtabCallDestroy(tls, db, (*TOp)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*Tsqlite3)(unsafe.Pointer(db)).FnVDestroy-- - _ = libc.Int32FromInt32(0) if rc != 0 { goto abort_due_to_error } @@ -77348,7 +73655,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _167: ; - _ = libc.Int32FromInt32(0) pCur3 = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 572)) = uintptr(0) pVtab1 = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab @@ -77370,7 +73676,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(pCur3 + 36)) = *(*uintptr)(unsafe.Pointer(bp + 572)) (*Tsqlite3_vtab)(unsafe.Pointer(pVtab1)).FnRef++ } else { - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule1)).FxClose})))(tls, *(*uintptr)(unsafe.Pointer(bp + 572))) goto no_mem } @@ -77389,11 +73694,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp + 576)) = uintptr(0) pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 _sqlite3VdbeMemSetNull(tls, pOut) /* Innocent until proven guilty */ - _ = libc.Int32FromInt32(0) pTab3 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*(*struct { FnArg int32 FazArg uintptr @@ -77406,17 +73707,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab3 + 44))).Fp)).FpVtab - _ = libc.Int32FromInt32(0) pModule2 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab2)).FpModule - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VtabLock(tls, (*(*struct { FnArg int32 FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab3 + 44))).Fp) - _ = libc.Int32FromInt32(0) rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule2)).FxIntegrity})))(tls, pVtab2, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab3)).FzName, (*TOp)(unsafe.Pointer(pOp)).Fp3, bp+576) _sqlite3VtabUnlock(tls, (*(*struct { FnArg int32 @@ -77478,14 +73774,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pQuery = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 pArgc = pQuery + 1*40 pCur4 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pVCur1 = *(*uintptr)(unsafe.Pointer(pCur4 + 36)) pVtab3 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(pVCur1)).FpVtab pModule3 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab3)).FpModule /* Grab the index number and argc parameters */ - _ = libc.Int32FromInt32(0) nArg = int32(*(*Ti64)(unsafe.Pointer(pArgc))) iQuery = int32(*(*Ti64)(unsafe.Pointer(pQuery))) /* Invoke the xFilter method */ @@ -77529,30 +73821,25 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _171: ; pCur5 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pDest2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 if (*TVdbeCursor)(unsafe.Pointer(pCur5)).FnullRow != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) goto _187 } - _ = libc.Int32FromInt32(0) pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 36)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp+580, 0, uint32(32)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).Fenc = encoding (*(*TFuncDef)(unsafe.Pointer(bp + 612))).FpUserData = uintptr(0) (*(*TFuncDef)(unsafe.Pointer(bp + 612))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).FpFunc = bp + 612 - _ = libc.Int32FromInt32(0) - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) - (*TMem)(unsafe.Pointer(pDest2)).Fflags = uint16(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) + (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pDest2)).Fu)) = 0 } else { - (*TMem)(unsafe.Pointer(pDest2)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pDest2)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Null)) + (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pDest2)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Null)) } rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 36)), bp+580, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) @@ -77560,7 +73847,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+672, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).FisError } - _sqlite3VdbeChangeEncoding(tls, pDest2, int32(encoding)) + _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) if rc != 0 { goto abort_due_to_error } @@ -77574,14 +73861,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _172: ; pCur6 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TVdbeCursor)(unsafe.Pointer(pCur6)).FnullRow != 0 { goto _187 } pVtab5 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur6 + 36)))).FpVtab pModule5 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab5)).FpModule - _ = libc.Int32FromInt32(0) /* Invoke the xNext() method of the module. There is no way for the ** underlying implementation to return an error if one occurs during ** xNext(). Instead, if an error occurs, true is returned (indicating that @@ -77607,14 +73891,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _173: ; - isLegacy = int32((*Tsqlite3)(unsafe.Pointer(db)).Fflags & libc.Uint64FromInt32(SQLITE_LegacyAlter)) + isLegacy = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags & libc.Uint64FromInt32(SQLITE_LegacyAlter)) *(*Tu64)(unsafe.Pointer(db + 28)) |= uint64(SQLITE_LegacyAlter) pVtab6 = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab pName = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _sqlite3VdbeChangeEncoding(tls, pName, int32(SQLITE_UTF8)) if rc != 0 { goto abort_due_to_error @@ -77659,8 +73939,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _174: ; *(*Tsqlite_int64)(unsafe.Pointer(bp + 656)) = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -77671,7 +73949,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pModule6 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab7)).FpModule nArg1 = (*TOp)(unsafe.Pointer(pOp)).Fp2 - _ = libc.Int32FromInt32(0) if (*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate != 0 { vtabOnConflict = (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict apArg1 = (*TVdbe)(unsafe.Pointer(p)).FapArg @@ -77681,7 +73958,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(i7 < nArg1) { break } - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(apArg1 + uintptr(i7)*4)) = pX1 pX1 += 40 goto _290 @@ -77694,19 +73970,18 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 656)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { rc = SQLITE_OK } else { - if int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Replace) { + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Replace) { v291 = int32(OE_Abort) } else { - v291 = int32((*TOp)(unsafe.Pointer(pOp)).Fp5) + v291 = libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) } - (*TVdbe)(unsafe.Pointer(p)).FerrorAction = uint8(v291) + (*TVdbe)(unsafe.Pointer(p)).FerrorAction = libc.Uint8FromInt32(v291) } } else { (*TVdbe)(unsafe.Pointer(p)).FnChange++ @@ -77723,7 +73998,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _175: ; /* out2 */ pOut = _out2Prerelease(tls, p, pOp) - *(*Ti64)(unsafe.Pointer(pOut)) = int64(_sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*16))).FpBt)) + *(*Ti64)(unsafe.Pointer(pOut)) = libc.Int64FromUint32(_sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*16))).FpBt)) goto _187 /* Opcode: MaxPgcnt P1 P2 P3 * * ** @@ -77740,11 +74015,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { newMax = uint32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp3 != 0 { newMax = _sqlite3BtreeLastPage(tls, pBt3) - if newMax < uint32((*TOp)(unsafe.Pointer(pOp)).Fp3) { - newMax = uint32((*TOp)(unsafe.Pointer(pOp)).Fp3) + if newMax < libc.Uint32FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp3) { + newMax = libc.Uint32FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp3) } } - *(*Ti64)(unsafe.Pointer(pOut)) = int64(_sqlite3BtreeMaxPageCount(tls, pBt3, newMax)) + *(*Ti64)(unsafe.Pointer(pOut)) = libc.Int64FromUint32(_sqlite3BtreeMaxPageCount(tls, pBt3, newMax)) goto _187 /* Opcode: Function P1 P2 P3 P4 * ** Synopsis: r[P3]=func(r[P2@NP]) @@ -77796,7 +74071,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* group */ _177: ; - _ = libc.Int32FromInt32(0) pCtx2 = *(*uintptr)(unsafe.Pointer(pOp + 16)) /* If this function is inside of a trigger, the register array in aMem[] ** might change from one evaluation to the next. The next block of code @@ -77807,7 +74081,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FpVdbe = p (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FpOut = pOut (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fenc = encoding - i8 = int32((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - int32(1) + i8 = libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - int32(1) for { if !(i8 >= 0) { break @@ -77819,10 +74093,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i8-- } } - _ = libc.Int32FromInt32(0) - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Null)) - _ = libc.Int32FromInt32(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FpFunc)).FxSFunc})))(tls, pCtx2, int32((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fargc), pCtx2+28) /* IMP: R-24505-23230 */ + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Null)) + (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FpFunc)).FxSFunc})))(tls, pCtx2, libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fargc), pCtx2+28) /* IMP: R-24505-23230 */ /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { @@ -77835,8 +74107,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto abort_due_to_error } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto _187 /* Opcode: ClrSubtype P1 * * * * ** Synopsis: r[P1].subtype = 0 @@ -77859,8 +74129,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* in1 out2 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Subtype) != 0 { - _sqlite3VdbeMemSetInt64(tls, pOut, int64((*TMem)(unsafe.Pointer(pIn1)).FeSubtype)) + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Subtype) != 0 { + _sqlite3VdbeMemSetInt64(tls, pOut, libc.Int64FromUint8((*TMem)(unsafe.Pointer(pIn1)).FeSubtype)) } else { _sqlite3VdbeMemSetNull(tls, pOut) } @@ -77875,14 +74145,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* in1 out2 */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*40 - if int32((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn1)).Fflags)&int32(MEM_Null) != 0 { p294 = pOut + 16 *(*Tu16)(unsafe.Pointer(p294)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p294))) & ^libc.Int32FromInt32(MEM_Subtype)) } else { - _ = libc.Int32FromInt32(0) p295 = pOut + 16 *(*Tu16)(unsafe.Pointer(p295)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p295))) | libc.Int32FromInt32(MEM_Subtype)) - (*TMem)(unsafe.Pointer(pOut)).FeSubtype = uint8(*(*Ti64)(unsafe.Pointer(pIn1)) & libc.Int64FromInt32(0xff)) + (*TMem)(unsafe.Pointer(pOut)).FeSubtype = libc.Uint8FromInt64(*(*Ti64)(unsafe.Pointer(pIn1)) & libc.Int64FromInt32(0xff)) } goto _187 /* Opcode: FilterAdd P1 * P3 P4 * @@ -77893,12 +74162,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _182: ; - _ = libc.Int32FromInt32(0) pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) h = _filterHash(tls, aMem, pOp) - h %= uint64((*TMem)(unsafe.Pointer(pIn1)).Fn * libc.Int32FromInt32(8)) + h %= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pIn1)).Fn * libc.Int32FromInt32(8)) p296 = (*TMem)(unsafe.Pointer(pIn1)).Fz + uintptr(h/uint64(8)) *(*int8)(unsafe.Pointer(p296)) = int8(int32(*(*int8)(unsafe.Pointer(p296))) | libc.Int32FromInt32(1)<<(h&libc.Uint64FromInt32(7))) goto _187 @@ -77918,12 +74184,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _183: ; - _ = libc.Int32FromInt32(0) pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) h1 = _filterHash(tls, aMem, pOp) - h1 %= uint64((*TMem)(unsafe.Pointer(pIn1)).Fn * libc.Int32FromInt32(8)) + h1 %= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pIn1)).Fn * libc.Int32FromInt32(8)) if int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pIn1)).Fz + uintptr(h1/uint64(8)))))&(int32(1)<<(h1&uint64(7))) == 0 { *(*Tu32)(unsafe.Pointer(p + 156 + 8*4))++ goto jump_to_p2 @@ -77969,10 +74232,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** using the X argument when X begins with "--" and invoking ** sqlite3_expanded_sql(P) otherwise. */ - _ = libc.Int32FromInt32(0) /* OP_Init is always instruction 0 */ - _ = libc.Int32FromInt32(0) - if v299 = int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&(libc.Int32FromInt32(SQLITE_TRACE_STMT)|libc.Int32FromInt32(SQLITE_TRACE_LEGACY)) != 0 && int32((*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat) != int32(254); v299 { + if v299 = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&(libc.Int32FromInt32(SQLITE_TRACE_STMT)|libc.Int32FromInt32(SQLITE_TRACE_LEGACY)) != 0 && libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat) != int32(254); v299 { if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { v298 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } else { @@ -77982,7 +74243,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zTrace = v297 } if v299 && v297 != uintptr(0) { - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_LEGACY) != 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_LEGACY) != 0 { z2 = _sqlite3VdbeExpandSql(tls, p, zTrace) (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).Ftrace.FxLegacy})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, z2) Xsqlite3_free(tls, z2) @@ -77996,9 +74257,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } - _ = libc.Int32FromInt32(0) if (*TOp)(unsafe.Pointer(pOp)).Fp1 >= _sqlite3Config.FiOnceResetThreshold { - if int32((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Trace) { + if libc.Int32FromUint8((*TOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Trace) { goto _187 } i9 = int32(1) @@ -78006,7 +74266,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(i9 < (*TVdbe)(unsafe.Pointer(p)).FnOp) { break } - if int32((*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(i9)*20))).Fopcode) == int32(OP_Once) { + if libc.Int32FromUint8((*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(i9)*20))).Fopcode) == int32(OP_Once) { (*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(i9)*20))).Fp1 = 0 } goto _300 @@ -78032,7 +74292,6 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _186: ; /* This is really OP_Noop, OP_Explain */ - _ = libc.Int32FromInt32(0) goto _187 /***************************************************************************** ** The cases of the switch statement above this line should all be indented @@ -78062,28 +74321,27 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<<libc.Int32FromInt32(8) { - rc = _sqlite3CorruptError(tls, int32(102187)) + rc = _sqlite3CorruptError(tls, int32(102189)) } } - _ = libc.Int32FromInt32(0) if (*TVdbe)(unsafe.Pointer(p)).FzErrMsg == uintptr(0) && rc != libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) { _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+672, _sqlite3ErrStr(tls, rc))) } (*TVdbe)(unsafe.Pointer(p)).Frc = rc _sqlite3SystemError(tls, db, rc) Xsqlite3_log(tls, rc, __ccgo_ts+6333, libc.VaList(bp+672, (int32(pOp)-int32(aOp))/20, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) - if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_RUN_STATE) { + if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_RUN_STATE) { _sqlite3VdbeHalt(tls, p) } if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) { _sqlite3OomFault(tls, db) } - if rc == int32(SQLITE_CORRUPT) && int32((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 { - *(*Tu64)(unsafe.Pointer(db + 28)) |= uint64(libc.Int32FromInt32(0x00002)) << libc.Int32FromInt32(32) + if rc == int32(SQLITE_CORRUPT) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 { + *(*Tu64)(unsafe.Pointer(db + 28)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00002)) << libc.Int32FromInt32(32) } rc = int32(SQLITE_ERROR) - if int32(resetSchemaOnFault) > 0 { - _sqlite3ResetOneSchema(tls, db, int32(resetSchemaOnFault)-int32(1)) + if libc.Int32FromUint8(resetSchemaOnFault) > 0 { + _sqlite3ResetOneSchema(tls, db, libc.Int32FromUint8(resetSchemaOnFault)-int32(1)) } /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the @@ -78099,11 +74357,10 @@ vdbe_return: goto abort_due_to_error } } - *(*Tu32)(unsafe.Pointer(p + 156 + 4*4)) += uint32(int32(nVmStep)) + *(*Tu32)(unsafe.Pointer(p + 156 + 4*4)) += libc.Uint32FromInt32(libc.Int32FromUint64(nVmStep)) if (*TVdbe)(unsafe.Pointer(p)).FlockMask != uint32(0) { _sqlite3VdbeLeave(tls, p) } - _ = libc.Int32FromInt32(0) return rc /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. @@ -78129,7 +74386,6 @@ no_mem: goto abort_due_to_interrupt abort_due_to_interrupt: ; - _ = libc.Int32FromInt32(0) rc = int32(SQLITE_INTERRUPT) goto abort_due_to_error return r @@ -78181,7 +74437,7 @@ var _aMask = [12]uint8{ */ var _aFlag1 = [2]Tu16{ 0: uint16(MEM_Blob), - 1: uint16(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Term)), + 1: libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Term)), } var _vfsFlags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) | libc.Int32FromInt32(SQLITE_OPEN_TRANSIENT_DB) @@ -78276,16 +74532,13 @@ func _blobSeekToRow(tls *libc.TLS, p uintptr, iRow Tsqlite3_int64, pzErr uintptr ** counter is faster. */ if (*TVdbe)(unsafe.Pointer(v)).Fpc > int32(4) { (*TVdbe)(unsafe.Pointer(v)).Fpc = int32(4) - _ = libc.Int32FromInt32(0) rc = _sqlite3VdbeExec(tls, v) } else { rc = Xsqlite3_step(tls, (*TIncrblob)(unsafe.Pointer(p)).FpStmt) } if rc == int32(SQLITE_ROW) { pC = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TVdbeCursor)(unsafe.Pointer(pC)).FnHdrParsed) > int32((*TIncrblob)(unsafe.Pointer(p)).FiCol) { + if libc.Int32FromUint16((*TVdbeCursor)(unsafe.Pointer(pC)).FnHdrParsed) > libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol) { v1 = *(*Tu32)(unsafe.Pointer(pC + 84 + uintptr((*TIncrblob)(unsafe.Pointer(p)).FiCol)*4)) } else { v1 = uint32(0) @@ -78307,8 +74560,8 @@ func _blobSeekToRow(tls *libc.TLS, p uintptr, iRow Tsqlite3_int64, pzErr uintptr Xsqlite3_finalize(tls, (*TIncrblob)(unsafe.Pointer(p)).FpStmt) (*TIncrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0) } else { - (*TIncrblob)(unsafe.Pointer(p)).FiOffset = int32(*(*Tu32)(unsafe.Pointer(pC + 84 + uintptr(int32((*TIncrblob)(unsafe.Pointer(p)).FiCol)+int32((*TVdbeCursor)(unsafe.Pointer(pC)).FnField))*4))) - (*TIncrblob)(unsafe.Pointer(p)).FnByte = int32(_sqlite3VdbeSerialTypeLen(tls, type1)) + (*TIncrblob)(unsafe.Pointer(p)).FiOffset = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(pC + 84 + uintptr(libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)+int32((*TVdbeCursor)(unsafe.Pointer(pC)).FnField))*4))) + (*TIncrblob)(unsafe.Pointer(p)).FnByte = libc.Int32FromUint32(_sqlite3VdbeSerialTypeLen(tls, type1)) (*TIncrblob)(unsafe.Pointer(p)).FpCsr = *(*uintptr)(unsafe.Pointer(pC + 36)) _sqlite3BtreeIncrblobCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) } @@ -78327,8 +74580,6 @@ func _blobSeekToRow(tls *libc.TLS, p uintptr, iRow Tsqlite3_int64, pzErr uintptr } } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pzErr)) = zErr return rc } @@ -78363,7 +74614,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) _sqlite3BtreeEnterAll(tls, db) pTab = _sqlite3LocateTable(tls, bp+4, uint32(0), zTable, zDb) - if pTab != 0 && int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if pTab != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { pTab = uintptr(0) _sqlite3ErrorMsg(tls, bp+4, __ccgo_ts+6427, libc.VaList(bp+296, zTable)) } @@ -78371,7 +74622,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, pTab = uintptr(0) _sqlite3ErrorMsg(tls, bp+4, __ccgo_ts+6457, libc.VaList(bp+296, zTable)) } - if pTab != 0 && int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if pTab != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { pTab = uintptr(0) _sqlite3ErrorMsg(tls, bp+4, __ccgo_ts+6493, libc.VaList(bp+296, zTable)) } @@ -78414,7 +74665,6 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, if wrFlag != 0 { zFault = uintptr(0) if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 { - _ = libc.Int32FromInt32(0) pFKey = (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -78450,7 +74700,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } j1 = 0 for { - if !(j1 < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + if !(j1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } /* FIXME: Be smarter about indexes that use expressions */ @@ -78476,31 +74726,28 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } } (*TIncrblob)(unsafe.Pointer(pBlob)).FpStmt = _sqlite3VdbeCreate(tls, bp+4) - _ = libc.Int32FromInt32(0) if (*TIncrblob)(unsafe.Pointer(pBlob)).FpStmt != 0 { v = (*TIncrblob)(unsafe.Pointer(pBlob)).FpStmt iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Transaction), iDb, wrFlag, (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FpSchema)).Fschema_cookie, (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FpSchema)).FiGeneration) _sqlite3VdbeChangeP5(tls, v, uint16(1)) - _ = libc.Int32FromInt32(0) - aOp = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint32FromInt64(24)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_openBlob)), _iLn) + aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(24)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_openBlob)), _iLn) /* Make sure a mutex is held on the table to be accessed */ _sqlite3VdbeUsesBtree(tls, v, iDb) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { /* Configure the OP_TableLock instruction */ (*(*TVdbeOp)(unsafe.Pointer(aOp))).Fp1 = iDb - (*(*TVdbeOp)(unsafe.Pointer(aOp))).Fp2 = int32((*TTable)(unsafe.Pointer(pTab)).Ftnum) + (*(*TVdbeOp)(unsafe.Pointer(aOp))).Fp2 = libc.Int32FromUint32((*TTable)(unsafe.Pointer(pTab)).Ftnum) (*(*TVdbeOp)(unsafe.Pointer(aOp))).Fp3 = wrFlag _sqlite3VdbeChangeP4(tls, v, int32(2), (*TTable)(unsafe.Pointer(pTab)).FzName, P4_TRANSIENT) } - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { /* Remove either the OP_OpenWrite or OpenRead. Set the P2 ** parameter of the other to pTab->tnum. */ if wrFlag != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp + 1*20))).Fopcode = uint8(OP_OpenWrite) } - (*(*TVdbeOp)(unsafe.Pointer(aOp + 1*20))).Fp2 = int32((*TTable)(unsafe.Pointer(pTab)).Ftnum) + (*(*TVdbeOp)(unsafe.Pointer(aOp + 1*20))).Fp2 = libc.Int32FromUint32((*TTable)(unsafe.Pointer(pTab)).Ftnum) (*(*TVdbeOp)(unsafe.Pointer(aOp + 1*20))).Fp3 = iDb /* Configure the number of columns. Configure the cursor to ** think that the table has one more column than it really @@ -78518,7 +74765,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, _sqlite3VdbeMakeReady(tls, v, bp+4) } } - (*TIncrblob)(unsafe.Pointer(pBlob)).FiCol = uint16(iCol) + (*TIncrblob)(unsafe.Pointer(pBlob)).FiCol = libc.Uint16FromInt32(iCol) (*TIncrblob)(unsafe.Pointer(pBlob)).Fdb = db _sqlite3BtreeLeaveAll(tls, db) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -78535,7 +74782,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, goto blob_open_out blob_open_out: ; - if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if rc == SQLITE_OK && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { *(*uintptr)(unsafe.Pointer(ppBlob)) = pBlob } else { if pBlob != 0 && (*TIncrblob)(unsafe.Pointer(pBlob)).FpStmt != 0 { @@ -78634,7 +74881,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(102671)) + return _sqlite3MisuseError(tls, int32(102673)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -78652,15 +74899,12 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in /* Call either BtreeData() or BtreePutData(). If SQLITE_ABORT is ** returned, clean-up the statement handle. */ - _ = libc.Int32FromInt32(0) _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), int32((*TIncrblob)(unsafe.Pointer(p)).FiCol)) + _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, uint32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), uint32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -78736,7 +74980,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(102771)) + return _sqlite3MisuseError(tls, int32(102773)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -78757,10 +75001,8 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _sqlite3ErrorWithMsg(tls, db, rc, v1, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) } - _ = libc.Int32FromInt32(0) } rc = _sqlite3ApiExit(tls, db, rc) - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } @@ -79362,7 +75604,6 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i *(*Ti64)(unsafe.Pointer(p)) += int64(nByte) return SQLITE_OK } - _ = libc.Int32FromInt32(0) /* If there is no more data to be read from the buffer, read the next ** p->nBuffer bytes of data from the file into it. Or, if there are less ** than p->nBuffer bytes remaining in the PMA, read all remaining data. */ @@ -79374,10 +75615,8 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i } else { nRead = int32((*TPmaReader)(unsafe.Pointer(p)).FiEof - (*TPmaReader)(unsafe.Pointer(p)).FiReadOff) } - _ = libc.Int32FromInt32(0) /* Readr data from the file. Return early if an error occurs. */ rc = _sqlite3OsRead(tls, (*TPmaReader)(unsafe.Pointer(p)).FpFd, (*TPmaReader)(unsafe.Pointer(p)).FaBuffer, nRead, (*TPmaReader)(unsafe.Pointer(p)).FiReadOff) - _ = libc.Int32FromInt32(0) if rc != SQLITE_OK { return rc } @@ -79401,7 +75640,7 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i for int64(nByte) > nNew { nNew = nNew * int64(2) } - aNew = _sqlite3Realloc(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc, uint64(nNew)) + aNew = _sqlite3Realloc(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc, libc.Uint64FromInt64(nNew)) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -79410,7 +75649,7 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i } /* Copy as much data as is available in the buffer into the start of ** p->aAlloc[]. */ - libc.Xmemcpy(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc, (*TPmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), uint32(nAvail)) + libc.Xmemcpy(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc, (*TPmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), libc.Uint32FromInt32(nAvail)) *(*Ti64)(unsafe.Pointer(p)) += int64(nAvail) nRem = nByte - nAvail /* The following loop copies up to p->nBuffer bytes per iteration into @@ -79424,8 +75663,7 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i if rc1 != SQLITE_OK { return rc1 } - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc+uintptr(nByte-nRem), *(*uintptr)(unsafe.Pointer(bp)), uint32(nCopy)) + libc.Xmemcpy(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc+uintptr(nByte-nRem), *(*uintptr)(unsafe.Pointer(bp)), libc.Uint32FromInt32(nCopy)) nRem -= nCopy } *(*uintptr)(unsafe.Pointer(ppOut)) = (*TPmaReader)(unsafe.Pointer(p)).FaAlloc @@ -79447,14 +75685,14 @@ func _vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) (r int32) { var _ /* aVarint at bp+0 */ [16]Tu8 _, _, _, _ = i, iBuf, rc, v1 if (*TPmaReader)(unsafe.Pointer(p)).FaMap != 0 { - *(*Ti64)(unsafe.Pointer(p)) += int64(_sqlite3GetVarint(tls, (*TPmaReader)(unsafe.Pointer(p)).FaMap+uintptr((*TPmaReader)(unsafe.Pointer(p)).FiReadOff), pnOut)) + *(*Ti64)(unsafe.Pointer(p)) += libc.Int64FromUint8(_sqlite3GetVarint(tls, (*TPmaReader)(unsafe.Pointer(p)).FaMap+uintptr((*TPmaReader)(unsafe.Pointer(p)).FiReadOff), pnOut)) } else { iBuf = int32((*TPmaReader)(unsafe.Pointer(p)).FiReadOff % int64((*TPmaReader)(unsafe.Pointer(p)).FnBuffer)) if iBuf != 0 && (*TPmaReader)(unsafe.Pointer(p)).FnBuffer-iBuf >= int32(9) { - *(*Ti64)(unsafe.Pointer(p)) += int64(_sqlite3GetVarint(tls, (*TPmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), pnOut)) + *(*Ti64)(unsafe.Pointer(p)) += libc.Int64FromUint8(_sqlite3GetVarint(tls, (*TPmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), pnOut)) } else { i = 0 - for cond := true; cond; cond = int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))))&int32(0x80) != 0 { + for cond := true; cond; cond = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))))&int32(0x80) != 0 { rc = _vdbePmaReadBlob(tls, p, int32(1), bp+16) if rc != 0 { return rc @@ -79505,7 +75743,6 @@ func _vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uint var iBuf, nRead, pgsz, rc int32 _, _, _, _ = iBuf, nRead, pgsz, rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if _sqlite3FaultSim(tls, int32(201)) != 0 { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } @@ -79521,7 +75758,7 @@ func _vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uint pgsz = (*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fpgsz iBuf = int32((*TPmaReader)(unsafe.Pointer(pReadr)).FiReadOff % int64(pgsz)) if (*TPmaReader)(unsafe.Pointer(pReadr)).FaBuffer == uintptr(0) { - (*TPmaReader)(unsafe.Pointer(pReadr)).FaBuffer = _sqlite3Malloc(tls, uint64(pgsz)) + (*TPmaReader)(unsafe.Pointer(pReadr)).FaBuffer = _sqlite3Malloc(tls, libc.Uint64FromInt32(pgsz)) if (*TPmaReader)(unsafe.Pointer(pReadr)).FaBuffer == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -79573,8 +75810,8 @@ func _vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) (r int32) { rc = _vdbePmaReadVarint(tls, pReadr, bp) } if rc == SQLITE_OK { - (*TPmaReader)(unsafe.Pointer(pReadr)).FnKey = int32(*(*Tu64)(unsafe.Pointer(bp))) - rc = _vdbePmaReadBlob(tls, pReadr, int32(*(*Tu64)(unsafe.Pointer(bp))), pReadr+32) + (*TPmaReader)(unsafe.Pointer(pReadr)).FnKey = libc.Int32FromUint64(*(*Tu64)(unsafe.Pointer(bp))) + rc = _vdbePmaReadBlob(tls, pReadr, libc.Int32FromUint64(*(*Tu64)(unsafe.Pointer(bp))), pReadr+32) } return rc } @@ -79597,15 +75834,11 @@ func _vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart Ti64 var p1 uintptr var _ /* nByte at bp+0 */ Tu64 _, _ = rc, p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _vdbePmaReaderSeek(tls, pTask, pReadr, pFile, iStart) if rc == SQLITE_OK { *(*Tu64)(unsafe.Pointer(bp)) = uint64(0) /* Size of PMA in bytes */ rc = _vdbePmaReadVarint(tls, pReadr, bp) - (*TPmaReader)(unsafe.Pointer(pReadr)).FiEof = int64(uint64((*TPmaReader)(unsafe.Pointer(pReadr)).FiReadOff) + *(*Tu64)(unsafe.Pointer(bp))) + (*TPmaReader)(unsafe.Pointer(pReadr)).FiEof = libc.Int64FromUint64(libc.Uint64FromInt64((*TPmaReader)(unsafe.Pointer(pReadr)).FiReadOff) + *(*Tu64)(unsafe.Pointer(bp))) p1 = pnByte *(*Ti64)(unsafe.Pointer(p1)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p1))) + *(*Tu64)(unsafe.Pointer(bp))) } @@ -79678,11 +75911,11 @@ func _vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p2 = pKey2 v1 = p1 + uintptr(*(*Tu8)(unsafe.Pointer(p1))) /* Pointer to value 1 */ v2 = p2 + uintptr(*(*Tu8)(unsafe.Pointer(p2))) - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*Tu8)(unsafe.Pointer(p1 + 1)))) + *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint32(uint32(*(*Tu8)(unsafe.Pointer(p1 + 1)))) if *(*int32)(unsafe.Pointer(bp)) >= int32(0x80) { _sqlite3GetVarint32(tls, p1+1, bp) } - *(*int32)(unsafe.Pointer(bp + 4)) = int32(uint32(*(*Tu8)(unsafe.Pointer(p2 + 1)))) + *(*int32)(unsafe.Pointer(bp + 4)) = libc.Int32FromUint32(uint32(*(*Tu8)(unsafe.Pointer(p2 + 1)))) if *(*int32)(unsafe.Pointer(bp + 4)) >= int32(0x80) { _sqlite3GetVarint32(tls, p2+1, bp+4) } @@ -79691,16 +75924,15 @@ func _vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, } else { v11 = *(*int32)(unsafe.Pointer(bp + 4)) } - res = libc.Xmemcmp(tls, v1, v2, uint32((v11-int32(13))/int32(2))) + res = libc.Xmemcmp(tls, v1, v2, libc.Uint32FromInt32((v11-int32(13))/int32(2))) if res == 0 { res = *(*int32)(unsafe.Pointer(bp)) - *(*int32)(unsafe.Pointer(bp + 4)) } if res == 0 { - if int32((*TKeyInfo)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FnKeyField) > int32(1) { + if libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FnKeyField) > int32(1) { res = _vdbeSorterCompareTail(tls, pTask, pbKey2Cached, pKey1, nKey1, pKey2, nKey2) } } else { - _ = libc.Int32FromInt32(0) if *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FaSortFlags)) != 0 { res = res * -int32(1) } @@ -79721,25 +75953,23 @@ func _vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p _, _, _, _, _, _, _, _, _, _, _ = i, n, p1, p2, res, s1, s2, v1, v2, v21, v3 p1 = pKey1 p2 = pKey2 - s1 = int32(*(*Tu8)(unsafe.Pointer(p1 + 1))) /* Left hand serial type */ - s2 = int32(*(*Tu8)(unsafe.Pointer(p2 + 1))) /* Right hand serial type */ - v1 = p1 + uintptr(*(*Tu8)(unsafe.Pointer(p1))) /* Pointer to value 1 */ - v2 = p2 + uintptr(*(*Tu8)(unsafe.Pointer(p2))) /* Return value */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + s1 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p1 + 1))) /* Left hand serial type */ + s2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p2 + 1))) /* Right hand serial type */ + v1 = p1 + uintptr(*(*Tu8)(unsafe.Pointer(p1))) /* Pointer to value 1 */ + v2 = p2 + uintptr(*(*Tu8)(unsafe.Pointer(p2))) /* Return value */ if s1 == s2 { n = _aLen[s1] res = 0 i = 0 for { - if !(i < int32(n)) { + if !(i < libc.Int32FromUint8(n)) { break } - v21 = int32(*(*Tu8)(unsafe.Pointer(v1 + uintptr(i)))) - int32(*(*Tu8)(unsafe.Pointer(v2 + uintptr(i)))) + v21 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1 + uintptr(i)))) - libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v2 + uintptr(i)))) res = v21 if v21 != 0 { - if (int32(*(*Tu8)(unsafe.Pointer(v1)))^int32(*(*Tu8)(unsafe.Pointer(v2))))&int32(0x80) != 0 { - if int32(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0 { + if (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))^libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v2))))&int32(0x80) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0 { v3 = -int32(1) } else { v3 = +libc.Int32FromInt32(1) @@ -79766,25 +75996,23 @@ func _vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p res = s1 - s2 } } - _ = libc.Int32FromInt32(0) if res > 0 { - if int32(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0 { res = -int32(1) } } else { - if int32(*(*Tu8)(unsafe.Pointer(v2)))&int32(0x80) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v2)))&int32(0x80) != 0 { res = +libc.Int32FromInt32(1) } } } } if res == 0 { - if int32((*TKeyInfo)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FnKeyField) > int32(1) { + if libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FnKeyField) > int32(1) { res = _vdbeSorterCompareTail(tls, pTask, pbKey2Cached, pKey1, nKey1, pKey2, nKey2) } } else { if *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FaSortFlags)) != 0 { - _ = libc.Int32FromInt32(0) res = res * -int32(1) } } @@ -79831,19 +76059,16 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, mxCache, nWorker, pBt, pKeyInfo, pSorter, pTask, pgsz, rc, sz, szKeyInfo, szPma, v1, v2, v4, v5 /* Size of pSorter in bytes */ rc = SQLITE_OK /* Initialize the upper limit on the number of worker threads */ - if _sqlite3TempInMemory(tls, db) != 0 || int32(_sqlite3Config.FbCoreMutex) == 0 { + if _sqlite3TempInMemory(tls, db) != 0 || libc.Int32FromUint8(_sqlite3Config.FbCoreMutex) == 0 { nWorker = 0 } else { nWorker = *(*int32)(unsafe.Pointer(db + 116 + 11*4)) } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - szKeyInfo = int32(uint32(24) + uint32(int32((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint32(4)) - sz = int32(uint32(132) + uint32(nWorker)*uint32(64)) - pSorter = _sqlite3DbMallocZero(tls, db, uint64(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint32(uint32(24) + libc.Uint32FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint32(4)) + sz = libc.Int32FromUint32(uint32(132) + libc.Uint32FromInt32(nWorker)*uint32(64)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) *(*uintptr)(unsafe.Pointer(pCsr + 36)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -79852,23 +76077,23 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt v1 = pSorter + uintptr(sz) pKeyInfo = v1 (*TVdbeSorter)(unsafe.Pointer(pSorter)).FpKeyInfo = v1 - libc.Xmemcpy(tls, pKeyInfo, (*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, uint32(szKeyInfo)) + libc.Xmemcpy(tls, pKeyInfo, (*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, libc.Uint32FromInt32(szKeyInfo)) (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb = uintptr(0) if nField != 0 && nWorker == 0 { - (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField = uint16(nField) + (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField = libc.Uint16FromInt32(nField) } _sqlite3BtreeEnter(tls, pBt) v2 = _sqlite3BtreeGetPageSize(tls, pBt) pgsz = v2 (*TVdbeSorter)(unsafe.Pointer(pSorter)).Fpgsz = v2 _sqlite3BtreeLeave(tls, pBt) - (*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask = uint8(nWorker + int32(1)) - (*TVdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = uint8(nWorker - libc.Int32FromInt32(1)) - (*TVdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads = libc.BoolUint8(int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > libc.Int32FromInt32(1)) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask = libc.Uint8FromInt32(nWorker + int32(1)) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = libc.Uint8FromInt32(nWorker - libc.Int32FromInt32(1)) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads = libc.BoolUint8(libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > libc.Int32FromInt32(1)) (*TVdbeSorter)(unsafe.Pointer(pSorter)).Fdb = db i = 0 for { - if !(i < int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { + if !(i < libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { break } pTask = pSorter + 68 + uintptr(i)*64 @@ -79880,7 +76105,7 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } if !(_sqlite3TempInMemory(tls, db) != 0) { /* Cache size in bytes*/ szPma = _sqlite3Config.FszPma - (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize = int32(szPma * uint32(pgsz)) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize = libc.Int32FromUint32(szPma * libc.Uint32FromInt32(pgsz)) mxCache = int64((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)).Fcache_size) if mxCache < 0 { /* A negative cache-size value C indicates that the cache is abs(C) @@ -79903,17 +76128,16 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize = v5 /* Avoid large memory allocations if the application has requested ** SQLITE_CONFIG_SMALL_MALLOC. */ - if int32(_sqlite3Config.FbSmallMalloc) == 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(_sqlite3Config.FbSmallMalloc) == 0 { (*TVdbeSorter)(unsafe.Pointer(pSorter)).FnMemory = pgsz - (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = _sqlite3Malloc(tls, uint64(pgsz)) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = _sqlite3Malloc(tls, libc.Uint64FromInt32(pgsz)) if !((*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0) { rc = int32(SQLITE_NOMEM) } } } - if int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) < int32(13) && (*(*uintptr)(unsafe.Pointer(pKeyInfo + 20)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(pKeyInfo + 20)) == (*Tsqlite3)(unsafe.Pointer(db)).FpDfltColl) && int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)))&int32(KEYINFO_ORDER_BIGNULL) == 0 { - (*TVdbeSorter)(unsafe.Pointer(pSorter)).FtypeMask = uint8(libc.Int32FromInt32(SORTER_TYPE_INTEGER) | libc.Int32FromInt32(SORTER_TYPE_TEXT)) + if libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) < int32(13) && (*(*uintptr)(unsafe.Pointer(pKeyInfo + 20)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(pKeyInfo + 20)) == (*Tsqlite3)(unsafe.Pointer(db)).FpDfltColl) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)))&int32(KEYINFO_ORDER_BIGNULL) == 0 { + (*TVdbeSorter)(unsafe.Pointer(pSorter)).FtypeMask = libc.Uint8FromInt32(libc.Int32FromInt32(SORTER_TYPE_INTEGER) | libc.Int32FromInt32(SORTER_TYPE_TEXT)) } } return rc @@ -79954,7 +76178,6 @@ func _vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { if (*TSortSubtask)(unsafe.Pointer(pTask)).Flist.FaMemory != 0 { Xsqlite3_free(tls, (*TSortSubtask)(unsafe.Pointer(pTask)).Flist.FaMemory) } else { - _ = libc.Int32FromInt32(0) _vdbeSorterRecordFree(tls, uintptr(0), (*TSortSubtask)(unsafe.Pointer(pTask)).Flist.FpList) } if (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd != 0 { @@ -79982,7 +76205,6 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(libc.Int32FromInt32(SQLITE_ERROR)) _sqlite3ThreadJoin(tls, (*TSortSubtask)(unsafe.Pointer(pTask)).FpThread, bp) rc = int32(*(*uintptr)(unsafe.Pointer(bp))) - _ = libc.Int32FromInt32(0) (*TSortSubtask)(unsafe.Pointer(pTask)).FbDone = 0 (*TSortSubtask)(unsafe.Pointer(pTask)).FpThread = uintptr(0) } @@ -79995,7 +76217,6 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // ** Launch a background thread to run xTask(pIn). // */ func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) } @@ -80017,7 +76238,7 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { ** is currently attempt to join one of the other threads. To avoid a race ** condition where this thread also attempts to join the same object, join ** thread pSorter->aTask[pSorter->nTask-1].pThread first. */ - i = int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - int32(1) + i = libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - int32(1) for { if !(i >= 0) { break @@ -80049,15 +76270,14 @@ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ - _ = libc.Int32FromInt32(0) for N < nReader { N += N } - nByte = int32(uint32(16) + uint32(N)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(52))) + nByte = libc.Int32FromUint32(uint32(16) + libc.Uint32FromInt32(N)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(52))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, uint64(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) } pNew = v1 if pNew != 0 { @@ -80125,7 +76345,6 @@ func _sqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { var pTask uintptr _, _ = i, pTask _vdbeSorterJoinAll(tls, pSorter, SQLITE_OK) - _ = libc.Int32FromInt32(0) if (*TVdbeSorter)(unsafe.Pointer(pSorter)).FpReader != 0 { _vdbePmaReaderClear(tls, (*TVdbeSorter)(unsafe.Pointer(pSorter)).FpReader) _sqlite3DbFree(tls, db, (*TVdbeSorter)(unsafe.Pointer(pSorter)).FpReader) @@ -80135,7 +76354,7 @@ func _sqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { (*TVdbeSorter)(unsafe.Pointer(pSorter)).FpMerger = uintptr(0) i = 0 for { - if !(i < int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { + if !(i < libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { break } pTask = pSorter + 68 + uintptr(i)*64 @@ -80166,7 +76385,6 @@ func _sqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { func _sqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { var pSorter uintptr _ = pSorter - _ = libc.Int32FromInt32(0) pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 36)) if pSorter != 0 { _sqlite3VdbeSorterReset(tls, db, pSorter) @@ -80266,7 +76484,6 @@ func _vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) (r u *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pp = bp *(*int32)(unsafe.Pointer(bp + 4)) = 0 - _ = libc.Int32FromInt32(0) for { res = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TSortSubtask)(unsafe.Pointer(pTask)).FxCompare})))(tls, pTask, bp+4, p1+libc.UintptrFromInt32(1)*8, (*TSorterRecord)(unsafe.Pointer(p1)).FnVal, p2+libc.UintptrFromInt32(1)*8, (*TSorterRecord)(unsafe.Pointer(p2)).FnVal) if res <= 0 { @@ -80300,10 +76517,10 @@ func _vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) (r u // ** sorter object passed as the only argument. // */ func _vdbeSorterGetCompare(tls *libc.TLS, p uintptr) (r TSorterCompare) { - if int32((*TVdbeSorter)(unsafe.Pointer(p)).FtypeMask) == int32(SORTER_TYPE_INTEGER) { + if libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(p)).FtypeMask) == int32(SORTER_TYPE_INTEGER) { return __ccgo_fp(_vdbeSorterCompareInt) } else { - if int32((*TVdbeSorter)(unsafe.Pointer(p)).FtypeMask) == int32(SORTER_TYPE_TEXT) { + if libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(p)).FtypeMask) == int32(SORTER_TYPE_TEXT) { return __ccgo_fp(_vdbeSorterCompareText) } } @@ -80336,7 +76553,6 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { if p == (*TSorterList)(unsafe.Pointer(pList)).FaMemory { pNext = uintptr(0) } else { - _ = libc.Int32FromInt32(0) pNext = (*TSorterList)(unsafe.Pointer(pList)).FaMemory + uintptr(*(*int32)(unsafe.Pointer(p + 4))) } } else { @@ -80361,7 +76577,7 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { p = uintptr(0) i = 0 for { - if !(i < int32(libc.Uint32FromInt64(256)/libc.Uint32FromInt64(4))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(256)/libc.Uint32FromInt64(4))) { break } if (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] == uintptr(0) { @@ -80379,8 +76595,7 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { i++ } (*TSorterList)(unsafe.Pointer(pList)).FpList = p - _ = libc.Int32FromInt32(0) - return int32((*TUnpackedRecord)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode) + return libc.Int32FromUint8((*TUnpackedRecord)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode) } // C documentation @@ -80392,7 +76607,7 @@ func _vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStar var v1 int32 _ = v1 libc.Xmemset(tls, p, 0, uint32(32)) - (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer = _sqlite3Malloc(tls, uint64(nBuf)) + (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer = _sqlite3Malloc(tls, libc.Uint64FromInt32(nBuf)) if !((*TPmaWriter)(unsafe.Pointer(p)).FaBuffer != 0) { (*TPmaWriter)(unsafe.Pointer(p)).FeFWErr = int32(SQLITE_NOMEM) } else { @@ -80420,7 +76635,7 @@ func _vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { if nCopy > (*TPmaWriter)(unsafe.Pointer(p)).FnBuffer-(*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd { nCopy = (*TPmaWriter)(unsafe.Pointer(p)).FnBuffer - (*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd } - libc.Xmemcpy(tls, (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd), pData+uintptr(nData-nRem), uint32(nCopy)) + libc.Xmemcpy(tls, (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd), pData+uintptr(nData-nRem), libc.Uint32FromInt32(nCopy)) *(*int32)(unsafe.Pointer(p + 16)) += nCopy if (*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd == (*TPmaWriter)(unsafe.Pointer(p)).FnBuffer { (*TPmaWriter)(unsafe.Pointer(p)).FeFWErr = _sqlite3OsWrite(tls, (*TPmaWriter)(unsafe.Pointer(p)).FpFd, (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*TPmaWriter)(unsafe.Pointer(p)).FiBufStart), (*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd-(*TPmaWriter)(unsafe.Pointer(p)).FiBufStart, (*TPmaWriter)(unsafe.Pointer(p)).FiWriteOff+int64((*TPmaWriter)(unsafe.Pointer(p)).FiBufStart)) @@ -80429,7 +76644,6 @@ func _vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { (*TPmaWriter)(unsafe.Pointer(p)).FiBufStart = v1 *(*Ti64)(unsafe.Pointer(p + 20)) += int64((*TPmaWriter)(unsafe.Pointer(p)).FnBuffer) } - _ = libc.Int32FromInt32(0) nRem -= nCopy } } @@ -80500,13 +76714,9 @@ func _vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) db = (*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb rc = SQLITE_OK /* Object used to write to the file */ libc.Xmemset(tls, bp, 0, uint32(32)) - _ = libc.Int32FromInt32(0) /* If the first temporary PMA file has not been opened, open it now. */ if (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd == uintptr(0) { rc = _vdbeSorterOpenTempFile(tls, db, 0, pTask+40) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } /* Try to get the file to memory map */ if rc == SQLITE_OK { @@ -80520,14 +76730,14 @@ func _vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) pNext = uintptr(0) _vdbePmaWriterInit(tls, (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd, bp, (*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fpgsz, (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile.FiEof) (*TSortSubtask)(unsafe.Pointer(pTask)).FnPMA++ - _vdbePmaWriteVarint(tls, bp, uint64((*TSorterList)(unsafe.Pointer(pList)).FszPMA)) + _vdbePmaWriteVarint(tls, bp, libc.Uint64FromInt64((*TSorterList)(unsafe.Pointer(pList)).FszPMA)) p = (*TSorterList)(unsafe.Pointer(pList)).FpList for { if !(p != 0) { break } pNext = *(*uintptr)(unsafe.Pointer(p + 4)) - _vdbePmaWriteVarint(tls, bp, uint64((*TSorterRecord)(unsafe.Pointer(p)).FnVal)) + _vdbePmaWriteVarint(tls, bp, libc.Uint64FromInt32((*TSorterRecord)(unsafe.Pointer(p)).FnVal)) _vdbePmaWriteBlob(tls, bp, p+libc.UintptrFromInt32(1)*8, (*TSorterRecord)(unsafe.Pointer(p)).FnVal) if (*TSorterList)(unsafe.Pointer(pList)).FaMemory == uintptr(0) { Xsqlite3_free(tls, p) @@ -80540,8 +76750,6 @@ func _vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) (*TSorterList)(unsafe.Pointer(pList)).FpList = p rc = _vdbePmaWriterFinish(tls, bp, pTask+40+4) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return rc } @@ -80620,7 +76828,7 @@ func _vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) (r int3 *(*int32)(unsafe.Pointer(pbEof)) = libc.BoolInt32((*(*TPmaReader)(unsafe.Pointer((*TMergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*TMergeEngine)(unsafe.Pointer(pMerger)).FaTree + 1*4)))*52))).FpFd == uintptr(0)) } if rc == SQLITE_OK { - v2 = int32((*TUnpackedRecord)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode) + v2 = libc.Int32FromUint8((*TUnpackedRecord)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode) } else { v2 = rc } @@ -80637,7 +76845,6 @@ func _vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) (r uintptr) { var rc int32 _, _ = pTask, rc pTask = pCtx /* Return code */ - _ = libc.Int32FromInt32(0) rc = _vdbeSorterListToPMA(tls, pTask, pTask+20) (*TSortSubtask)(unsafe.Pointer(pTask)).FbDone = int32(1) return uintptr(rc) @@ -80655,7 +76862,7 @@ func _vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) (r int32) { _, _, _, _, _, _, _ = aMem, i, iTest, nWorker, pCtx, pTask, rc rc = SQLITE_OK pTask = uintptr(0) /* Thread context used to create new PMA */ - nWorker = int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - int32(1) + nWorker = libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - int32(1) /* Set the flag to indicate that at least one PMA has been written. ** Or will be, anyhow. */ (*TVdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA = uint8(1) @@ -80672,7 +76879,7 @@ func _vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) (r int32) { if !(i < nWorker) { break } - iTest = (int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FiPrev) + i + int32(1)) % nWorker + iTest = (libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FiPrev) + i + int32(1)) % nWorker pTask = pSorter + 68 + uintptr(iTest)*64 if (*TSortSubtask)(unsafe.Pointer(pTask)).FbDone != 0 { rc = _vdbeSorterJoinThread(tls, pTask) @@ -80690,13 +76897,9 @@ func _vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) (r int32) { /* Use the foreground thread for this operation */ rc = _vdbeSorterListToPMA(tls, pSorter+68+uintptr(nWorker)*64, pSorter+36) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) aMem = (*TSortSubtask)(unsafe.Pointer(pTask)).Flist.FaMemory pCtx = pTask - (*TVdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = uint8((int32(pTask) - t__predefined_ptrdiff_t(pSorter+68)) / 64) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = libc.Uint8FromInt32((int32(pTask) - t__predefined_ptrdiff_t(pSorter+68)) / 64) (*TSortSubtask)(unsafe.Pointer(pTask)).Flist = (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = uintptr(0) (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA = 0 @@ -80705,7 +76908,7 @@ func _vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) (r int32) { (*TVdbeSorter)(unsafe.Pointer(pSorter)).FnMemory = _sqlite3MallocSize(tls, aMem) } else { if (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0 { - (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = _sqlite3Malloc(tls, uint64((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnMemory)) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = _sqlite3Malloc(tls, libc.Uint64FromInt32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnMemory)) if !((*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0) { return int32(SQLITE_NOMEM) } @@ -80732,9 +76935,8 @@ func _sqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) (r int32 var _ /* t at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, bFlush, iListOff, nMin, nNew, nPMA, nReq, pNew, pSorter, rc, p1, p2, p3 rc = SQLITE_OK /* serial type of first record field */ - _ = libc.Int32FromInt32(0) pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 36)) - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*Tu8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVal)).Fz + 1)))) + *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint32(uint32(*(*Tu8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVal)).Fz + 1)))) if *(*int32)(unsafe.Pointer(bp)) >= int32(0x80) { _sqlite3GetVarint32(tls, (*TMem)(unsafe.Pointer(pVal)).Fz+1, bp) } @@ -80749,7 +76951,6 @@ func _sqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) (r int32 (*TVdbeSorter)(unsafe.Pointer(pSorter)).FtypeMask = uint8(0) } } - _ = libc.Int32FromInt32(0) /* Figure out whether or not the current contents of memory should be ** flushed to a PMA before continuing. If so, do so. ** @@ -80766,8 +76967,8 @@ func _sqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) (r int32 ** * The total memory allocated for the in-memory list is greater ** than (page-size * 10) and sqlite3HeapNearlyFull() returns true. */ - nReq = int64(uint32((*TMem)(unsafe.Pointer(pVal)).Fn) + uint32(8)) - nPMA = int64((*TMem)(unsafe.Pointer(pVal)).Fn + _sqlite3VarintLen(tls, uint64((*TMem)(unsafe.Pointer(pVal)).Fn))) + nReq = libc.Int64FromUint32(libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pVal)).Fn) + uint32(8)) + nPMA = int64((*TMem)(unsafe.Pointer(pVal)).Fn + _sqlite3VarintLen(tls, libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pVal)).Fn))) if (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize != 0 { if (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0 { bFlush = libc.BoolInt32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FiMemory != 0 && int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).FiMemory)+nReq > int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize)) @@ -80778,7 +76979,6 @@ func _sqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) (r int32 rc = _vdbeSorterFlushPMA(tls, pSorter) (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA = 0 (*TVdbeSorter)(unsafe.Pointer(pSorter)).FiMemory = 0 - _ = libc.Int32FromInt32(0) } } (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA += nPMA @@ -80802,7 +77002,7 @@ func _sqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) (r int32 if nNew < int64(nMin) { nNew = int64(nMin) } - aNew = _sqlite3Realloc(tls, (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory, uint64(nNew)) + aNew = _sqlite3Realloc(tls, (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory, libc.Uint64FromInt64(nNew)) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -80819,13 +77019,13 @@ func _sqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) (r int32 *(*int32)(unsafe.Pointer(pNew + 4)) = int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList) - int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory) } } else { - pNew = _sqlite3Malloc(tls, uint64(nReq)) + pNew = _sqlite3Malloc(tls, libc.Uint64FromInt64(nReq)) if pNew == uintptr(0) { return int32(SQLITE_NOMEM) } *(*uintptr)(unsafe.Pointer(pNew + 4)) = (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList } - libc.Xmemcpy(tls, pNew+libc.UintptrFromInt32(1)*8, (*TMem)(unsafe.Pointer(pVal)).Fz, uint32((*TMem)(unsafe.Pointer(pVal)).Fn)) + libc.Xmemcpy(tls, pNew+libc.UintptrFromInt32(1)*8, (*TMem)(unsafe.Pointer(pVal)).Fz, libc.Uint32FromInt32((*TMem)(unsafe.Pointer(pVal)).Fn)) (*TSorterRecord)(unsafe.Pointer(pNew)).FnVal = (*TMem)(unsafe.Pointer(pVal)).Fn (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = pNew return rc @@ -80852,7 +77052,6 @@ func _vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) (r int32) { pOut = pIncr + 28 + 1*12 pTask = (*TIncrMerger)(unsafe.Pointer(pIncr)).FpTask pMerger = (*TIncrMerger)(unsafe.Pointer(pIncr)).FpMerger - _ = libc.Int32FromInt32(0) _vdbePmaWriterInit(tls, (*TSorterFile)(unsafe.Pointer(pOut)).FpFd, bp, (*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fpgsz, iStart) for rc == SQLITE_OK { pReader = (*TMergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*TMergeEngine)(unsafe.Pointer(pMerger)).FaTree + 1*4)))*52 @@ -80863,13 +77062,12 @@ func _vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) (r int32) { if (*TPmaReader)(unsafe.Pointer(pReader)).FpFd == uintptr(0) { break } - if iEof+int64(nKey)+int64(_sqlite3VarintLen(tls, uint64(nKey))) > iStart+int64((*TIncrMerger)(unsafe.Pointer(pIncr)).FmxSz) { + if iEof+int64(nKey)+int64(_sqlite3VarintLen(tls, libc.Uint64FromInt32(nKey))) > iStart+int64((*TIncrMerger)(unsafe.Pointer(pIncr)).FmxSz) { break } /* Write the next key to the output. */ - _vdbePmaWriteVarint(tls, bp, uint64(nKey)) + _vdbePmaWriteVarint(tls, bp, libc.Uint64FromInt32(nKey)) _vdbePmaWriteBlob(tls, bp, (*TPmaReader)(unsafe.Pointer(pReader)).FaKey, nKey) - _ = libc.Int32FromInt32(0) rc = _vdbeMergeEngineStep(tls, (*TIncrMerger)(unsafe.Pointer(pIncr)).FpMerger, bp+32) } rc2 = _vdbePmaWriterFinish(tls, bp, pOut+4) @@ -80903,7 +77101,6 @@ func _vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) (r int32) { var p uintptr _ = p p = pIncr - _ = libc.Int32FromInt32(0) return _vdbeSorterCreateThread(tls, (*TIncrMerger)(unsafe.Pointer(pIncr)).FpTask, __ccgo_fp(_vdbeIncrPopulateThread), p) } @@ -80990,7 +77187,6 @@ func _vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uin _vdbeMergeEngineFree(tls, pMerger) rc = int32(SQLITE_NOMEM) } - _ = libc.Int32FromInt32(0) return rc } @@ -81018,7 +77214,6 @@ func _vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { var p1, p2, pTask uintptr var _ /* bCached at bp+0 */ int32 _, _, _, _, _, _, _ = i1, i2, iRes, p1, p2, pTask, res - _ = libc.Int32FromInt32(0) if iOut >= (*TMergeEngine)(unsafe.Pointer(pMerger)).FnTree/int32(2) { i1 = (iOut - (*TMergeEngine)(unsafe.Pointer(pMerger)).FnTree/int32(2)) * int32(2) i2 = i1 + int32(1) @@ -81036,7 +77231,7 @@ func _vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { } else { pTask = (*TMergeEngine)(unsafe.Pointer(pMerger)).FpTask *(*int32)(unsafe.Pointer(bp)) = 0 - _ = libc.Int32FromInt32(0) /* from vdbeSortSubtaskMain() */ + /* from vdbeSortSubtaskMain() */ res = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TSortSubtask)(unsafe.Pointer(pTask)).FxCompare})))(tls, pTask, bp, (*TPmaReader)(unsafe.Pointer(p1)).FaKey, (*TPmaReader)(unsafe.Pointer(p1)).FnKey, (*TPmaReader)(unsafe.Pointer(p2)).FaKey, (*TPmaReader)(unsafe.Pointer(p2)).FnKey) if res <= 0 { iRes = i1 @@ -81074,11 +77269,8 @@ func _vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode i rc = SQLITE_OK /* Number of subtrees to merge */ /* Failure to allocate the merge would have been detected prior to ** invoking this routine */ - _ = libc.Int32FromInt32(0) /* eMode is always INCRINIT_NORMAL in single-threaded mode */ - _ = libc.Int32FromInt32(0) /* Verify that the MergeEngine is assigned to a single thread */ - _ = libc.Int32FromInt32(0) (*TMergeEngine)(unsafe.Pointer(pMerger)).FpTask = pTask nTree = (*TMergeEngine)(unsafe.Pointer(pMerger)).FnTree i = 0 @@ -81117,7 +77309,7 @@ func _vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode i ; i-- } - return int32((*TUnpackedRecord)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode) + return libc.Int32FromUint8((*TUnpackedRecord)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode) } // C documentation @@ -81164,7 +77356,6 @@ func _vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) (r pTask = (*TIncrMerger)(unsafe.Pointer(pIncr)).FpTask db = (*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb /* eMode is always INCRINIT_NORMAL in single-threaded mode */ - _ = libc.Int32FromInt32(0) rc = _vdbeMergeEngineInit(tls, pTask, (*TIncrMerger)(unsafe.Pointer(pIncr)).FpMerger, eMode) /* Set up the required files for pIncr. A multi-threaded IncrMerge object ** requires two temp files to itself, whereas a single-threaded object @@ -81179,7 +77370,6 @@ func _vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) (r } else { /*if( !pIncr->bUseThread )*/ if (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd == uintptr(0) { - _ = libc.Int32FromInt32(0) rc = _vdbeSorterOpenTempFile(tls, db, (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof, pTask+52) (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof = 0 } @@ -81201,7 +77391,6 @@ func _vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) (r ** control to the VDBE or proceed with anything useful until the ** first results are ready from this merger object anyway. */ - _ = libc.Int32FromInt32(0) rc = _vdbeIncrPopulate(tls, pIncr) } if rc == SQLITE_OK && (libc.Bool(false) || eMode != int32(INCRINIT_TASK)) { @@ -81245,7 +77434,6 @@ func _vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) (r int32 pIncr = (*TPmaReader)(unsafe.Pointer(pReadr)).FpIncr /* Incremental merger */ rc = SQLITE_OK /* Return code */ if pIncr != 0 { - _ = libc.Int32FromInt32(0) if (*TIncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 { pCtx = pReadr rc = _vdbeSorterCreateThread(tls, (*TIncrMerger)(unsafe.Pointer(pIncr)).FpTask, __ccgo_fp(_vdbePmaReaderBgIncrInit), pCtx) @@ -81424,20 +77612,18 @@ func _vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) (r /* If the sorter uses more than one task, then create the top-level ** MergeEngine here. This MergeEngine will read data from exactly ** one PmaReader per sub-task. */ - _ = libc.Int32FromInt32(0) - if int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > int32(1) { - pMain = _vdbeMergeEngineNew(tls, int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) + if libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > int32(1) { + pMain = _vdbeMergeEngineNew(tls, libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) if pMain == uintptr(0) { rc = int32(SQLITE_NOMEM) } } iTask = 0 for { - if !(rc == SQLITE_OK && iTask < int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { + if !(rc == SQLITE_OK && iTask < libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { break } pTask = pSorter + 68 + uintptr(iTask)*64 - _ = libc.Int32FromInt32(0) if libc.Bool(false) || (*TSortSubtask)(unsafe.Pointer(pTask)).FnPMA != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Root node of tree for this task */ nDepth = _vdbeSorterTreeDepth(tls, (*TSortSubtask)(unsafe.Pointer(pTask)).FnPMA) @@ -81478,7 +77664,6 @@ func _vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) (r if pMain != uintptr(0) { rc = _vdbeIncrMergerNew(tls, pTask, *(*uintptr)(unsafe.Pointer(bp)), (*TMergeEngine)(unsafe.Pointer(pMain)).FaReadr+uintptr(iTask)*52+48) } else { - _ = libc.Int32FromInt32(0) pMain = *(*uintptr)(unsafe.Pointer(bp)) } } else { @@ -81523,7 +77708,7 @@ func _vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) (r int32) { xCompare = _vdbeSorterGetCompare(tls, pSorter) i = 0 for { - if !(i < int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { + if !(i < libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { break } (*(*TSortSubtask)(unsafe.Pointer(pSorter + 68 + uintptr(i)*64))).FxCompare = xCompare @@ -81534,10 +77719,9 @@ func _vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) (r int32) { } rc = _vdbeSorterMergeTreeBuild(tls, pSorter, bp) if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) if (*TVdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads != 0 { pReadr = uintptr(0) - pLast = pSorter + 68 + uintptr(int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)-int32(1))*64 + pLast = pSorter + 68 + uintptr(libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)-int32(1))*64 rc = _vdbeSortAllocUnpacked(tls, pLast) if rc == SQLITE_OK { pReadr = _sqlite3DbMallocZero(tls, db, uint64(52)) @@ -81552,14 +77736,13 @@ func _vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) (r int32) { _vdbeIncrMergerSetThreads(tls, (*TPmaReader)(unsafe.Pointer(pReadr)).FpIncr) iTask = 0 for { - if !(iTask < int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)-int32(1)) { + if !(iTask < libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)-int32(1)) { break } v3 = (*(*TPmaReader)(unsafe.Pointer((*TMergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaReadr + uintptr(iTask)*52))).FpIncr pIncr = v3 if v3 != 0 { _vdbeIncrMergerSetThreads(tls, pIncr) - _ = libc.Int32FromInt32(0) } goto _2 _2: @@ -81568,7 +77751,7 @@ func _vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) (r int32) { } iTask = 0 for { - if !(rc == SQLITE_OK && iTask < int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { + if !(rc == SQLITE_OK && iTask < libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FnTask)) { break } /* Check that: @@ -81581,7 +77764,6 @@ func _vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) (r int32) { ** object. */ p = (*TMergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaReadr + uintptr(iTask)*52 - _ = libc.Int32FromInt32(0) rc = _vdbePmaReaderIncrInit(tls, p, int32(INCRINIT_TASK)) goto _4 _4: @@ -81618,13 +77800,11 @@ func _sqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) (r int var rc int32 _, _ = pSorter, rc rc = SQLITE_OK /* Return code */ - _ = libc.Int32FromInt32(0) pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 36)) - _ = libc.Int32FromInt32(0) /* If no data has been written to disk, then do not do so now. Instead, ** sort the VdbeSorter.pRecord list. The vdbe layer will read data directly ** from the in-memory list. */ - if int32((*TVdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA) == 0 { + if libc.Int32FromUint8((*TVdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA) == 0 { if (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 { *(*int32)(unsafe.Pointer(pbEof)) = 0 rc = _vdbeSorterSort(tls, pSorter+68, pSorter+36) @@ -81637,13 +77817,11 @@ func _sqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) (r int ** function flushes the contents of memory to disk, it immediately always ** creates a new list consisting of a single key immediately afterwards. ** So the list is never empty at this point. */ - _ = libc.Int32FromInt32(0) rc = _vdbeSorterFlushPMA(tls, pSorter) /* Join all threads */ rc = _vdbeSorterJoinAll(tls, pSorter, rc) /* Assuming no errors have occurred, set up a merger structure to ** incrementally read and merge all remaining PMAs. */ - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK { rc = _vdbeSorterSetupMerge(tls, pSorter) *(*int32)(unsafe.Pointer(pbEof)) = 0 @@ -81667,13 +77845,8 @@ func _sqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) (r int32) { var rc, v1 int32 var _ /* res at bp+0 */ int32 _, _, _, _ = pFree, pSorter, rc, v1 /* Return code */ - _ = libc.Int32FromInt32(0) pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 36)) - _ = libc.Int32FromInt32(0) if (*TVdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TVdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads != 0 { rc = _vdbePmaReaderNext(tls, (*TVdbeSorter)(unsafe.Pointer(pSorter)).FpReader) if rc == SQLITE_OK && (*TPmaReader)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer(pSorter)).FpReader)).FpFd == uintptr(0) { @@ -81682,8 +77855,6 @@ func _sqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) (r int32) { } else { /*if( !pSorter->bUseThreads )*/ *(*int32)(unsafe.Pointer(bp)) = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) rc = _vdbeMergeEngineStep(tls, (*TVdbeSorter)(unsafe.Pointer(pSorter)).FpMerger, bp) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) != 0 { rc = int32(SQLITE_DONE) @@ -81742,15 +77913,14 @@ func _sqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) (r int3 var pKey, pSorter uintptr var _ /* nKey at bp+0 */ int32 _, _ = pKey, pSorter /* Sorter key to copy into pOut */ - _ = libc.Int32FromInt32(0) pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 36)) pKey = _vdbeSorterRowkey(tls, pSorter, bp) if _sqlite3VdbeMemClearAndResize(tls, pOut, *(*int32)(unsafe.Pointer(bp))) != 0 { return int32(SQLITE_NOMEM) } (*TMem)(unsafe.Pointer(pOut)).Fn = *(*int32)(unsafe.Pointer(bp)) - (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Blob)) - libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pOut)).Fz, pKey, uint32(*(*int32)(unsafe.Pointer(bp)))) + (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Blob)) + libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pOut)).Fz, pKey, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) return SQLITE_OK } @@ -81779,7 +77949,6 @@ func _sqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCo var pKey, pKeyInfo, pSorter, r2, v1 uintptr var _ /* nKey at bp+0 */ int32 _, _, _, _, _, _ = i, pKey, pKeyInfo, pSorter, r2, v1 /* Sorter key to compare pVal with */ - _ = libc.Int32FromInt32(0) pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 36)) r2 = (*TVdbeSorter)(unsafe.Pointer(pSorter)).FpUnpacked pKeyInfo = (*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo @@ -81790,9 +77959,8 @@ func _sqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCo if r2 == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TUnpackedRecord)(unsafe.Pointer(r2)).FnField = uint16(nKeyCol) + (*TUnpackedRecord)(unsafe.Pointer(r2)).FnField = libc.Uint16FromInt32(nKeyCol) } - _ = libc.Int32FromInt32(0) pKey = _vdbeSorterRowkey(tls, pSorter, bp) _sqlite3VdbeRecordUnpack(tls, pKeyInfo, *(*int32)(unsafe.Pointer(bp)), pKey, r2) i = 0 @@ -81800,7 +77968,7 @@ func _sqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCo if !(i < nKeyCol) { break } - if int32((*(*TMem)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(r2)).FaMem + uintptr(i)*40))).Fflags)&int32(MEM_Null) != 0 { + if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer((*TUnpackedRecord)(unsafe.Pointer(r2)).FaMem + uintptr(i)*40))).Fflags)&int32(MEM_Null) != 0 { *(*int32)(unsafe.Pointer(pRes)) = -int32(1) return SQLITE_OK } @@ -81962,7 +78130,6 @@ func _memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst T if int64(iAmt)+iOfst > (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) } - _ = libc.Int32FromInt32(0) if (*TMemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset != iOfst || iOfst == 0 { iOff = 0 pChunk = (*TMemJournal)(unsafe.Pointer(p)).FpFirst @@ -81978,7 +78145,6 @@ func _memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst T } } else { pChunk = (*TMemJournal)(unsafe.Pointer(p)).Freadpoint.FpChunk - _ = libc.Int32FromInt32(0) } iChunkOffset = int32(iOfst % int64((*TMemJournal)(unsafe.Pointer(p)).FnChunkSize)) for { @@ -81989,7 +78155,7 @@ func _memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst T v5 = (*TMemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset } nCopy = v5 - libc.Xmemcpy(tls, zOut, pChunk+4+uintptr(iChunkOffset), uint32(nCopy)) + libc.Xmemcpy(tls, zOut, pChunk+4+uintptr(iChunkOffset), libc.Uint32FromInt32(nCopy)) zOut += uintptr(nCopy) nRead -= iSpace iChunkOffset = 0 @@ -82114,13 +78280,11 @@ func _memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst ** the in-memory journal is being used by a connection using the ** atomic-write optimization. In this case the first 28 bytes of the ** journal file may be written as part of committing the transaction. */ - _ = libc.Int32FromInt32(0) if iOfst > 0 && iOfst != (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset { _memjrnlTruncate(tls, pJfd, iOfst) } if iOfst == 0 && (*TMemJournal)(unsafe.Pointer(p)).FpFirst != 0 { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TMemJournal)(unsafe.Pointer(p)).FpFirst+4, zBuf, uint32(iAmt)) + libc.Xmemcpy(tls, (*TMemJournal)(unsafe.Pointer(p)).FpFirst+4, zBuf, libc.Uint32FromInt32(iAmt)) } else { for nWrite > 0 { pChunk = (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk @@ -82131,27 +78295,23 @@ func _memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst v1 = (*TMemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset } iSpace = v1 - _ = libc.Int32FromInt32(0) if iChunkOffset == 0 { /* New chunk is required to extend the file. */ - pNew = Xsqlite3_malloc(tls, int32(libc.Uint32FromInt64(12)+uint32((*TMemJournal)(unsafe.Pointer(p)).FnChunkSize-libc.Int32FromInt32(8)))) + pNew = Xsqlite3_malloc(tls, libc.Int32FromUint32(libc.Uint32FromInt64(12)+libc.Uint32FromInt32((*TMemJournal)(unsafe.Pointer(p)).FnChunkSize-libc.Int32FromInt32(8)))) if !(pNew != 0) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) } (*TFileChunk)(unsafe.Pointer(pNew)).FpNext = uintptr(0) if pChunk != 0 { - _ = libc.Int32FromInt32(0) (*TFileChunk)(unsafe.Pointer(pChunk)).FpNext = pNew } else { - _ = libc.Int32FromInt32(0) (*TMemJournal)(unsafe.Pointer(p)).FpFirst = pNew } v2 = pNew (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk = v2 pChunk = v2 } - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, pChunk+4+uintptr(iChunkOffset), zWrite, uint32(iSpace)) + libc.Xmemcpy(tls, pChunk+4+uintptr(iChunkOffset), zWrite, libc.Uint32FromInt32(iSpace)) zWrite += uintptr(iSpace) nWrite -= iSpace (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset += int64(iSpace) @@ -82171,7 +78331,6 @@ func _memjrnlTruncate(tls *libc.TLS, pJfd uintptr, size Tsqlite_int64) (r int32) var p, pIter uintptr _, _, _ = iOff, p, pIter p = pJfd - _ = libc.Int32FromInt32(0) if size < (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset { pIter = uintptr(0) if size == 0 { @@ -82280,7 +78439,6 @@ func _sqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintpt var p uintptr _ = p p = pJfd - _ = libc.Int32FromInt32(0) /* Zero the file-handle object. If nSpill was passed zero, initialize ** it using the sqlite3OsOpen() function of the underlying VFS. In this ** case none of the code in this module is executed as a result of calls @@ -82292,8 +78450,7 @@ func _sqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintpt if nSpill > 0 { (*TMemJournal)(unsafe.Pointer(p)).FnChunkSize = nSpill } else { - (*TMemJournal)(unsafe.Pointer(p)).FnChunkSize = int32(uint32(libc.Int32FromInt32(8)+libc.Int32FromInt32(MEMJOURNAL_DFLT_FILECHUNKSIZE)) - libc.Uint32FromInt64(12)) - _ = libc.Int32FromInt32(0) + (*TMemJournal)(unsafe.Pointer(p)).FnChunkSize = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(8)+libc.Int32FromInt32(MEMJOURNAL_DFLT_FILECHUNKSIZE)) - libc.Uint32FromInt64(12)) } (*Tsqlite3_file)(unsafe.Pointer(pJfd)).FpMethods = uintptr(unsafe.Pointer(&_MemJournalMethods)) (*TMemJournal)(unsafe.Pointer(p)).FnSpill = nSpill @@ -82435,18 +78592,15 @@ func _sqlite3WalkExprNN(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if rc != 0 { return rc & int32(WRC_Abort) } - if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) != libc.Uint32FromInt32(0)) { - _ = libc.Int32FromInt32(0) + if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) != libc.Uint32FromInt32(0)) { if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && _sqlite3WalkExprNN(tls, pWalker, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) != 0 { return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pExpr)).FpRight != 0 { - _ = libc.Int32FromInt32(0) pExpr = (*TExpr)(unsafe.Pointer(pExpr)).FpRight continue } else { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { - _ = libc.Int32FromInt32(0) if _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20))) != 0 { return int32(WRC_Abort) } @@ -82456,7 +78610,7 @@ func _sqlite3WalkExprNN(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) return int32(WRC_Abort) } } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { if _walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)), int32(1)) != 0 { return int32(WRC_Abort) } @@ -82558,7 +78712,7 @@ func _sqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) v1 = (*TWalker)(unsafe.Pointer(pWalker)).FpParse pParse = v1 } - if v2 || v1 != uintptr(0) && int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) || (*TWalker)(unsafe.Pointer(pWalker)).FxSelectCallback2 == __ccgo_fp(_sqlite3SelectPopWith) { + if v2 || v1 != uintptr(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) || (*TWalker)(unsafe.Pointer(pWalker)).FxSelectCallback2 == __ccgo_fp(_sqlite3SelectPopWith) { /* The following may return WRC_Abort if there are unresolvable ** symbols (e.g. a table that does not exist) in a window definition. */ rc = _walkWindowList(tls, pWalker, (*TSelect)(unsafe.Pointer(p)).FpWinDefn, 0) @@ -82734,7 +78888,7 @@ func _sqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) (r func _incrAggDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { var p1 uintptr _ = p1 - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) { p1 = pExpr + 2 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) + *(*int32)(unsafe.Pointer(pWalker + 24))) } @@ -82780,10 +78934,7 @@ func _resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pE var db, pDup, pOrig uintptr var _ /* temp at bp+0 */ TExpr _, _, _ = db, pDup, pOrig /* The database connection */ - _ = libc.Int32FromInt32(0) pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(iCol)*20))).FpExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo != 0 { return } @@ -82794,14 +78945,13 @@ func _resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pE pDup = uintptr(0) } else { _incrAggFunctionDepth(tls, pDup, nSubquery) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLLATE) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLLATE) { pDup = _sqlite3ExprAddCollateString(tls, pParse, pDup, *(*uintptr)(unsafe.Pointer(pExpr + 8))) } libc.Xmemcpy(tls, bp, pDup, uint32(52)) libc.Xmemcpy(tls, pDup, pExpr, uint32(52)) libc.Xmemcpy(tls, pExpr, bp, uint32(52)) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { if *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)) != uintptr(0) { (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FpOwner = pExpr } @@ -82837,7 +78987,6 @@ func _sqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr if eEName != int32(ENAME_TAB) && (eEName != int32(ENAME_ROWID) || pbRowid == uintptr(0)) { return 0 } - _ = libc.Int32FromInt32(0) zSpan = (*TExprList_item)(unsafe.Pointer(pItem)).FzEName n = 0 for { @@ -82915,20 +79064,17 @@ func _sqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) (r TBitmask) { var v1 uint64 _, _, _ = n, pExTab, v1 n = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - _ = libc.Int32FromInt32(0) pExTab = (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TTable)(unsafe.Pointer(pExTab)).FtabFlags&uint32(TF_HasGenerated) != uint32(0) && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pExTab)).FaCol + uintptr(n)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - if int32((*TTable)(unsafe.Pointer(pExTab)).FnCol) >= int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - v1 = uint64(-libc.Int32FromInt32(1)) + if (*TTable)(unsafe.Pointer(pExTab)).FtabFlags&uint32(TF_HasGenerated) != uint32(0) && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pExTab)).FaCol + uintptr(n)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if int32((*TTable)(unsafe.Pointer(pExTab)).FnCol) >= libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { + v1 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { v1 = libc.Uint64FromInt32(1)<<(*TTable)(unsafe.Pointer(pExTab)).FnCol - uint64(1) } return v1 } else { - if n >= int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - n = int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) + if n >= libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { + n = libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) } return libc.Uint64FromInt32(1) << n } @@ -82951,8 +79097,7 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt (*TExpr)(unsafe.Pointer(pNew)).FiTable = (*TSrcItem)(unsafe.Pointer(pMatch)).FiCursor (*TExpr)(unsafe.Pointer(pNew)).FiColumn = iColumn (*TExpr)(unsafe.Pointer(pNew)).Fy.FpTab = (*TSrcItem)(unsafe.Pointer(pMatch)).FpTab - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(pNew + 4)) |= uint32(libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) *(*uintptr)(unsafe.Pointer(ppList)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(ppList)), pNew) } } @@ -82962,11 +79107,9 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt // /* // ** Return TRUE (non-zero) if zTab is a valid name for the schema table pTab. // */ -func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, pSchema uintptr) (r int32) { +func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6589, int32(7)) != 0 { return 0 } @@ -82975,7 +79118,7 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, pSchema if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6616+7) == 0 { return int32(1) } - if pSchema == uintptr(0) { + if zDb == uintptr(0) { return 0 } if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6130+7) == 0 { @@ -83042,10 +79185,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = uintptr(0) /* A column of pTab */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) - _ = libc.Int32FromInt32(0) /* the name context cannot be NULL. */ - _ = libc.Int32FromInt32(0) /* The Z in X.Y.Z cannot be NULL */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + /* the name context cannot be NULL. */ + /* The Z in X.Y.Z cannot be NULL */ /* Initialize the node to no-match */ (*TExpr)(unsafe.Pointer(pExpr)).FiTable = -int32(1) /* Translate the schema name in zDb into a pointer to the corresponding @@ -83065,7 +79206,6 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { break } - _ = libc.Int32FromInt32(0) if _sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FzDbSName, zDb) == 0 { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema break @@ -83084,7 +79224,6 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } /* Start at the inner-most context and move outward until a match is found */ - _ = libc.Int32FromInt32(0) for cond := true; cond; cond = pNC != 0 { pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList if pSrcList != 0 { @@ -83095,9 +79234,6 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh break } pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x2000>>13)) != 0 { /* In this case, pItem is a subquery that has been formed from a ** parenthesized subset of the FROM clause terms. Example: @@ -83106,10 +79242,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** This pItem -------------^ */ hit = 0 - _ = libc.Int32FromInt32(0) pEList = (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpEList - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) j = 0 for { if !(j < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { @@ -83128,11 +79261,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { /* An INNER or LEFT JOIN. Use the left-most table */ goto _3 } else { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { /* A RIGHT JOIN. Use the right-most table */ cnt = 0 _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -83158,7 +79291,6 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(j) libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(j)*20+8+4, libc.Uint32FromInt32(1), 6, 0x40) /* rowid cannot be part of a USING clause - assert() this. */ - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*20 + 8 + 4))&0x80>>7)) != 0 { break } @@ -83171,7 +79303,6 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh goto _2 } } - _ = libc.Int32FromInt32(0) if zTab != 0 { if zDb != 0 { if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { @@ -83190,13 +79321,12 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).Ftnum != uint32(1) { goto _2 } - if !(_isValidSchemaTableName(tls, zTab, pTab, pSchema) != 0) { + if !(_isValidSchemaTableName(tls, zTab, pTab, zDb) != 0) { goto _2 } } } - _ = libc.Int32FromInt32(0) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+44) } } @@ -83207,7 +79337,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { if cnt > 0 { if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x400>>10)) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 48)), zCol) < 0 { /* Two or more tables have the same column name which is @@ -83216,11 +79346,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { /* An INNER or LEFT JOIN. Use the left-most table */ goto _4 } else { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { /* A RIGHT JOIN. Use the right-most table */ cnt = 0 _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -83273,10 +79403,9 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if pMatch != 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TSrcItem)(unsafe.Pointer(pMatch)).FiCursor - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = (*TSrcItem)(unsafe.Pointer(pMatch)).FpTab - if int32((*TSrcItem)(unsafe.Pointer(pMatch)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_CanBeNull)) + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pMatch)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } pSchema = (*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab)).FpSchema } @@ -83289,8 +79418,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if cnt == 0 && zDb == uintptr(0) { pTab = uintptr(0) if (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != uintptr(0) { - op = int32((*TParse)(unsafe.Pointer(pParse)).FeTriggerOp) - _ = libc.Int32FromInt32(0) + op = libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeTriggerOp) if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UBaseReg) != 0 && (zTab == uintptr(0) || _sqlite3StrICmp(tls, zTab, (*TTable)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab)).FzName) == 0 || _isValidSchemaTableName(tls, zTab, (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab, uintptr(0)) != 0) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = libc.BoolInt32(op != int32(TK_DELETE)) @@ -83325,7 +79453,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { iCol = -int32(1) } @@ -83345,8 +79473,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh cnt++ pMatch = uintptr(0) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == int32(EXCLUDED_TABLE_NUMBER) { - _ = libc.Int32FromInt32(0) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(iCol) (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = pTab eNewExprOp = int32(TK_COLUMN) @@ -83355,7 +79482,6 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh eNewExprOp = int32(TK_REGISTER) } } else { - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = pTab if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { eNewExprOp = int32(TK_REGISTER) @@ -83419,7 +79545,6 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh */ if cnt == 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UEList) != 0 && zTab == uintptr(0) { pEList = *(*uintptr)(unsafe.Pointer(pNC + 8)) - _ = libc.Int32FromInt32(0) j = 0 for { if !(j < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { @@ -83427,15 +79552,12 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } zAs = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*20))).FzEName if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*20 + 8 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*20))).FpExpr - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&uint32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6673, libc.VaList(bp+16, zAs)) return int32(WRC_Abort) } - if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&uint32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { + if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6704, libc.VaList(bp+16, zAs)) return int32(WRC_Abort) } @@ -83446,8 +79568,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) cnt = int32(1) pMatch = uintptr(0) - _ = libc.Int32FromInt32(0) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr) } goto lookupname_end @@ -83478,8 +79599,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** fields are not changed in any context. */ if cnt == 0 && zTab == uintptr(0) { - _ = libc.Int32FromInt32(0) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) && _areDoubleQuotedStringsEnabled(tls, db, pTopNC) != 0 { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) && _areDoubleQuotedStringsEnabled(tls, db, pTopNC) != 0 { /* If a double-quoted identifier does not match any known column name, ** then treat it as a string. ** @@ -83510,13 +79630,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** cnt==0 is always an error. cnt>1 is often an error, but might ** be multiple matches for a NATURAL LEFT JOIN or a LEFT JOIN USING. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if cnt != int32(1) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Leaf)) + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -83546,7 +79664,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if zTab != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6853, libc.VaList(bp+16, zErr, zTab, zCol)) } else { - if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&uint32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { + if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6863, libc.VaList(bp+16, zErr, zCol)) } else { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6924, libc.VaList(bp+16, zErr, zCol)) @@ -83558,14 +79676,13 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } - _ = libc.Int32FromInt32(0) /* Remove all substructure from pExpr */ - if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) != libc.Uint32FromInt32(0)) { + if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) != libc.Uint32FromInt32(0)) { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) (*TExpr)(unsafe.Pointer(pExpr)).FpRight = uintptr(0) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } /* If a column from a table in pSrcList is referenced, then record ** this fact in the pSrcList.a[].colUsed bitmask. Column 0 causes @@ -83588,19 +79705,17 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh libc.SetBitFieldPtr16Uint32(pMatch+36+4, libc.Uint32FromInt32(1), 14, 0x4000) } } - (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + (*TExpr)(unsafe.Pointer(pExpr)).Fop = libc.Uint8FromInt32(eNewExprOp) goto lookupname_end lookupname_end: ; if cnt == int32(1) { - _ = libc.Int32FromInt32(0) - if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FxAuth != 0 && (int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRIGGER)) { + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FxAuth != 0 && (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRIGGER)) { _sqlite3AuthRead(tls, pParse, pExpr, pSchema, (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList) } /* Increment the nRef value on all name contexts from TopNC up to ** the point where the name matched. */ for { - _ = libc.Int32FromInt32(0) (*TNameContext)(unsafe.Pointer(pTopNC)).FnRef++ if pTopNC == pNC { break @@ -83630,7 +79745,6 @@ func _sqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3 p = _sqlite3ExprAlloc(tls, db, int32(TK_COLUMN), uintptr(0), 0) if p != 0 { pItem = pSrc + 8 + uintptr(iSrc)*68 - _ = libc.Int32FromInt32(0) v1 = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab (*TExpr)(unsafe.Pointer(p)).Fy.FpTab = v1 pTab = v1 @@ -83639,16 +79753,16 @@ func _sqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3 (*TExpr)(unsafe.Pointer(p)).FiColumn = int16(-int32(1)) } else { (*TExpr)(unsafe.Pointer(p)).FiColumn = int16(iCol) - if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasGenerated) != uint32(0) && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasGenerated) != uint32(0) && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) >= int32(64) { - v2 = uint64(-libc.Int32FromInt32(1)) + v2 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { v2 = libc.Uint64FromInt32(1)<<(*TTable)(unsafe.Pointer(pTab)).FnCol - uint64(1) } (*TSrcItem)(unsafe.Pointer(pItem)).FcolUsed = v2 } else { - if iCol >= int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - v3 = int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) + if iCol >= libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { + v3 = libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) } else { v3 = iCol } @@ -83713,12 +79827,10 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(16) var _ /* r at bp+0 */ float64 *(*float64)(unsafe.Pointer(bp)) = -libc.Float64FromFloat64(1) - if int32((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_FLOAT) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_FLOAT) { return -int32(1) } - _ = libc.Int32FromInt32(0) _sqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8)), bp, _sqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8))), uint8(SQLITE_UTF8)) - _ = libc.Int32FromInt32(0) if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } @@ -83747,10 +79859,8 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { var p, pDef, pItem, pLeft, pList, pNC, pNC2, pParse, pRight, pRight1, pSel, pSrcList, pWin, zDb, zId, zTable, zType, v5, v8, p10, p11, p9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = anRef, auth, enc, i, is_agg, n, nLeft, nRef, nRight, no_such_func, p, pDef, pItem, pLeft, pList, pNC, pNC2, pParse, pRight, pRight1, pSel, pSrcList, pWin, rc, savedAllowFlags, wrong_num_args, zDb, zId, zTable, zType, v12, v4, v5, v6, v7, v8, p10, p11, p9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 24)) - _ = libc.Int32FromInt32(0) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse - _ = libc.Int32FromInt32(0) - switch int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) { /* The special operator TK_ROW means use the rowid for the first ** column in the FROM clause. This is used by the LIMIT and ORDER BY ** clause processing on UPDATE and DELETE statements, and by @@ -83758,10 +79868,8 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { */ case int32(TK_ROW): pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList - _ = libc.Int32FromInt32(0) pItem = pSrcList + 8 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor (*TExpr)(unsafe.Pointer(pExpr)).FiColumn-- @@ -83801,7 +79909,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { i = 0 p = pNC for { - if !(p != 0 && i < int32(libc.Uint32FromInt64(32)/libc.Uint32FromInt64(4))) { + if !(p != 0 && i < libc.Int32FromUint32(libc.Uint32FromInt64(32)/libc.Uint32FromInt64(4))) { break } anRef[i] = (*TNameContext)(unsafe.Pointer(p)).FnRef @@ -83812,7 +79920,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { i++ } _sqlite3WalkExpr(tls, pWalker, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { return int32(WRC_Prune) } if _sqlite3ExprCanBeNull(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) != 0 { @@ -83834,14 +79942,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { p = (*TNameContext)(unsafe.Pointer(p)).FpNext i++ } - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(pExpr + 8)) = libc.BoolInt32(int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL)) + *(*int32)(unsafe.Pointer(pExpr + 8)) = libc.BoolInt32(libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(EP_IntValue) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_INTEGER) i = 0 p = pNC for { - if !(p != 0 && i < int32(libc.Uint32FromInt64(32)/libc.Uint32FromInt64(4))) { + if !(p != 0 && i < libc.Int32FromUint32(libc.Uint32FromInt64(32)/libc.Uint32FromInt64(4))) { break } (*TNameContext)(unsafe.Pointer(p)).FnRef = anRef[i] @@ -83866,31 +79973,25 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { case int32(TK_ID): fallthrough case int32(TK_DOT): - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ID) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ID) { zDb = uintptr(0) zTable = uintptr(0) - _ = libc.Int32FromInt32(0) pRight = pExpr } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft - _ = libc.Int32FromInt32(0) if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { _notValidImpl(tls, pParse, pNC, __ccgo_ts+7033, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight - if int32((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { zDb = uintptr(0) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) zDb = *(*uintptr)(unsafe.Pointer(pLeft + 8)) pLeft = (*TExpr)(unsafe.Pointer(pRight)).FpLeft pRight = (*TExpr)(unsafe.Pointer(pRight)).FpRight } - _ = libc.Int32FromInt32(0) zTable = *(*uintptr)(unsafe.Pointer(pLeft + 8)) - _ = libc.Int32FromInt32(0) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenRemap(tls, pParse, pExpr, pRight) _sqlite3RenameTokenRemap(tls, pParse, pExpr+44, pLeft) } @@ -83912,14 +80013,12 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { is_agg = 0 /* Information about the function */ enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc /* The database encoding */ savedAllowFlags = (*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_AllowAgg) | libc.Int32FromInt32(NC_AllowWin)) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) && int32((*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FeFrmType) != int32(TK_FILTER) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FeFrmType) != int32(TK_FILTER) { v5 = *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)) } else { v5 = uintptr(0) } pWin = v5 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zId, n, enc, uint8(0)) if pDef == uintptr(0) { @@ -83932,7 +80031,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { is_agg = libc.BoolInt32((*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0)) if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_UNLIKELY) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_Unlikely)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Unlikely)) if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*20))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { @@ -83966,12 +80065,12 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) return int32(WRC_Prune) } - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)|libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG)) != 0 { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)|libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG)) != 0 { /* For the purposes of the EP_ConstFunc flag, date and time ** functions and other functions that change slowly are considered ** constant because they are constant for the duration of one query. ** This allows them to be factored out of inner loops. */ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_ConstFunc)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_ConstFunc)) } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_CONSTANT) == uint32(0) { /* Clearly non-deterministic functions like random(), but also @@ -83980,18 +80079,17 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all ** all this. */ - _ = libc.Int32FromInt32(0) if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { _notValidImpl(tls, pParse, pNC, __ccgo_ts+7150, uintptr(0), pExpr) } } else { - _ = libc.Int32FromInt32(0) /* Must fit in 8 bits */ - (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = uint8((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) + /* Must fit in 8 bits */ + (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FromDDL)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) } } - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the ** SQL is being compiled using sqlite3NestedParse() or ** the SQLITE_TESTCTRL_INTERNAL_FUNCTIONS test-control has be @@ -83999,13 +80097,12 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { no_such_func = int32(1) pDef = uintptr(0) } else { - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } - if 0 == libc.BoolInt32(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { - _ = libc.Int32FromInt32(0) + if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7178, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ @@ -84020,7 +80117,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { - if no_such_func != 0 && int32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { + if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7266, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { @@ -84028,7 +80125,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7288, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { - if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7332, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { @@ -84053,21 +80150,18 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { *(*int32)(unsafe.Pointer(pNC + 24)) &= ^(libc.Int32FromInt32(NC_AllowWin) | v7) } } else { - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) || (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) || (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { is_agg = int32(1) } } _sqlite3WalkExprList(tls, pWalker, pList) if is_agg != 0 { if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20))) } if pWin != 0 { pSel = (*TNameContext)(unsafe.Pointer(pNC)).FpWinSelect - _ = libc.Int32FromInt32(0) - if libc.BoolInt32(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) == 0 { + if libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) == 0 { if pSel != 0 { v8 = (*TSelect)(unsafe.Pointer(pSel)).FpWinDefn } else { @@ -84087,7 +80181,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { /* For looping up thru outer contexts */ (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_FUNCTION) (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = uint8(0) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { _sqlite3WalkExpr(tls, pWalker, (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FpFilter) } pNC2 = pNC @@ -84096,14 +80190,11 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { *(*Tu8)(unsafe.Pointer(p9)) = Tu8(uint32(*(*Tu8)(unsafe.Pointer(p9))) + (libc.Uint32FromInt32(1) + (*TNameContext)(unsafe.Pointer(pNC2)).FnNestedSelect)) pNC2 = (*TNameContext)(unsafe.Pointer(pNC2)).FpNext } - _ = libc.Int32FromInt32(0) if pNC2 != 0 && pDef != 0 { p10 = pExpr + 2 *(*Tu8)(unsafe.Pointer(p10)) = Tu8(uint32(*(*Tu8)(unsafe.Pointer(p10))) + (*TNameContext)(unsafe.Pointer(pNC2)).FnNestedSelect) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p11 = pNC2 + 24 - *(*int32)(unsafe.Pointer(p11)) = int32(uint32(*(*int32)(unsafe.Pointer(p11))) | (libc.Uint32FromInt32(NC_HasAgg) | ((*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags^libc.Uint32FromInt32(SQLITE_FUNC_ANYORDER))&uint32(libc.Int32FromInt32(SQLITE_FUNC_MINMAX)|libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)))) + *(*int32)(unsafe.Pointer(p11)) = int32(uint32(*(*int32)(unsafe.Pointer(p11))) | (libc.Uint32FromInt32(NC_HasAgg) | ((*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags^libc.Uint32FromInt32(SQLITE_FUNC_ANYORDER))&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_MINMAX)|libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)))) } } *(*int32)(unsafe.Pointer(pNC + 24)) |= savedAllowFlags @@ -84119,21 +80210,18 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { case int32(TK_IN): if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef - _ = libc.Int32FromInt32(0) if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { _notValidImpl(tls, pParse, pNC, __ccgo_ts+7380, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20))) } - _ = libc.Int32FromInt32(0) if nRef != (*TNameContext)(unsafe.Pointer(pNC)).FnRef { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_VarSelect)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_VarSelect)) *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 4)) |= uint32(SF_Correlated) } *(*int32)(unsafe.Pointer(pNC + 24)) |= int32(NC_Subquery) } case int32(TK_VARIABLE): - _ = libc.Int32FromInt32(0) if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { _notValidImpl(tls, pParse, pNC, __ccgo_ts+7391, pExpr, pExpr) } @@ -84141,15 +80229,14 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { fallthrough case int32(TK_ISNOT): pRight1 = _sqlite3ExprSkipCollateAndLikely(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) - _ = libc.Int32FromInt32(0) /* Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE", ** and "x IS NOT FALSE". */ - if pRight1 != 0 && (int32((*TExpr)(unsafe.Pointer(pRight1)).Fop) == int32(TK_ID) || int32((*TExpr)(unsafe.Pointer(pRight1)).Fop) == int32(TK_TRUEFALSE)) { + if pRight1 != 0 && (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight1)).Fop) == int32(TK_ID) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight1)).Fop) == int32(TK_TRUEFALSE)) { rc = _resolveExprStep(tls, pWalker, pRight1) if rc == int32(WRC_Abort) { return int32(WRC_Abort) } - if int32((*TExpr)(unsafe.Pointer(pRight1)).Fop) == int32(TK_TRUEFALSE) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight1)).Fop) == int32(TK_TRUEFALSE) { (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = (*TExpr)(unsafe.Pointer(pExpr)).Fop (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUTH) return WRC_Continue @@ -84172,16 +80259,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { break } - _ = libc.Int32FromInt32(0) nLeft = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_BETWEEN) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_BETWEEN) { nRight = _sqlite3ExprVectorSize(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr) if nRight == nLeft { nRight = _sqlite3ExprVectorSize(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 1*20))).FpExpr) } } else { - _ = libc.Int32FromInt32(0) nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { @@ -84190,7 +80274,6 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } break } - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { v12 = int32(WRC_Abort) } else { @@ -84218,8 +80301,7 @@ func _resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) ( var zCol uintptr _, _ = i, zCol /* Loop counter */ _ = pParse - if int32((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_ID) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_ID) { zCol = *(*uintptr)(unsafe.Pointer(pE + 8)) i = 0 for { @@ -84266,7 +80348,6 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt var savedSuppErr Tu8 var _ /* nc at bp+0 */ TNameContext _, _, _, _, _ = db, i, pEList, rc, savedSuppErr /* Saved value of db->suppressErr */ - _ = libc.Int32FromInt32(0) pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList /* Resolve all names in the ORDER BY term expression */ @@ -84370,7 +80451,6 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r for pSelect != 0 && moreToDo != 0 { moreToDo = 0 pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - _ = libc.Int32FromInt32(0) i = 0 pItem = pOrderBy + 8 for { @@ -84406,9 +80486,8 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r ** column references within the ORDER BY expression as required. */ pDup = _sqlite3ExprDup(tls, db, pE, 0) if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _resolveOrderByTermToExprList(tls, pParse, pSelect, pDup) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && *(*int32)(unsafe.Pointer(bp)) > 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && *(*int32)(unsafe.Pointer(bp)) > 0 { _resolveOrderByTermToExprList(tls, pParse, pSelect, pE) } } @@ -84418,7 +80497,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r if *(*int32)(unsafe.Pointer(bp)) > 0 { /* Convert the ORDER BY term into an integer column number iCol, ** taking care to preserve the COLLATE clause if it exists. */ - if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), uintptr(0)) if pNew == uintptr(0) { return int32(1) @@ -84429,18 +80508,16 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r (*TExprList_item)(unsafe.Pointer(pItem)).FpExpr = pNew } else { pParent = (*TExprList_item)(unsafe.Pointer(pItem)).FpExpr - _ = libc.Int32FromInt32(0) - for int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pParent)).FpLeft)).Fop) == int32(TK_COLLATE) { + for libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pParent)).FpLeft)).Fop) == int32(TK_COLLATE) { pParent = (*TExpr)(unsafe.Pointer(pParent)).FpLeft } - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pParent)).FpLeft = pNew } _sqlite3ExprDelete(tls, db, pE) (*(*struct { FiOrderByCol Tu16 FiAlias Tu16 - })(unsafe.Pointer(pItem + 16))).FiOrderByCol = uint16(*(*int32)(unsafe.Pointer(bp))) + })(unsafe.Pointer(pItem + 16))).FiOrderByCol = libc.Uint16FromInt32(*(*int32)(unsafe.Pointer(bp))) } libc.SetBitFieldPtr16Uint32(pItem+8+4, libc.Uint32FromInt32(1), 2, 0x4) } else { @@ -84490,7 +80567,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, var i int32 _, _, _, _ = db, i, pEList, pItem db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if pOrderBy == uintptr(0) || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if pOrderBy == uintptr(0) || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 116 + 2*4)) { @@ -84498,7 +80575,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - _ = libc.Int32FromInt32(0) /* sqlite3SelectNew() guarantees this */ + /* sqlite3SelectNew() guarantees this */ i = 0 pItem = pOrderBy + 8 for { @@ -84509,14 +80586,14 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem + 16))).FiOrderByCol != 0 { - if int32((*(*struct { + if libc.Int32FromUint16((*(*struct { FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem + 16))).FiOrderByCol) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { _resolveOutOfRangeError(tls, pParse, zType, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, uintptr(0)) return int32(1) } - _resolveAlias(tls, pParse, pEList, int32((*(*struct { + _resolveAlias(tls, pParse, pEList, libc.Int32FromUint16((*(*struct { FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem + 16))).FiOrderByCol)-int32(1), (*TExprList_item)(unsafe.Pointer(pItem)).FpExpr, 0) @@ -84539,7 +80616,7 @@ func _resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r i var pWin uintptr _ = pWin _ = pWalker - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { pWin = *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)) _sqlite3WindowUnlinkFromSelect(tls, pWin) } @@ -84591,7 +80668,6 @@ func _resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy var pE, pE2, pItem, pParse uintptr var _ /* iCol at bp+0 */ int32 _, _, _, _, _, _, _ = i, j, nResult, pE, pE2, pItem, pParse /* Number of terms in the result set */ - _ = libc.Int32FromInt32(0) nResult = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpEList)).FnExpr pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse i = 0 @@ -84615,7 +80691,7 @@ func _resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy (*(*struct { FiOrderByCol Tu16 FiAlias Tu16 - })(unsafe.Pointer(pItem + 16))).FiOrderByCol = uint16(*(*int32)(unsafe.Pointer(bp))) + })(unsafe.Pointer(pItem + 16))).FiOrderByCol = libc.Uint16FromInt32(*(*int32)(unsafe.Pointer(bp))) goto _1 } } @@ -84630,7 +80706,7 @@ func _resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy (*(*struct { FiOrderByCol Tu16 FiAlias Tu16 - })(unsafe.Pointer(pItem + 16))).FiOrderByCol = uint16(*(*int32)(unsafe.Pointer(bp))) + })(unsafe.Pointer(pItem + 16))).FiOrderByCol = libc.Uint16FromInt32(*(*int32)(unsafe.Pointer(bp))) goto _1 } /* Otherwise, treat the ORDER BY term as an ordinary expression */ @@ -84654,7 +80730,7 @@ func _resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy (*(*struct { FiOrderByCol Tu16 FiAlias Tu16 - })(unsafe.Pointer(pItem + 16))).FiOrderByCol = uint16(j + int32(1)) + })(unsafe.Pointer(pItem + 16))).FiOrderByCol = libc.Uint16FromInt32(j + int32(1)) } goto _2 _2: @@ -84682,7 +80758,6 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { var i, isCompound, nCompound, nRef, v1, v3 int32 var _ /* sNC at bp+0 */ TNameContext _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, i, isCompound, nCompound, nRef, pGroupBy, pItem, pItem1, pItem2, pLeftmost, pOuterNC, pParse, pSub, pSub1, pWin, zSavedContext, v1, v3 /* Database connection */ - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Resolved) != 0 { return int32(WRC_Prune) } @@ -84710,8 +80785,6 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { nCompound = 0 pLeftmost = p for p != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Resolved) /* Resolve the expressions in the LIMIT and OFFSET clauses. These ** are not allowed to refer to any names, so pass an empty NameContext. @@ -84730,8 +80803,6 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** after the names have been resolved. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Converted) != 0 { pSub = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy = (*TSelect)(unsafe.Pointer(p)).FpOrderBy (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } @@ -84746,7 +80817,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } pItem = (*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*68 - _ = libc.Int32FromInt32(0) /* Test of tag-20240424-1*/ + /* Test of tag-20240424-1*/ if (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags&uint32(SF_Resolved) == uint32(0) { if pOuterNC != 0 { v3 = (*TNameContext)(unsafe.Pointer(pOuterNC)).FnRef @@ -84763,7 +80834,6 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - _ = libc.Int32FromInt32(0) /* If the number of references to the outer context changed when ** expressions in the sub-select were resolved, the sub-select ** is correlated. It is not required to check the refcount on any @@ -84771,7 +80841,6 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the refcount on all contexts between the current one and the ** context containing the column when it resolves a name. */ if pOuterNC != 0 { - _ = libc.Int32FromInt32(0) libc.SetBitFieldPtr16Uint32(pItem+36+4, libc.BoolUint32((*TNameContext)(unsafe.Pointer(pOuterNC)).FnRef > nRef), 3, 0x8) } } @@ -84797,12 +80866,9 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { /* If there are no aggregate functions in the result-set, and no GROUP BY ** expression, do not allow aggregates in any of the other expressions. */ - _ = libc.Int32FromInt32(0) pGroupBy = (*TSelect)(unsafe.Pointer(p)).FpGroupBy if pGroupBy != 0 || (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags&int32(NC_HasAgg) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(int32(SF_Aggregate) | (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags&(libc.Int32FromInt32(NC_MinMaxAgg)|libc.Int32FromInt32(NC_OrderAgg))) + *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(int32(SF_Aggregate) | (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags&(libc.Int32FromInt32(NC_MinMaxAgg)|libc.Int32FromInt32(NC_OrderAgg))) } else { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags &= ^libc.Int32FromInt32(NC_AllowAgg) } @@ -84814,7 +80880,6 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** Minor point: If this is the case, then the expression will be ** re-evaluated for each reference to it. */ - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = (*TSelect)(unsafe.Pointer(p)).FpEList (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { @@ -84846,7 +80911,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ; i++ } - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { pWin = (*TSelect)(unsafe.Pointer(p)).FpWinDefn for { if !(pWin != 0) { @@ -84906,7 +80971,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if !(i < (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { break } - if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { + if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7635, 0) return int32(WRC_Abort) } @@ -85013,12 +81078,9 @@ func _sqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) (r int3 if _sqlite3ExprCheckHeight(tls, (*(*TWalker)(unsafe.Pointer(bp))).FpParse, (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnHeight) != 0 { return int32(SQLITE_ERROR) } - _ = libc.Int32FromInt32(0) _sqlite3WalkExprNN(tls, bp, pExpr) *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) *(*int32)(unsafe.Pointer(pNC + 24)) |= savedHasAgg return libc.BoolInt32((*TNameContext)(unsafe.Pointer(pNC)).FnNcErr > 0 || (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnErr > 0) } @@ -85029,6 +81091,9 @@ func _sqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) (r int3 // ** Resolve all names for all expression in an expression list. This is // ** just like sqlite3ResolveExprNames() except that it works for an expression // ** list rather than a single expression. +// ** +// ** The return value is SQLITE_OK (0) for success or SQLITE_ERROR (1) for a +// ** failure. // */ func _sqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) (r int32) { bp := tls.Alloc(32) @@ -85039,7 +81104,7 @@ func _sqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) (r _, _, _ = i, pExpr, savedHasAgg savedHasAgg = 0 if pList == uintptr(0) { - return WRC_Continue + return SQLITE_OK } (*(*TWalker)(unsafe.Pointer(bp))).FpParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse (*(*TWalker)(unsafe.Pointer(bp))).FxExprCallback = __ccgo_fp(_resolveExprStep) @@ -85059,19 +81124,17 @@ func _sqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) (r } *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if _sqlite3ExprCheckHeight(tls, (*(*TWalker)(unsafe.Pointer(bp))).FpParse, (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnHeight) != 0 { - return int32(WRC_Abort) + return int32(SQLITE_ERROR) } _sqlite3WalkExprNN(tls, bp, pExpr) *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_HasAgg)|libc.Int32FromInt32(NC_MinMaxAgg)|libc.Int32FromInt32(NC_HasWin)|libc.Int32FromInt32(NC_OrderAgg)) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) savedHasAgg |= (*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_MinMaxAgg) | libc.Int32FromInt32(NC_HasWin) | libc.Int32FromInt32(NC_OrderAgg)) *(*int32)(unsafe.Pointer(pNC + 24)) &= ^(libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_MinMaxAgg) | libc.Int32FromInt32(NC_HasWin) | libc.Int32FromInt32(NC_OrderAgg)) } if (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnErr > 0 { - return int32(WRC_Abort) + return int32(SQLITE_ERROR) } goto _1 _1: @@ -85079,7 +81142,7 @@ func _sqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) (r i++ } *(*int32)(unsafe.Pointer(pNC + 24)) |= savedHasAgg - return WRC_Continue + return SQLITE_OK } // C documentation @@ -85100,7 +81163,6 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter bp := tls.Alloc(32) defer tls.Free(32) var _ /* w at bp+0 */ TWalker - _ = libc.Int32FromInt32(0) (*(*TWalker)(unsafe.Pointer(bp))).FxExprCallback = __ccgo_fp(_resolveExprStep) (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback = __ccgo_fp(_resolveSelectStep) (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback2 = uintptr(0) @@ -85136,8 +81198,6 @@ func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, t var _ /* sNC at bp+76 */ TNameContext var _ /* sSrc at bp+0 */ TSrcList _, _ = rc, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp+76, 0, uint32(36)) libc.Xmemset(tls, bp, 0, uint32(76)) if pTab != 0 { @@ -85199,43 +81259,30 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { var op, v1 int32 var v2 bool _, _, _ = op, v1, v2 - op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) for int32(1) != 0 { if op == int32(TK_COLUMN) || op == int32(TK_AGG_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab != uintptr(0) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return _sqlite3TableColumnAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) } if op == int32(TK_SELECT) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpEList + 8))).FpExpr) } if op == int32(TK_CAST) { - _ = libc.Int32FromInt32(0) return _sqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0)) } if op == int32(TK_SELECT_COLUMN) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*20))).FpExpr) } if op == int32(TK_VECTOR) { - _ = libc.Int32FromInt32(0) return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { - _ = libc.Int32FromInt32(0) + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { pExpr = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft - op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) continue } if v2 = op != int32(TK_REGISTER); !v2 { - v1 = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2) + v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2) op = v1 } if v2 || v1 == int32(TK_REGISTER) { @@ -85262,7 +81309,7 @@ func _sqlite3ExprDataType(tls *libc.TLS, pExpr uintptr) (r int32) { var pList uintptr _, _, _, _ = aff, ii, pList, res for pExpr != 0 { - switch int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) { case int32(TK_COLLATE): fallthrough case int32(TK_IF_NULL_ROW): @@ -85305,8 +81352,6 @@ func _sqlite3ExprDataType(tls *libc.TLS, pExpr uintptr) (r int32) { case int32(TK_CASE): res = 0 pList = *(*uintptr)(unsafe.Pointer(pExpr + 20)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) ii = int32(1) for { if !(ii < (*TExprList)(unsafe.Pointer(pList)).FnExpr) { @@ -85346,7 +81391,7 @@ func _sqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, p pNew = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLLATE), pCollName, dequote) if pNew != 0 { (*TExpr)(unsafe.Pointer(pNew)).FpLeft = pExpr - *(*Tu32)(unsafe.Pointer(pNew + 4)) |= uint32(libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Skip)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Skip)) pExpr = pNew } } @@ -85357,7 +81402,6 @@ func _sqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, bp := tls.Alloc(16) defer tls.Free(16) var _ /* s at bp+0 */ TToken - _ = libc.Int32FromInt32(0) _sqlite3TokenInit(tls, bp, zC) return _sqlite3ExprAddCollateToken(tls, pParse, pExpr, bp, 0) } @@ -85368,8 +81412,7 @@ func _sqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, // ** Skip over any TK_COLLATE operators. // */ func _sqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) (r uintptr) { - for pExpr != 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Skip)) != uint32(0) { - _ = libc.Int32FromInt32(0) + for pExpr != 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)) != uint32(0) { pExpr = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft } return pExpr @@ -85383,14 +81426,11 @@ func _sqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) (r uintptr) { // ** expression. // */ func _sqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) (r uintptr) { - for pExpr != 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_Unlikely)) != uint32(0) { - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Unlikely)) != uint32(0) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + for pExpr != 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_Unlikely)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Unlikely)) != uint32(0) { pExpr = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLLATE) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLLATE) { pExpr = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft } else { break @@ -85424,13 +81464,11 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt pColl = uintptr(0) p = pExpr for p != 0 { - op = int32((*TExpr)(unsafe.Pointer(p)).Fop) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) if op == int32(TK_REGISTER) { - op = int32((*TExpr)(unsafe.Pointer(p)).Fop2) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop2) } if op == int32(TK_AGG_COLUMN) && (*TExpr)(unsafe.Pointer(p)).Fy.FpTab != uintptr(0) || op == int32(TK_COLUMN) || op == int32(TK_TRIGGER) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v1 = int32((*TExpr)(unsafe.Pointer(p)).FiColumn) j = v1 if v1 >= 0 { @@ -85444,12 +81482,10 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt continue } if op == int32(TK_VECTOR) { - _ = libc.Int32FromInt32(0) p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)) + 8))).FpExpr continue } if op == int32(TK_COLLATE) { - _ = libc.Int32FromInt32(0) pColl = _sqlite3GetCollSeq(tls, pParse, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, uintptr(0), *(*uintptr)(unsafe.Pointer(p + 8))) break } @@ -85459,14 +81495,13 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt } else { pNext = (*TExpr)(unsafe.Pointer(p)).FpRight /* The Expr.x union is never used at the same time as Expr.pRight */ - _ = libc.Int32FromInt32(0) if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_xIsSelect) == uint32(0) && *(*uintptr)(unsafe.Pointer(p + 20)) != uintptr(0) && !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)))).FnExpr) { break } - if (*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)) + 8 + uintptr(i)*20))).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Collate)) != uint32(0) { + if (*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)) + 8 + uintptr(i)*20))).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) != uint32(0) { pNext = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)) + 8 + uintptr(i)*20))).FpExpr break } @@ -85507,7 +81542,6 @@ func _sqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uint if p == uintptr(0) { p = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } - _ = libc.Int32FromInt32(0) return p } @@ -85547,7 +81581,6 @@ func _sqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) (r int8) { } } else { /* One side is a column, the other is not. Use the columns affinity. */ - _ = libc.Int32FromInt32(0) if int32(aff1) <= int32(SQLITE_AFF_NONE) { v1 = int32(aff2) } else { @@ -85567,8 +81600,6 @@ func _sqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) (r int8) { func _comparisonAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { var aff int8 _ = aff - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) aff = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) if (*TExpr)(unsafe.Pointer(pExpr)).FpRight != 0 { aff = _sqlite3CompareAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, aff) @@ -85614,8 +81645,8 @@ func _sqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) (r func _binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) (r Tu8) { var aff Tu8 _ = aff - aff = uint8(_sqlite3ExprAffinity(tls, pExpr2)) - aff = uint8(int32(uint8(_sqlite3CompareAffinity(tls, pExpr1, int8(aff)))) | int32(uint8(jumpIfNull))) + aff = libc.Uint8FromInt8(_sqlite3ExprAffinity(tls, pExpr2)) + aff = libc.Uint8FromInt32(libc.Int32FromUint8(libc.Uint8FromInt8(_sqlite3CompareAffinity(tls, pExpr1, libc.Int8FromUint8(aff)))) | libc.Int32FromUint8(libc.Uint8FromInt32(jumpIfNull))) return aff } @@ -85636,7 +81667,6 @@ func _binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull func _sqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) (r uintptr) { var pColl uintptr _ = pColl - _ = libc.Int32FromInt32(0) if (*TExpr)(unsafe.Pointer(pLeft)).Fflags&uint32(EP_Collate) != 0 { pColl = _sqlite3ExprCollSeq(tls, pParse, pLeft) } else { @@ -85663,7 +81693,7 @@ func _sqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, // ** correct collating sequence is found. // */ func _sqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) (r uintptr) { - if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_Commuted)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Commuted)) != uint32(0) { return _sqlite3BinaryCompareCollSeq(tls, pParse, (*TExpr)(unsafe.Pointer(p)).FpRight, (*TExpr)(unsafe.Pointer(p)).FpLeft) } else { return _sqlite3BinaryCompareCollSeq(tls, pParse, (*TExpr)(unsafe.Pointer(p)).FpLeft, (*TExpr)(unsafe.Pointer(p)).FpRight) @@ -85688,9 +81718,9 @@ func _codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, } else { p4 = _sqlite3BinaryCompareCollSeq(tls, pParse, pLeft, pRight) } - p5 = int32(_binaryCompareP5(tls, pLeft, pRight, jumpIfNull)) + p5 = libc.Int32FromUint8(_binaryCompareP5(tls, pLeft, pRight, jumpIfNull)) addr = _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, opcode, in2, dest, in1, p4, -int32(2)) - _sqlite3VdbeChangeP5(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, uint16(uint8(p5))) + _sqlite3VdbeChangeP5(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, uint16(libc.Uint8FromInt32(p5))) return addr } @@ -85721,15 +81751,13 @@ func _sqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) (r int32) { var op Tu8 _ = op op = (*TExpr)(unsafe.Pointer(pExpr)).Fop - if int32(op) == int32(TK_REGISTER) { + if libc.Int32FromUint8(op) == int32(TK_REGISTER) { op = (*TExpr)(unsafe.Pointer(pExpr)).Fop2 } - if int32(op) == int32(TK_VECTOR) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(op) == int32(TK_VECTOR) { return (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr } else { - if int32(op) == int32(TK_SELECT) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(op) == int32(TK_SELECT) { return (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpEList)).FnExpr } else { return int32(1) @@ -85756,14 +81784,10 @@ func _sqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) (r int32) { // ** been positioned. // */ func _sqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) (r uintptr) { - _ = libc.Int32FromInt32(0) if _sqlite3ExprIsVector(tls, pVector) != 0 { - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pVector)).Fop) == int32(TK_SELECT) || int32((*TExpr)(unsafe.Pointer(pVector)).Fop2) == int32(TK_SELECT) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pVector)).Fop) == int32(TK_SELECT) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pVector)).Fop2) == int32(TK_SELECT) { return (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20)))).FpEList + 8 + uintptr(i)*20))).FpExpr } else { - _ = libc.Int32FromInt32(0) return (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20)) + 8 + uintptr(i)*20))).FpExpr } } @@ -85796,8 +81820,7 @@ func _sqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) (r uint func _sqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, nField int32) (r uintptr) { var pRet, ppVector uintptr _, _ = pRet, ppVector - if int32((*TExpr)(unsafe.Pointer(pVector)).Fop) == int32(TK_SELECT) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pVector)).Fop) == int32(TK_SELECT) { /* The TK_SELECT_COLUMN Expr node: ** ** pLeft: pVector containing TK_SELECT. Not deleted. @@ -85816,17 +81839,16 @@ func _sqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, */ pRet = _sqlite3PExpr(tls, pParse, int32(TK_SELECT_COLUMN), uintptr(0), uintptr(0)) if pRet != 0 { - *(*Tu32)(unsafe.Pointer(pRet + 4)) |= uint32(libc.Int32FromInt32(EP_FullSize)) + *(*Tu32)(unsafe.Pointer(pRet + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FullSize)) (*TExpr)(unsafe.Pointer(pRet)).FiTable = nField (*TExpr)(unsafe.Pointer(pRet)).FiColumn = int16(iField) (*TExpr)(unsafe.Pointer(pRet)).FpLeft = pVector } } else { - if int32((*TExpr)(unsafe.Pointer(pVector)).Fop) == int32(TK_VECTOR) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pVector)).Fop) == int32(TK_VECTOR) { ppVector = *(*uintptr)(unsafe.Pointer(pVector + 20)) + 8 + uintptr(iField)*20 pVector = *(*uintptr)(unsafe.Pointer(ppVector)) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { /* This must be a vector UPDATE inside a trigger */ *(*uintptr)(unsafe.Pointer(ppVector)) = uintptr(0) return pVector @@ -85851,7 +81873,7 @@ func _exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) var reg int32 _ = reg reg = 0 - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) { reg = _sqlite3CodeSubselect(tls, pParse, pExpr) } return reg @@ -85881,18 +81903,15 @@ func _exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField var op Tu8 _ = op op = (*TExpr)(unsafe.Pointer(pVector)).Fop - _ = libc.Int32FromInt32(0) - if int32(op) == int32(TK_REGISTER) { + if libc.Int32FromUint8(op) == int32(TK_REGISTER) { *(*uintptr)(unsafe.Pointer(ppExpr)) = _sqlite3VectorFieldSubexpr(tls, pVector, iField) return (*TExpr)(unsafe.Pointer(pVector)).FiTable + iField } - if int32(op) == int32(TK_SELECT) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(op) == int32(TK_SELECT) { *(*uintptr)(unsafe.Pointer(ppExpr)) = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20)))).FpEList + 8 + uintptr(iField)*20))).FpExpr return regSelect + iField } - if int32(op) == int32(TK_VECTOR) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(op) == int32(TK_VECTOR) { *(*uintptr)(unsafe.Pointer(ppExpr)) = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20)) + 8 + uintptr(iField)*20))).FpExpr return _sqlite3ExprCodeTemp(tls, pParse, *(*uintptr)(unsafe.Pointer(ppExpr)), pRegFree) } @@ -85932,8 +81951,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 opx = op addrCmp = 0 addrDone = _sqlite3VdbeMakeLabel(tls, pParse) - isCommuted = libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Commuted)) != uint32(0)) - _ = libc.Int32FromInt32(0) + isCommuted = libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Commuted)) != uint32(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return } @@ -85941,17 +81959,13 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6741, 0) return } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32(op) == int32(TK_LE) { + if libc.Int32FromUint8(op) == int32(TK_LE) { opx = uint8(TK_LT) } - if int32(op) == int32(TK_GE) { + if libc.Int32FromUint8(op) == int32(TK_GE) { opx = uint8(TK_GT) } - if int32(op) == int32(TK_NE) { + if libc.Int32FromUint8(op) == int32(TK_NE) { opx = uint8(TK_EQ) } regLeft = _exprCodeSubselect(tls, pParse, pLeft) @@ -85966,20 +81980,19 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) - _ = libc.Int32FromInt32(0) if addrCmp != 0 { _sqlite3VdbeJumpHere(tls, v, addrCmp) } r1 = _exprVectorRegister(tls, pParse, pLeft, i, regLeft, bp+8, bp) r2 = _exprVectorRegister(tls, pParse, pRight, i, regRight, bp+12, bp+4) addrCmp = _sqlite3VdbeCurrentAddr(tls, v) - _codeCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 12)), int32(opx), r1, r2, addrDone, int32(p5), isCommuted) + _codeCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 12)), libc.Int32FromUint8(opx), r1, r2, addrDone, libc.Int32FromUint8(p5), isCommuted) _sqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp))) _sqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 4))) - if (int32(opx) == int32(TK_LT) || int32(opx) == int32(TK_GT)) && i < nLeft-int32(1) { + if (libc.Int32FromUint8(opx) == int32(TK_LT) || libc.Int32FromUint8(opx) == int32(TK_GT)) && i < nLeft-int32(1) { addrCmp = _sqlite3VdbeAddOp0(tls, v, int32(OP_ElseEq)) } - if int32(p5) == int32(SQLITE_NULLEQ) { + if libc.Int32FromUint8(p5) == int32(SQLITE_NULLEQ) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, dest) } else { _sqlite3VdbeAddOp3(tls, v, int32(OP_ZeroOrNull), r1, dest, r2) @@ -85987,10 +82000,9 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 if i == nLeft-int32(1) { break } - if int32(opx) == int32(TK_EQ) { + if libc.Int32FromUint8(opx) == int32(TK_EQ) { _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), dest, addrDone) } else { - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, addrDone) if i == nLeft-int32(2) { opx = op @@ -86003,7 +82015,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 } _sqlite3VdbeJumpHere(tls, v, addrCmp) _sqlite3VdbeResolveLabel(tls, v, addrDone) - if int32(op) == int32(TK_NE) { + if libc.Int32FromUint8(op) == int32(TK_NE) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Not), dest, dest) } } @@ -86119,7 +82131,7 @@ func _exprSetHeight(tls *libc.TLS, p uintptr) { } else { if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 { _heightOfExprList(tls, *(*uintptr)(unsafe.Pointer(p + 20)), bp) - *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(libc.Int32FromInt32(EP_Collate)|libc.Int32FromInt32(EP_Subquery)|libc.Int32FromInt32(EP_HasFunc)) & _sqlite3ExprListFlags(tls, *(*uintptr)(unsafe.Pointer(p + 20))) + *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)|libc.Int32FromInt32(EP_Subquery)|libc.Int32FromInt32(EP_HasFunc)) & _sqlite3ExprListFlags(tls, *(*uintptr)(unsafe.Pointer(p + 20))) } } (*TExpr)(unsafe.Pointer(p)).FnHeight = *(*int32)(unsafe.Pointer(bp)) + int32(1) @@ -86167,7 +82179,7 @@ func _sqlite3ExprSetErrorOffset(tls *libc.TLS, pExpr uintptr, iOfst int32) { if pExpr == uintptr(0) { return } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_OuterON)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return } *(*int32)(unsafe.Pointer(pExpr + 36)) = iOfst @@ -86205,17 +82217,15 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ _, _, _ = nExtra, pNew, v1 nExtra = 0 *(*int32)(unsafe.Pointer(bp)) = 0 - _ = libc.Int32FromInt32(0) if pToken != 0 { if op != int32(TK_INTEGER) || (*TToken)(unsafe.Pointer(pToken)).Fz == uintptr(0) || _sqlite3GetInt32(tls, (*TToken)(unsafe.Pointer(pToken)).Fz, bp) == 0 { - nExtra = int32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ - _ = libc.Int32FromInt32(0) + nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(52)+uint32(nExtra))) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(52)+libc.Uint32FromInt32(nExtra))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint32(52)) - (*TExpr)(unsafe.Pointer(pNew)).Fop = uint8(op) + (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) (*TExpr)(unsafe.Pointer(pNew)).FiAgg = int16(-int32(1)) if pToken != 0 { if nExtra == 0 { @@ -86224,16 +82234,15 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ } else { v1 = int32(EP_IsFalse) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) |= uint32(libc.Int32FromInt32(EP_IntValue) | libc.Int32FromInt32(EP_Leaf) | v1) + *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue) | libc.Int32FromInt32(EP_Leaf) | v1) *(*int32)(unsafe.Pointer(pNew + 8)) = *(*int32)(unsafe.Pointer(bp)) } else { *(*uintptr)(unsafe.Pointer(pNew + 8)) = pNew + 1*52 - _ = libc.Int32FromInt32(0) if (*TToken)(unsafe.Pointer(pToken)).Fn != 0 { libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(pNew + 8)), (*TToken)(unsafe.Pointer(pToken)).Fz, (*TToken)(unsafe.Pointer(pToken)).Fn) } *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8)) + uintptr((*TToken)(unsafe.Pointer(pToken)).Fn))) = 0 - if dequote != 0 && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8)))))])&int32(0x80) != 0 { + if dequote != 0 && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8)))))])&int32(0x80) != 0 { _sqlite3DequoteExpr(tls, pNew) } } @@ -86254,7 +82263,7 @@ func _sqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) (r uintpt defer tls.Free(16) var _ /* x at bp+0 */ TToken (*(*TToken)(unsafe.Pointer(bp))).Fz = zToken - (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(_sqlite3Strlen30(tls, zToken)) + (*(*TToken)(unsafe.Pointer(bp))).Fn = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zToken)) return _sqlite3ExprAlloc(tls, db, op, bp, 0) } @@ -86268,22 +82277,19 @@ func _sqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) (r uintpt // */ func _sqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) { if pRoot == uintptr(0) { - _ = libc.Int32FromInt32(0) _sqlite3ExprDelete(tls, db, pLeft) _sqlite3ExprDelete(tls, db, pRight) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pRight != 0 { (*TExpr)(unsafe.Pointer(pRoot)).FpRight = pRight - *(*Tu32)(unsafe.Pointer(pRoot + 4)) |= uint32(libc.Int32FromInt32(EP_Collate)|libc.Int32FromInt32(EP_Subquery)|libc.Int32FromInt32(EP_HasFunc)) & (*TExpr)(unsafe.Pointer(pRight)).Fflags + *(*Tu32)(unsafe.Pointer(pRoot + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)|libc.Int32FromInt32(EP_Subquery)|libc.Int32FromInt32(EP_HasFunc)) & (*TExpr)(unsafe.Pointer(pRight)).Fflags (*TExpr)(unsafe.Pointer(pRoot)).FnHeight = (*TExpr)(unsafe.Pointer(pRight)).FnHeight + int32(1) } else { (*TExpr)(unsafe.Pointer(pRoot)).FnHeight = int32(1) } if pLeft != 0 { (*TExpr)(unsafe.Pointer(pRoot)).FpLeft = pLeft - *(*Tu32)(unsafe.Pointer(pRoot + 4)) |= uint32(libc.Int32FromInt32(EP_Collate)|libc.Int32FromInt32(EP_Subquery)|libc.Int32FromInt32(EP_HasFunc)) & (*TExpr)(unsafe.Pointer(pLeft)).Fflags + *(*Tu32)(unsafe.Pointer(pRoot + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)|libc.Int32FromInt32(EP_Subquery)|libc.Int32FromInt32(EP_HasFunc)) & (*TExpr)(unsafe.Pointer(pLeft)).Fflags if (*TExpr)(unsafe.Pointer(pLeft)).FnHeight >= (*TExpr)(unsafe.Pointer(pRoot)).FnHeight { (*TExpr)(unsafe.Pointer(pRoot)).FnHeight = (*TExpr)(unsafe.Pointer(pLeft)).FnHeight + int32(1) } @@ -86306,7 +82312,7 @@ func _sqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRigh p = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(52)) if p != 0 { libc.Xmemset(tls, p, 0, uint32(52)) - (*TExpr)(unsafe.Pointer(p)).Fop = uint8(op & int32(0xff)) + (*TExpr)(unsafe.Pointer(p)).Fop = libc.Uint8FromInt32(op & int32(0xff)) (*TExpr)(unsafe.Pointer(p)).FiAgg = int16(-int32(1)) _sqlite3ExprAttachSubtrees(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, p, pLeft, pRight) _sqlite3ExprCheckHeight(tls, pParse, (*TExpr)(unsafe.Pointer(p)).FnHeight) @@ -86326,10 +82332,9 @@ func _sqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRigh func _sqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) { if pExpr != 0 { *(*uintptr)(unsafe.Pointer(pExpr + 20)) = pSelect - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_xIsSelect) | libc.Int32FromInt32(EP_Subquery)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_xIsSelect) | libc.Int32FromInt32(EP_Subquery)) _sqlite3ExprSetHeightAndFlags(tls, pParse, pExpr) } else { - _ = libc.Int32FromInt32(0) _sqlite3SelectDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSelect) } } @@ -86362,15 +82367,13 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList var pExpr, pRet, pSel, v2 uintptr _, _, _, _, _, _ = ii, nExprElem, pExpr, pRet, pSel, v2 pRet = uintptr(0) - _ = libc.Int32FromInt32(0) ii = 0 for { if !(ii < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } pExpr = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(ii)*20))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_VECTOR) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_VECTOR) { nExprElem = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr } else { nExprElem = int32(1) @@ -86384,7 +82387,6 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7744, libc.VaList(bp+8, nExprElem, v2, nElem)) break } - _ = libc.Int32FromInt32(0) pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 20)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) *(*uintptr)(unsafe.Pointer(pExpr + 20)) = uintptr(0) if pSel != 0 { @@ -86428,7 +82430,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1782) @@ -86452,23 +82454,20 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u var db, pNew uintptr _, _ = db, pNew db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) pNew = _sqlite3ExprAlloc(tls, db, int32(TK_FUNCTION), pToken, int32(1)) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) /* Avoid memory leak when malloc fails */ return uintptr(0) } - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pNew + 36)) = int32((*TToken)(unsafe.Pointer(pToken)).Fz) - int32((*TParse)(unsafe.Pointer(pParse)).FzTail) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 116 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7788, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 20)) = pList - *(*Tu32)(unsafe.Pointer(pNew + 4)) |= uint32(libc.Int32FromInt32(EP_HasFunc)) - _ = libc.Int32FromInt32(0) + *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) _sqlite3ExprSetHeightAndFlags(tls, pParse, pNew) if eDistinct == int32(SF_Distinct) { - *(*Tu32)(unsafe.Pointer(pNew + 4)) |= uint32(libc.Int32FromInt32(EP_Distinct)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) } return pNew } @@ -86502,23 +82501,18 @@ func _sqlite3ExprAddFunctionOrderBy(tls *libc.TLS, pParse uintptr, pExpr uintptr _, _ = db, pOB db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pOrderBy == uintptr(0) { - _ = libc.Int32FromInt32(0) return } if pExpr == uintptr(0) { - _ = libc.Int32FromInt32(0) _sqlite3ExprListDelete(tls, db, pOrderBy) return } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(pExpr + 20)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr == 0 { /* Ignore ORDER BY on zero-argument aggregates */ _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), pOrderBy) return } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) && int32((*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FeFrmType) != int32(TK_FILTER) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FeFrmType) != int32(TK_FILTER) { _sqlite3ExprOrderByAggregateError(tls, pParse, pExpr) _sqlite3ExprListDelete(tls, db, pOrderBy) return @@ -86529,9 +82523,8 @@ func _sqlite3ExprAddFunctionOrderBy(tls *libc.TLS, pParse uintptr, pExpr uintptr return } *(*uintptr)(unsafe.Pointer(pOB + 20)) = pOrderBy - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = pOB - *(*Tu32)(unsafe.Pointer(pOB + 4)) |= uint32(libc.Int32FromInt32(EP_FullSize)) + *(*Tu32)(unsafe.Pointer(pOB + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FullSize)) } // C documentation @@ -86550,9 +82543,7 @@ func _sqlite3ExprAddFunctionOrderBy(tls *libc.TLS, pParse uintptr, pExpr uintptr func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_FromDDL)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) != uint32(0) { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_DIRECT) != uint32(0) || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) == uint64(0) { /* Functions prohibited in triggers and views if: ** (1) tagged with SQLITE_DIRECTONLY @@ -86596,14 +82587,9 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n if pExpr == uintptr(0) { return } - _ = libc.Int32FromInt32(0) z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(*(*int8)(unsafe.Pointer(z + 1))) == 0 { /* Wildcard of the form "?". Assign the next variable number */ - _ = libc.Int32FromInt32(0) v2 = pParse + 216 *(*TynVar)(unsafe.Pointer(v2))++ v1 = *(*TynVar)(unsafe.Pointer(v2)) @@ -86615,7 +82601,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n *(*Ti64)(unsafe.Pointer(bp)) = int64(int32(*(*int8)(unsafe.Pointer(z + 1))) - int32('0')) /* The common case of ?N for a single digit N */ bOk = int32(1) } else { - bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, int32(n-uint32(1)), uint8(SQLITE_UTF8))) + bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 116 + 9*4))) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7892, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 116 + 9*4)))) @@ -86636,7 +82622,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n ** number as the prior appearance of the same name, or if the name ** has never appeared before, reuse the same variable number */ - x = int16(_sqlite3VListNameToNum(tls, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, int32(n))) + x = int16(_sqlite3VListNameToNum(tls, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, libc.Int32FromUint32(n))) if int32(x) == 0 { v4 = pParse + 216 *(*TynVar)(unsafe.Pointer(v4))++ @@ -86646,7 +82632,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } } if doAdd != 0 { - (*TParse)(unsafe.Pointer(pParse)).FpVList = _sqlite3VListAdd(tls, db, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, int32(n), int32(x)) + (*TParse)(unsafe.Pointer(pParse)).FpVList = _sqlite3VListAdd(tls, db, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, libc.Int32FromUint32(n), int32(x)) } } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x @@ -86664,35 +82650,26 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n func _sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { var pLeft uintptr _ = pLeft - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto exprDeleteRestart exprDeleteRestart: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if !((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) != libc.Uint32FromInt32(0)) { + if !((*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) != libc.Uint32FromInt32(0)) { /* The Expr.x union is never used at the same time as Expr.pRight */ - _ = libc.Int32FromInt32(0) if (*TExpr)(unsafe.Pointer(p)).FpRight != 0 { - _ = libc.Int32FromInt32(0) _sqlite3ExprDeleteNN(tls, db, (*TExpr)(unsafe.Pointer(p)).FpRight) } else { if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_xIsSelect) != uint32(0) { - _ = libc.Int32FromInt32(0) _sqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 20))) } else { _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 20))) - if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { _sqlite3WindowDelete(tls, db, *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(p)).Fy))) } } } - if (*TExpr)(unsafe.Pointer(p)).FpLeft != 0 && int32((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_SELECT_COLUMN) { + if (*TExpr)(unsafe.Pointer(p)).FpLeft != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_SELECT_COLUMN) { pLeft = (*TExpr)(unsafe.Pointer(p)).FpLeft - if !((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_Static)) != libc.Uint32FromInt32(0)) && !((*TExpr)(unsafe.Pointer(pLeft)).Fflags&uint32(libc.Int32FromInt32(EP_Static)) != libc.Uint32FromInt32(0)) { + if !((*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) != libc.Uint32FromInt32(0)) && !((*TExpr)(unsafe.Pointer(pLeft)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) != libc.Uint32FromInt32(0)) { /* Avoid unnecessary recursion on unary operators */ _sqlite3DbNNFreeNN(tls, db, p) p = pLeft @@ -86702,7 +82679,7 @@ exprDeleteRestart: } } } - if !((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_Static)) != libc.Uint32FromInt32(0)) { + if !((*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) != libc.Uint32FromInt32(0)) { _sqlite3DbNNFreeNN(tls, db, p) } } @@ -86761,7 +82738,7 @@ func _sqlite3ExprDeferredDelete(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r // */ func _sqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { if p != 0 { - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameExprUnmap(tls, pParse, p) } _sqlite3ExprDeleteNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, p) @@ -86776,11 +82753,11 @@ func _sqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { // ** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE. // */ func _exprStructSize(tls *libc.TLS, p uintptr) (r int32) { - if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_TokenOnly)) != uint32(0) { - return int32(uint32(libc.UintptrFromInt32(0) + 12)) + if (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_TokenOnly)) != uint32(0) { + return libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0) + 12)) } - if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_Reduced)) != uint32(0) { - return int32(uint32(libc.UintptrFromInt32(0) + 28)) + if (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Reduced)) != uint32(0) { + return libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0) + 28)) } return int32(52) } @@ -86824,20 +82801,14 @@ func _exprStructSize(tls *libc.TLS, p uintptr) (r int32) { func _dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) (r int32) { var nSize int32 _ = nSize - _ = libc.Int32FromInt32(0) /* Only one flag value allowed */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if 0 == flags || (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_FullSize)) != uint32(0) { + /* Only one flag value allowed */ + if 0 == flags || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FullSize)) != uint32(0) { nSize = int32(52) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TExpr)(unsafe.Pointer(p)).FpLeft != 0 || *(*uintptr)(unsafe.Pointer(p + 20)) != 0 { - nSize = int32(uint32(libc.UintptrFromInt32(0)+28) | libc.Uint32FromInt32(EP_Reduced)) + nSize = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+28) | libc.Uint32FromInt32(EP_Reduced)) } else { - _ = libc.Int32FromInt32(0) - nSize = int32(uint32(libc.UintptrFromInt32(0)+12) | libc.Uint32FromInt32(EP_TokenOnly)) + nSize = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+12) | libc.Uint32FromInt32(EP_TokenOnly)) } } return nSize @@ -86854,7 +82825,7 @@ func _dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) (r int32) { var nByte int32 _ = nByte nByte = _dupedExprStructSize(tls, p, flags) & int32(0xfff) - if !((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 { + if !((*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 { nByte = int32(uint32(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8)))&libc.Uint32FromInt32(0x3fffffff) + libc.Uint32FromInt32(1))) } return (nByte + int32(7)) & ^libc.Int32FromInt32(7) @@ -86876,7 +82847,6 @@ func _dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) (r int32) { func _dupedExprSize(tls *libc.TLS, p uintptr) (r int32) { var nByte int32 _ = nByte - _ = libc.Int32FromInt32(0) nByte = _dupedExprNodeSize(tls, p, int32(EXPRDUP_REDUCE)) if (*TExpr)(unsafe.Pointer(p)).FpLeft != 0 { nByte += _dupedExprSize(tls, (*TExpr)(unsafe.Pointer(p)).FpLeft) @@ -86884,7 +82854,6 @@ func _dupedExprSize(tls *libc.TLS, p uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(p)).FpRight != 0 { nByte += _dupedExprSize(tls, (*TExpr)(unsafe.Pointer(p)).FpRight) } - _ = libc.Int32FromInt32(0) return nByte } @@ -86928,56 +82897,45 @@ func _exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pEdupBuf uin var _ /* sEdupBuf at bp+0 */ TEdupBuf _, _, _, _, _, _, _, _, _, _, _, _ = nAlloc, nNewSize, nSize, nStructSize, nToken, pNew, staticFlag, zToken, v1, v2, v3, v4 /* EP_Static if space not obtained from malloc */ nToken = -int32(1) /* Space needed for p->u.zToken. -1 means unknown */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Figure out where to write the new Expr structure. */ if pEdupBuf != 0 { (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc = (*TEdupBuf)(unsafe.Pointer(pEdupBuf)).FzAlloc staticFlag = uint32(EP_Static) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } else { if dupFlags != 0 { nAlloc = _dupedExprSize(tls, p) } else { - if !((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 { - nToken = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8)))&uint32(0x3fffffff) + uint32(1)) - nAlloc = int32((libc.Uint32FromInt64(52) + uint32(nToken) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + if !((*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 { + nToken = libc.Int32FromUint32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8)))&uint32(0x3fffffff) + uint32(1)) + nAlloc = libc.Int32FromUint32((libc.Uint32FromInt64(52) + libc.Uint32FromInt32(nToken) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) } else { nToken = 0 - nAlloc = int32((libc.Uint32FromInt64(52) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + nAlloc = libc.Int32FromUint32((libc.Uint32FromInt64(52) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) } } - _ = libc.Int32FromInt32(0) - (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc = _sqlite3DbMallocRawNN(tls, db, uint64(nAlloc)) + (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nAlloc)) staticFlag = uint32(0) } pNew = (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc - _ = libc.Int32FromInt32(0) if pNew != 0 { /* Set nNewSize to the size allocated for the structure pointed to ** by pNew. This is either EXPR_FULLSIZE, EXPR_REDUCEDSIZE or ** EXPR_TOKENONLYSIZE. nToken is set to the number of bytes consumed ** by the copy of the p->u.zToken string (if any). */ - nStructSize = uint32(_dupedExprStructSize(tls, p, dupFlags)) - nNewSize = int32(nStructSize & uint32(0xfff)) + nStructSize = libc.Uint32FromInt32(_dupedExprStructSize(tls, p, dupFlags)) + nNewSize = libc.Int32FromUint32(nStructSize & uint32(0xfff)) if nToken < 0 { - if !((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 { + if !((*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 { nToken = _sqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8))) + int32(1) } else { nToken = 0 } } if dupFlags != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc, p, uint32(nNewSize)) + libc.Xmemcpy(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc, p, libc.Uint32FromInt32(nNewSize)) } else { - nSize = uint32(_exprStructSize(tls, p)) - _ = libc.Int32FromInt32(0) + nSize = libc.Uint32FromInt32(_exprStructSize(tls, p)) libc.Xmemcpy(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc, p, nSize) if nSize < uint32(52) { libc.Xmemset(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc+uintptr(nSize), 0, uint32(52)-nSize) @@ -86985,42 +82943,39 @@ func _exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pEdupBuf uin nNewSize = int32(52) } /* Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately. */ - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= uint32(^(libc.Int32FromInt32(EP_Reduced) | libc.Int32FromInt32(EP_TokenOnly) | libc.Int32FromInt32(EP_Static))) - *(*Tu32)(unsafe.Pointer(pNew + 4)) |= nStructSize & uint32(libc.Int32FromInt32(EP_Reduced)|libc.Int32FromInt32(EP_TokenOnly)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Reduced) | libc.Int32FromInt32(EP_TokenOnly) | libc.Int32FromInt32(EP_Static))) + *(*Tu32)(unsafe.Pointer(pNew + 4)) |= nStructSize & libc.Uint32FromInt32(libc.Int32FromInt32(EP_Reduced)|libc.Int32FromInt32(EP_TokenOnly)) *(*Tu32)(unsafe.Pointer(pNew + 4)) |= staticFlag if dupFlags != 0 { } /* Copy the p->u.zToken string, if any. */ - _ = libc.Int32FromInt32(0) if nToken > 0 { v1 = (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc + uintptr(nNewSize) *(*uintptr)(unsafe.Pointer(pNew + 8)) = v1 zToken = v1 - libc.Xmemcpy(tls, zToken, *(*uintptr)(unsafe.Pointer(p + 8)), uint32(nToken)) + libc.Xmemcpy(tls, zToken, *(*uintptr)(unsafe.Pointer(p + 8)), libc.Uint32FromInt32(nToken)) nNewSize += nToken } (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc += uintptr((nNewSize + libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)) - if ((*TExpr)(unsafe.Pointer(p)).Fflags|(*TExpr)(unsafe.Pointer(pNew)).Fflags)&uint32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) == uint32(0) { + if ((*TExpr)(unsafe.Pointer(p)).Fflags|(*TExpr)(unsafe.Pointer(pNew)).Fflags)&libc.Uint32FromInt32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) == uint32(0) { /* Fill in the pNew->x.pSelect or pNew->x.pList member. */ if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_xIsSelect) != uint32(0) { *(*uintptr)(unsafe.Pointer(pNew + 20)) = _sqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 20)), dupFlags) } else { - if int32((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_ORDER) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_ORDER) { v2 = dupFlags } else { v2 = 0 } *(*uintptr)(unsafe.Pointer(pNew + 20)) = _sqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 20)), v2) } - if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pNew)).Fy)) = _sqlite3WindowDup(tls, db, pNew, *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(p)).Fy))) - _ = libc.Int32FromInt32(0) } /* Fill in pNew->pLeft and pNew->pRight. */ if dupFlags != 0 { - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_SELECT_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_SELECT_COLUMN) { (*TExpr)(unsafe.Pointer(pNew)).FpLeft = (*TExpr)(unsafe.Pointer(p)).FpLeft - _ = libc.Int32FromInt32(0) } else { if (*TExpr)(unsafe.Pointer(p)).FpLeft != 0 { v3 = _exprDup(tls, db, (*TExpr)(unsafe.Pointer(p)).FpLeft, int32(EXPRDUP_REDUCE), bp) @@ -87036,9 +82991,8 @@ func _exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pEdupBuf uin } (*TExpr)(unsafe.Pointer(pNew)).FpRight = v4 } else { - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_SELECT_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_SELECT_COLUMN) { (*TExpr)(unsafe.Pointer(pNew)).FpLeft = (*TExpr)(unsafe.Pointer(p)).FpLeft - _ = libc.Int32FromInt32(0) } else { (*TExpr)(unsafe.Pointer(pNew)).FpLeft = _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer(p)).FpLeft, 0) } @@ -87049,7 +83003,6 @@ func _exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pEdupBuf uin if pEdupBuf != 0 { libc.Xmemcpy(tls, pEdupBuf, bp, uint32(4)) } - _ = libc.Int32FromInt32(0) return pNew } @@ -87067,8 +83020,8 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = int64(uint32(36) + uint32(24)*uint32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) - pRet = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(36) + uint32(24)*libc.Uint32FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte i = 0 @@ -87101,12 +83054,9 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { func _gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { var pSelect, pWin uintptr _, _ = pSelect, pWin - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { pSelect = *(*uintptr)(unsafe.Pointer(pWalker + 24)) pWin = *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3WindowLink(tls, pSelect, pWin) } return WRC_Continue @@ -87157,7 +83107,6 @@ func _gatherSelectWindows(tls *libc.TLS, p uintptr) { func _sqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { var v1 uintptr _ = v1 - _ = libc.Int32FromInt32(0) if p != 0 { v1 = _exprDup(tls, db, p, flags, uintptr(0)) } else { @@ -87173,11 +83122,10 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u _, _, _, _, _, _, _, _, _, _ = i, pItem, pNew, pNewExpr, pOldExpr, pOldItem, pPriorSelectColNew, pPriorSelectColOld, v2, v3 pPriorSelectColOld = uintptr(0) pPriorSelectColNew = uintptr(0) - _ = libc.Int32FromInt32(0) if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(_sqlite3DbMallocSize(tls, db, p))) + pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(_sqlite3DbMallocSize(tls, db, p))) if pNew == uintptr(0) { return uintptr(0) } @@ -87192,7 +83140,7 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } pOldExpr = (*TExprList_item)(unsafe.Pointer(pOldItem)).FpExpr (*TExprList_item)(unsafe.Pointer(pItem)).FpExpr = _sqlite3ExprDup(tls, db, pOldExpr, flags) - if v3 = pOldExpr != 0 && int32((*TExpr)(unsafe.Pointer(pOldExpr)).Fop) == int32(TK_SELECT_COLUMN); v3 { + if v3 = pOldExpr != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pOldExpr)).Fop) == int32(TK_SELECT_COLUMN); v3 { v2 = (*TExprList_item)(unsafe.Pointer(pItem)).FpExpr pNewExpr = v2 } @@ -87238,23 +83186,22 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui var v1 uint32 var v2 Tu32 _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pOldItem, pTab, v1, v2, v4 - _ = libc.Int32FromInt32(0) if p == uintptr(0) { return uintptr(0) } if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint32(68) * uint32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) + v1 = uint32(68) * libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) } else { v1 = uint32(0) } - nByte = int32(uint32(76) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(nByte)) + nByte = libc.Int32FromUint32(uint32(76) + v1) + pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) if pNew == uintptr(0) { return uintptr(0) } - v2 = uint32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = int32(v2) + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -87292,7 +83239,6 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui } (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSelect = _sqlite3SelectDup(tls, db, (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSelect, flags) if int32(uint32(*(*uint16)(unsafe.Pointer(pOldItem + 36 + 4))&0x400>>10)) != 0 { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pNewItem + 48)) = _sqlite3IdListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 48))) } else { *(*uintptr)(unsafe.Pointer(pNewItem + 48)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 48)), flags) @@ -87310,12 +83256,10 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { var i int32 var pNew, pNewItem, pOldItem uintptr _, _, _, _ = i, pNew, pNewItem, pOldItem - _ = libc.Int32FromInt32(0) if p == uintptr(0) { return uintptr(0) } - _ = libc.Int32FromInt32(0) - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(16)+uint32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint32(8))) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(16)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint32(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -87347,7 +83291,6 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pNext = uintptr(0) pp = bp - _ = libc.Int32FromInt32(0) p = pDup for { if !(p != 0) { @@ -87369,14 +83312,14 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & uint32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow (*TSelect)(unsafe.Pointer(pNew)).FpWith = _sqlite3WithDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpWith) (*TSelect)(unsafe.Pointer(pNew)).FpWin = uintptr(0) (*TSelect)(unsafe.Pointer(pNew)).FpWinDefn = _sqlite3WindowListDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpWinDefn) - if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { _gatherSelectWindows(tls, pNew) } (*TSelect)(unsafe.Pointer(pNew)).FselId = (*TSelect)(unsafe.Pointer(p)).FselId @@ -87468,7 +83411,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(28)+uint32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint32(20))) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(28)+libc.Uint32FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint32(20))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -87544,7 +83487,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** wildcards ("*") in the result set of the SELECT must be expanded before ** we can do the size check, so defer the size check until code generation. */ - if v3 = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_SELECT); v3 { + if v3 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_SELECT); v3 { v2 = _sqlite3ExprVectorSize(tls, pExpr) n = v2 } @@ -87558,13 +83501,11 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, break } pSubExpr = _sqlite3ExprForVectorField(tls, pParse, pExpr, i, (*TIdList)(unsafe.Pointer(pColumns)).FnId) - _ = libc.Int32FromInt32(0) if pSubExpr == uintptr(0) { goto _4 } pList = _sqlite3ExprListAppend(tls, pParse, pList, pSubExpr) if pList != 0 { - _ = libc.Int32FromInt32(0) (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr((*TExprList)(unsafe.Pointer(pList)).FnExpr-int32(1))*20))).FzEName = (*(*TIdList_item)(unsafe.Pointer(pColumns + 8 + uintptr(i)*8))).FzName (*(*TIdList_item)(unsafe.Pointer(pColumns + 8 + uintptr(i)*8))).FzName = uintptr(0) } @@ -87573,10 +83514,8 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ; i++ } - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) && pList != uintptr(0) { + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) && pList != uintptr(0) { pFirst = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(iFirst)*20))).FpExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Store the SELECT statement in pRight so it will be deleted when ** sqlite3ExprListDelete() is called */ (*TExpr)(unsafe.Pointer(pFirst)).FpRight = pExpr @@ -87604,16 +83543,11 @@ func _sqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eN if p == uintptr(0) { return } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pItem = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*20 - _ = libc.Int32FromInt32(0) if iSortOrder == -int32(1) { iSortOrder = SQLITE_SO_ASC } - (*TExprList_item)(unsafe.Pointer(pItem)).Ffg.FsortFlags = uint8(iSortOrder) + (*TExprList_item)(unsafe.Pointer(pItem)).Ffg.FsortFlags = libc.Uint8FromInt32(iSortOrder) if eNulls != -int32(1) { libc.SetBitFieldPtr16Uint32(pItem+8+4, libc.Uint32FromInt32(1), 5, 0x20) if iSortOrder != eNulls { @@ -87636,20 +83570,15 @@ func _sqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eN func _sqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) { var pItem uintptr _ = pItem - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pList != 0 { - _ = libc.Int32FromInt32(0) pItem = pList + 8 + uintptr((*TExprList)(unsafe.Pointer(pList)).FnExpr-int32(1))*20 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrNDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TToken)(unsafe.Pointer(pName)).Fz, uint64((*TToken)(unsafe.Pointer(pName)).Fn)) if dequote != 0 { /* If dequote==0, then pName->z does not point to part of a DDL ** statement handled by the parser. And so no token need be added ** to the token-map. */ _sqlite3Dequote(tls, (*TExprList_item)(unsafe.Pointer(pItem)).FzEName) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenMap(tls, pParse, (*TExprList_item)(unsafe.Pointer(pItem)).FzEName, pName) } } @@ -87670,10 +83599,8 @@ func _sqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStar var db, pItem uintptr _, _ = db, pItem db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if pList != 0 { pItem = pList + 8 + uintptr((*TExprList)(unsafe.Pointer(pList)).FnExpr-int32(1))*20 - _ = libc.Int32FromInt32(0) if (*TExprList_item)(unsafe.Pointer(pItem)).FzEName == uintptr(0) { (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbSpanDup(tls, db, zStart, zEnd) libc.SetBitFieldPtr16Uint32(pItem+8+4, libc.Uint32FromInt32(ENAME_SPAN), 0, 0x3) @@ -87709,8 +83636,6 @@ func _exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { _, _, _ = i, pItem, v1 i = (*TExprList)(unsafe.Pointer(pList)).FnExpr pItem = pList + 8 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for { _sqlite3ExprDelete(tls, db, (*TExprList_item)(unsafe.Pointer(pItem)).FpExpr) if (*TExprList_item)(unsafe.Pointer(pItem)).FzEName != 0 { @@ -87753,14 +83678,12 @@ func _sqlite3ExprListFlags(tls *libc.TLS, pList uintptr) (r Tu32) { var pExpr uintptr _, _, _ = i, m, pExpr m = uint32(0) - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pList)).FnExpr) { break } pExpr = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr - _ = libc.Int32FromInt32(0) m |= (*TExpr)(unsafe.Pointer(pExpr)).Fflags goto _1 _1: @@ -87816,8 +83739,7 @@ func _sqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) (r int32) { var v, v1 Tu32 var v2 bool _, _, _ = v, v1, v2 - _ = libc.Int32FromInt32(0) - if v2 = !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Quoted)|libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)); v2 { + if v2 = !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Quoted)|libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)); v2 { v1 = _sqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8))) v = v1 } @@ -87837,9 +83759,6 @@ func _sqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) (r int32) { // */ func _sqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) (r int32) { pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8)) + 4))) == 0) } @@ -87861,20 +83780,19 @@ func _sqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) (r int32) { func _sqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) (r uintptr) { var pLeft, pRight, v1, v2 uintptr _, _, _, _ = pLeft, pRight, v1, v2 - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_OR) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_OR) { pRight = _sqlite3ExprSimplifiedAndOr(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) pLeft = _sqlite3ExprSimplifiedAndOr(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - if (*TExpr)(unsafe.Pointer(pLeft)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) || (*TExpr)(unsafe.Pointer(pRight)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) { + if (*TExpr)(unsafe.Pointer(pLeft)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) || (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) { v1 = pRight } else { v1 = pLeft } pExpr = v1 } else { - if (*TExpr)(unsafe.Pointer(pRight)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) || (*TExpr)(unsafe.Pointer(pLeft)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) { + if (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) || (*TExpr)(unsafe.Pointer(pLeft)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) { v2 = pLeft } else { v2 = pRight @@ -87909,8 +83827,7 @@ func _exprNodeIsConstantFunction(tls *libc.TLS, pWalker uintptr, pExpr uintptr) var n int32 var v2 bool _, _, _, _, _, _ = db, n, pDef, pList, v1, v2 /* The database */ - _ = libc.Int32FromInt32(0) - if v2 = (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_TokenOnly)) != uint32(0); !v2 { + if v2 = (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_TokenOnly)) != uint32(0); !v2 { v1 = *(*uintptr)(unsafe.Pointer(pExpr + 20)) pList = v1 } @@ -87919,13 +83836,13 @@ func _exprNodeIsConstantFunction(tls *libc.TLS, pWalker uintptr, pExpr uintptr) } else { n = (*TExprList)(unsafe.Pointer(pList)).FnExpr _sqlite3WalkExprList(tls, pWalker, pList) - if int32((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == 0 { + if libc.Int32FromUint16((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == 0 { return int32(WRC_Abort) } } db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb pDef = _sqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8)), n, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, uint8(0)) - if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)|libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG)) == uint32(0) || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)|libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG)) == uint32(0) || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(0) return int32(WRC_Abort) } @@ -87961,22 +83878,21 @@ func _exprNodeIsConstantFunction(tls *libc.TLS, pWalker uintptr, pExpr uintptr) // ** malformed schema error. // */ func _exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - _ = libc.Int32FromInt32(0) /* If pWalker->eCode is 2 then any term of the expression that comes from ** the ON or USING clauses of an outer join disqualifies the expression ** from being considered constant. */ - if int32((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(2) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { + if libc.Int32FromUint16((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(2) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(0) return int32(WRC_Abort) } - switch int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) { /* Consider functions to be constant if all their arguments are constant ** and either pWalker->eCode==4 or 5 or the function has the ** SQLITE_FUNC_CONST flag. */ case int32(TK_FUNCTION): - if (int32((*TWalker)(unsafe.Pointer(pWalker)).FeCode) >= int32(4) || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_ConstFunc)) != uint32(0)) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { - if int32((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(5) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FromDDL)) + if (libc.Int32FromUint16((*TWalker)(unsafe.Pointer(pWalker)).FeCode) >= int32(4) || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_ConstFunc)) != uint32(0)) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { + if libc.Int32FromUint16((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(5) { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) } return WRC_Continue } else { @@ -88000,10 +83916,10 @@ func _exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32 case int32(TK_AGG_FUNCTION): fallthrough case int32(TK_AGG_COLUMN): - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_FixedCol)) != uint32(0) && int32((*TWalker)(unsafe.Pointer(pWalker)).FeCode) != int32(2) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) != uint32(0) && libc.Int32FromUint16((*TWalker)(unsafe.Pointer(pWalker)).FeCode) != int32(2) { return WRC_Continue } - if int32((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(3) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == *(*int32)(unsafe.Pointer(pWalker + 24)) { + if libc.Int32FromUint16((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(3) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == *(*int32)(unsafe.Pointer(pWalker + 24)) { return WRC_Continue } fallthrough @@ -88017,13 +83933,13 @@ func _exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32 (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(0) return int32(WRC_Abort) case int32(TK_VARIABLE): - if int32((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(5) { + if libc.Int32FromUint16((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(5) { /* Silently convert bound parameters that appear inside of CREATE ** statements into a NULL when parsing the CREATE statement text out ** of the sqlite_schema table */ (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - if int32((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(4) { + if libc.Int32FromUint16((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == int32(4) { /* A bound parameter in a CREATE statement that originates from ** sqlite3_prepare() causes an error */ (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(0) @@ -88043,12 +83959,12 @@ func _exprIsConst(tls *libc.TLS, pParse uintptr, p uintptr, initFlag int32) (r i bp := tls.Alloc(32) defer tls.Free(32) var _ /* w at bp+0 */ TWalker - (*(*TWalker)(unsafe.Pointer(bp))).FeCode = uint16(initFlag) + (*(*TWalker)(unsafe.Pointer(bp))).FeCode = libc.Uint16FromInt32(initFlag) (*(*TWalker)(unsafe.Pointer(bp))).FpParse = pParse (*(*TWalker)(unsafe.Pointer(bp))).FxExprCallback = __ccgo_fp(_exprNodeIsConstant) (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkFail) _sqlite3WalkExpr(tls, bp, p) - return int32((*(*TWalker)(unsafe.Pointer(bp))).FeCode) + return libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode) } // C documentation @@ -88099,8 +84015,6 @@ func _sqlite3ExprIsConstantNotJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r // ** contain any terms from outer contexts. // */ func _exprSelectWalkTableConstant(tls *libc.TLS, pWalker uintptr, pSelect uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer(pSelect)).FselFlags&uint32(SF_Correlated) != uint32(0) { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(0) return int32(WRC_Abort) @@ -88133,7 +84047,7 @@ func _sqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32, bAllowSub } *(*int32)(unsafe.Pointer(bp + 24)) = iCur _sqlite3WalkExpr(tls, bp, p) - return int32((*(*TWalker)(unsafe.Pointer(bp))).FeCode) + return libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode) } // C documentation @@ -88187,29 +84101,29 @@ func _sqlite3ExprIsSingleTableConstraint(tls *libc.TLS, pExpr uintptr, pSrcList var pSrc uintptr _, _ = jj, pSrc pSrc = pSrcList + 8 + uintptr(iSrc)*68 - if int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { return 0 /* rule (3) */ } - if int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { + if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) { return 0 } /* rule (4a) */ if *(*int32)(unsafe.Pointer(pExpr + 36)) != (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { return 0 } /* rule (4b) */ } else { - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 } /* rule (5) */ } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) && int32((*(*TSrcItem)(unsafe.Pointer(pSrcList + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrcList + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { jj = 0 for { if !(jj < iSrc) { break } if *(*int32)(unsafe.Pointer(pExpr + 36)) == (*(*TSrcItem)(unsafe.Pointer(pSrcList + 8 + uintptr(jj)*68))).FiCursor { - if int32((*(*TSrcItem)(unsafe.Pointer(pSrcList + 8 + uintptr(jj)*68))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrcList + 8 + uintptr(jj)*68))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { return 0 /* restriction (6) */ } break @@ -88292,7 +84206,7 @@ func _sqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, p *(*uintptr)(unsafe.Pointer(bp + 24)) = pGroupBy (*(*TWalker)(unsafe.Pointer(bp))).FpParse = pParse _sqlite3WalkExpr(tls, bp, p) - return int32((*(*TWalker)(unsafe.Pointer(bp))).FeCode) + return libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode) } // C documentation @@ -88319,8 +84233,7 @@ func _sqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, p // ** a constant. // */ func _sqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit Tu8) (r int32) { - _ = libc.Int32FromInt32(0) - return _exprIsConst(tls, uintptr(0), p, int32(4)+int32(isInit)) + return _exprIsConst(tls, uintptr(0), p, int32(4)+libc.Int32FromUint8(isInit)) } // C documentation @@ -88343,18 +84256,16 @@ func _sqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) (r int32) { } /* Used to only happen following on OOM */ /* If an expression is an integer literal that fits in a signed 32-bit ** integer, then the EP_IntValue flag will have already been set */ - _ = libc.Int32FromInt32(0) if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_IntValue) != 0 { *(*int32)(unsafe.Pointer(pValue)) = *(*int32)(unsafe.Pointer(p + 8)) return int32(1) } - switch int32((*TExpr)(unsafe.Pointer(p)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) { case int32(TK_UPLUS): rc = _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer(p)).FpLeft, pValue) case int32(TK_UMINUS): *(*int32)(unsafe.Pointer(bp)) = 0 if _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer(p)).FpLeft, bp) != 0 { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pValue)) = -*(*int32)(unsafe.Pointer(bp)) rc = int32(1) } @@ -88383,16 +84294,14 @@ func _sqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) (r int32) { func _sqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) (r int32) { var op Tu8 _ = op - _ = libc.Int32FromInt32(0) - for int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UPLUS) || int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UMINUS) { + for libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UPLUS) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UMINUS) { p = (*TExpr)(unsafe.Pointer(p)).FpLeft - _ = libc.Int32FromInt32(0) } op = (*TExpr)(unsafe.Pointer(p)).Fop - if int32(op) == int32(TK_REGISTER) { + if libc.Int32FromUint8(op) == int32(TK_REGISTER) { op = (*TExpr)(unsafe.Pointer(p)).Fop2 } - switch int32(op) { + switch libc.Int32FromUint8(op) { case int32(TK_INTEGER): fallthrough case int32(TK_STRING): @@ -88402,8 +84311,7 @@ func _sqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) (r int32) { case int32(TK_BLOB): return 0 case int32(TK_COLUMN): - _ = libc.Int32FromInt32(0) - return libc.BoolInt32((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_CanBeNull)) != uint32(0) || (*TExpr)(unsafe.Pointer(p)).Fy.FpTab == uintptr(0) || int32((*TExpr)(unsafe.Pointer(p)).FiColumn) >= 0 && (*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(p)).Fy.FpTab)).FaCol != uintptr(0) && int32((*TExpr)(unsafe.Pointer(p)).FiColumn) < int32((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(p)).Fy.FpTab)).FnCol) && int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(p)).Fy.FpTab)).FaCol + uintptr((*TExpr)(unsafe.Pointer(p)).FiColumn)*12 + 4))&0xf>>0)) == 0) + return libc.BoolInt32((*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) != uint32(0) || (*TExpr)(unsafe.Pointer(p)).Fy.FpTab == uintptr(0) || int32((*TExpr)(unsafe.Pointer(p)).FiColumn) >= 0 && (*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(p)).Fy.FpTab)).FaCol != uintptr(0) && int32((*TExpr)(unsafe.Pointer(p)).FiColumn) < int32((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(p)).Fy.FpTab)).FnCol) && int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(p)).Fy.FpTab)).FaCol + uintptr((*TExpr)(unsafe.Pointer(p)).FiColumn)*12 + 4))&0xf>>0)) == 0) default: return int32(1) } @@ -88430,17 +84338,17 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in if int32(aff) == int32(SQLITE_AFF_BLOB) { return int32(1) } - for int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UPLUS) || int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UMINUS) { - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UMINUS) { + for libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UPLUS) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UMINUS) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UMINUS) { unaryMinus = int32(1) } p = (*TExpr)(unsafe.Pointer(p)).FpLeft } op = (*TExpr)(unsafe.Pointer(p)).Fop - if int32(op) == int32(TK_REGISTER) { + if libc.Int32FromUint8(op) == int32(TK_REGISTER) { op = (*TExpr)(unsafe.Pointer(p)).Fop2 } - switch int32(op) { + switch libc.Int32FromUint8(op) { case int32(TK_INTEGER): return libc.BoolInt32(int32(aff) >= int32(SQLITE_AFF_NUMERIC)) case int32(TK_FLOAT): @@ -88450,7 +84358,7 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in case int32(TK_BLOB): return libc.BoolInt32(!(unaryMinus != 0)) case int32(TK_COLUMN): - _ = libc.Int32FromInt32(0) /* p cannot be part of a CHECK constraint */ + /* p cannot be part of a CHECK constraint */ return libc.BoolInt32(int32(aff) >= int32(SQLITE_AFF_NUMERIC) && int32((*TExpr)(unsafe.Pointer(p)).FiColumn) < 0) default: return 0 @@ -88492,10 +84400,9 @@ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { 1: __ccgo_ts + 8030, 2: __ccgo_ts + 8036, } - _ = libc.Int32FromInt32(0) ii = 0 for { - if !(ii < int32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(4))) { + if !(ii < libc.Int32FromUint32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(4))) { break } iCol = 0 @@ -88538,17 +84445,17 @@ func _isCandidateForInOpt(tls *libc.TLS, pX uintptr) (r uintptr) { if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) { return uintptr(0) } /* Not a subquery */ - if (*TExpr)(unsafe.Pointer(pX)).Fflags&uint32(libc.Int32FromInt32(EP_VarSelect)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_VarSelect)) != uint32(0) { return uintptr(0) } /* Correlated subq */ p = *(*uintptr)(unsafe.Pointer(pX + 20)) if (*TSelect)(unsafe.Pointer(p)).FpPrior != 0 { return uintptr(0) } /* Not a compound SELECT */ - if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) != 0 { return uintptr(0) /* No DISTINCT keyword and no aggregate functions */ } - _ = libc.Int32FromInt32(0) /* Has no GROUP BY clause */ + /* Has no GROUP BY clause */ if (*TSelect)(unsafe.Pointer(p)).FpLimit != 0 { return uintptr(0) } /* Has no LIMIT clause */ @@ -88556,7 +84463,6 @@ func _isCandidateForInOpt(tls *libc.TLS, pX uintptr) (r uintptr) { return uintptr(0) } /* Has no WHERE clause */ pSrc = (*TSelect)(unsafe.Pointer(p)).FpSrc - _ = libc.Int32FromInt32(0) if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != int32(1) { return uintptr(0) } /* Single term in FROM clause */ @@ -88564,13 +84470,11 @@ func _isCandidateForInOpt(tls *libc.TLS, pX uintptr) (r uintptr) { return uintptr(0) } /* FROM is not a subquery or view */ pTab = (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpTab - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* FROM clause is not a view */ - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + /* FROM clause is not a view */ + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { return uintptr(0) } /* FROM clause not a virtual table */ pEList = (*TSelect)(unsafe.Pointer(p)).FpEList - _ = libc.Int32FromInt32(0) /* All SELECT results must be columns. */ i = 0 for { @@ -88578,10 +84482,10 @@ func _isCandidateForInOpt(tls *libc.TLS, pX uintptr) (r uintptr) { break } pRes = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pRes)).Fop) != int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRes)).Fop) != int32(TK_COLUMN) { return uintptr(0) } - _ = libc.Int32FromInt32(0) /* Not a correlated subquery */ + /* Not a correlated subquery */ goto _1 _1: ; @@ -88618,7 +84522,6 @@ func _sqlite3InRhsIsConstant(tls *libc.TLS, pParse uintptr, pIn uintptr) (r int3 var pLHS uintptr var res int32 _, _ = pLHS, res - _ = libc.Int32FromInt32(0) pLHS = (*TExpr)(unsafe.Pointer(pIn)).FpLeft (*TExpr)(unsafe.Pointer(pIn)).FpLeft = uintptr(0) res = _sqlite3ExprIsConstant(tls, pParse, pIn) @@ -88723,7 +84626,6 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = affinity_ok, cmpaff, colUsed, db, eType, i, i1, i2, iAddr, iAddr1, iCol, iDb, iTab, idxaff, j, mCol, mustBeUnique, n, nExpr, p, pEList, pEList1, pIdx, pLhs, pLhs1, pReq, pRhs, pTab, rMayHaveNull, savedNQueryLoop, v, v1, v10, v11, v12, v13, v14, v2, v4, v5 /* SELECT to the right of IN operator */ eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ - _ = libc.Int32FromInt32(0) mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) v2 = pParse + 40 v1 = *(*int32)(unsafe.Pointer(v2)) @@ -88764,16 +84666,15 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Database idx for pTab */ pEList1 = (*TSelect)(unsafe.Pointer(p)).FpEList nExpr = (*TExprList)(unsafe.Pointer(pEList1)).FnExpr - _ = libc.Int32FromInt32(0) /* Because of isCandidateForInOpt(p) */ - _ = libc.Int32FromInt32(0) /* Because of isCandidateForInOpt(p) */ - _ = libc.Int32FromInt32(0) /* Because of isCandidateForInOpt(p) */ + /* Because of isCandidateForInOpt(p) */ + /* Because of isCandidateForInOpt(p) */ + /* Because of isCandidateForInOpt(p) */ pTab = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpTab /* Code an OP_Transaction and OP_TableLock for <table>. */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _ = libc.Int32FromInt32(0) _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3TableLock(tls, pParse, iDb, (*TTable)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*TTable)(unsafe.Pointer(pTab)).FzName) - _ = libc.Int32FromInt32(0) /* sqlite3GetVdbe() has always been previously called */ + /* sqlite3GetVdbe() has always been previously called */ if nExpr == int32(1) && int32((*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pEList1 + 8))).FpExpr)).FiColumn) < 0 { /* The "x IN (SELECT rowid FROM table)" case */ iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) @@ -88803,7 +84704,6 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 ** other has no affinity and the other side is TEXT. Hence, ** the only way for cmpaff to be TEXT is for idxaff to be TEXT ** and for the term on the LHS of the IN to have no affinity. */ - _ = libc.Int32FromInt32(0) default: affinity_ok = libc.BoolInt32(int32(idxaff) >= int32(SQLITE_AFF_NUMERIC)) } @@ -88819,7 +84719,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if !(pIdx != 0 && eType == 0) { break } /* Mask for the current column */ - if int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) < nExpr { + if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) < nExpr { goto _7 } if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) { @@ -88827,11 +84727,11 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 } /* Maximum nColumn is BMS-2, not BMS-1, so that we can compute ** BITMASK(nExpr) without overflowing */ - if int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { + if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { goto _7 } if mustBeUnique != 0 { - if int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) > nExpr || int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) > nExpr && !(int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) != libc.Int32FromInt32(OE_None)) { + if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) > nExpr || libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) > nExpr && !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) != libc.Int32FromInt32(OE_None)) { goto _7 /* This index is not unique over the IN RHS columns */ } } @@ -88852,7 +84752,6 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2))) != int32((*TExpr)(unsafe.Pointer(pRhs)).FiColumn) { goto _9 } - _ = libc.Int32FromInt32(0) if pReq != uintptr(0) && _sqlite3StrICmp(tls, (*TCollSeq)(unsafe.Pointer(pReq)).FzName, *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4))) != 0 { goto _9 } @@ -88878,15 +84777,13 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 ; i1++ } - _ = libc.Int32FromInt32(0) if colUsed == libc.Uint64FromInt32(1)<<nExpr-uint64(1) { /* If we reach this point, that means the index pIdx is usable */ iAddr1 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8087, libc.VaList(bp+8, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), iTab, int32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), iTab, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) - _ = libc.Int32FromInt32(0) - eType = int32(IN_INDEX_INDEX_ASC) + int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder))) + eType = int32(IN_INDEX_INDEX_ASC) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder))) if prRhsHasNull != 0 { v11 = pParse + 44 *(*int32)(unsafe.Pointer(v11))++ @@ -88922,7 +84819,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 /* Could not find an existing table or index to use as the RHS b-tree. ** We will have to generate an ephemeral table to do the job. */ - savedNQueryLoop = uint32((*TParse)(unsafe.Pointer(pParse)).FnQueryLoop) + savedNQueryLoop = libc.Uint32FromInt16((*TParse)(unsafe.Pointer(pParse)).FnQueryLoop) rMayHaveNull = 0 eType = int32(IN_INDEX_EPH) if inFlags&uint32(IN_INDEX_LOOP) != 0 { @@ -88937,12 +84834,11 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 *(*int32)(unsafe.Pointer(prRhsHasNull)) = v12 } } - _ = libc.Int32FromInt32(0) _sqlite3CodeRhsOfIN(tls, pParse, pX, iTab) if rMayHaveNull != 0 { _sqlite3SetHasNullFlag(tls, v, iTab, rMayHaveNull) } - (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16(savedNQueryLoop) + (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = libc.Int16FromUint32(savedNQueryLoop) } if aiMap != 0 && eType != int32(IN_INDEX_INDEX_ASC) && eType != int32(IN_INDEX_INDEX_DESC) { n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) @@ -88985,8 +84881,7 @@ func _exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintptr) { v1 = uintptr(0) } pSelect = v1 - _ = libc.Int32FromInt32(0) - zRet = _sqlite3DbMallocRaw(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(nVal+int32(1))) + zRet = _sqlite3DbMallocRaw(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVal+int32(1))) if zRet != 0 { i = 0 for { @@ -89085,7 +84980,6 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 addrOnce = 0 /* the LHS of the IN operator */ pKeyInfo = uintptr(0) /* The prepared statement under construction */ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) /* The evaluation of the IN must be repeated every time it ** is encountered if any of the following is true: ** @@ -89096,17 +84990,16 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 ** If all of the above are false, then we can compute the RHS just once ** and reuse it many names. */ - if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_VarSelect)) != libc.Uint32FromInt32(0)) && (*TParse)(unsafe.Pointer(pParse)).FiSelfTab == 0 { + if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_VarSelect)) != libc.Uint32FromInt32(0)) && (*TParse)(unsafe.Pointer(pParse)).FiSelfTab == 0 { /* Reuse of the RHS is allowed */ /* If this routine has already been coded, but the previous code ** might not have been invoked yet, so invoke it now as a subroutine. */ - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Subrtn)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != uint32(0) { addrOnce = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8162, libc.VaList(bp+40, (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FselId)) } - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*(*struct { FiAddr int32 FregReturn int32 @@ -89114,15 +85007,12 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 44))).FiAddr) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), iTab, (*TExpr)(unsafe.Pointer(pExpr)).FiTable) _sqlite3VdbeJumpHere(tls, v, addrOnce) return } /* Begin coding the subroutine */ - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_Subrtn)) - _ = libc.Int32FromInt32(0) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) v2 = pParse + 44 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) @@ -89182,10 +85072,7 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 _sqlite3KeyInfoUnref(tls, pKeyInfo) return } - _ = libc.Int32FromInt32(0) /* OOM will cause exit after sqlite3Select() */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + /* OOM will cause exit after sqlite3Select() */ i = 0 for { if !(i < nVal) { @@ -89211,7 +85098,6 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 } } if pKeyInfo != 0 { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pKeyInfo + 20)) = _sqlite3ExprCollSeq(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) } /* Loop through each expression in <exprlist>. */ @@ -89232,7 +85118,7 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 if addrOnce != 0 && !(_sqlite3ExprIsConstant(tls, pParse, pE2) != 0) { _sqlite3VdbeChangeToNoop(tls, v, addrOnce-int32(1)) _sqlite3VdbeChangeToNoop(tls, v, addrOnce) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Subrtn)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Subrtn)) addrOnce = 0 } /* Evaluate the expression and insert it into the temp table */ @@ -89256,8 +85142,6 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 _sqlite3VdbeAddOp1(tls, v, int32(OP_NullRow), iTab) _sqlite3VdbeJumpHere(tls, v, addrOnce) /* Subroutine return */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_Return), (*(*struct { FiAddr int32 FregReturn int32 @@ -89295,18 +85179,14 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 addrOnce = 0 /* Address of OP_Once at top of subroutine */ rReg = 0 /* New limit expression */ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return 0 } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pSel = *(*uintptr)(unsafe.Pointer(pExpr + 20)) /* If this routine has already been coded, then invoke it as a ** subroutine. */ - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Subrtn)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != uint32(0) { _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8216, libc.VaList(bp+40, (*TSelect)(unsafe.Pointer(pSel)).FselId)) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*(*struct { FiAddr int32 FregReturn int32 @@ -89317,9 +85197,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 return (*TExpr)(unsafe.Pointer(pExpr)).FiTable } /* Begin coding the subroutine */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_Subrtn)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) v2 = pParse + 44 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) @@ -89344,7 +85222,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 ** If all of the above are false, then we can run this code just once ** save the results, and reuse the same result on subsequent invocations. */ - if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_VarSelect)) != libc.Uint32FromInt32(0)) { + if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_VarSelect)) != libc.Uint32FromInt32(0)) { addrOnce = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) } /* For a SELECT, generate code to put the values for all columns of @@ -89363,7 +85241,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 v3 = __ccgo_ts + 8185 } _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+8234, libc.VaList(bp+40, v3, (*TSelect)(unsafe.Pointer(pSel)).FselId)) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) { v4 = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpEList)).FnExpr } else { v4 = int32(1) @@ -89371,7 +85249,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 nReg = v4 _sqlite3SelectDestInit(tls, bp, 0, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1)) *(*int32)(unsafe.Pointer(pParse + 44)) += nReg - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) { (*(*TSelectDest)(unsafe.Pointer(bp))).FeDest = uint8(SRT_Mem) (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = nReg @@ -89409,8 +85287,6 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 _sqlite3VdbeJumpHere(tls, v, addrOnce) } /* Subroutine return */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_Return), (*(*struct { FiAddr int32 FregReturn int32 @@ -89492,14 +85368,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor - _ = libc.Int32FromInt32(0) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(nVector)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(1))+uint32(1))) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint32FromInt32(nVector)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(1))+uint32(1))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -89508,14 +85383,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** contains the values that make up the RHS. If IN_INDEX_NOOP is returned, ** the RHS has not yet been coded. */ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) /* OOM detected prior to this routine */ + /* OOM detected prior to this routine */ if destIfFalse == destIfNull { v1 = uintptr(0) } else { v1 = bp } - eType = _sqlite3FindInIndex(tls, pParse, pExpr, uint32(libc.Int32FromInt32(IN_INDEX_MEMBERSHIP)|libc.Int32FromInt32(IN_INDEX_NOOP_OK)), v1, aiMap, bp+8) - _ = libc.Int32FromInt32(0) + eType = _sqlite3FindInIndex(tls, pParse, pExpr, libc.Uint32FromInt32(libc.Int32FromInt32(IN_INDEX_MEMBERSHIP)|libc.Int32FromInt32(IN_INDEX_NOOP_OK)), v1, aiMap, bp+8) /* Code the LHS, the <expr> from "<expr> IN (...)". If the LHS is a ** vector, then it is stored in an array of nVector registers starting ** at r1. @@ -89528,7 +85402,6 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor @@ -89569,7 +85442,6 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals if eType == int32(IN_INDEX_NOOP) { labelOk = _sqlite3VdbeMakeLabel(tls, pParse) regCkNull = 0 - _ = libc.Int32FromInt32(0) pList = *(*uintptr)(unsafe.Pointer(pExpr + 20)) pColl = _sqlite3ExprCollSeq(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) if destIfNull != destIfFalse { @@ -89594,7 +85466,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } op = v5 _sqlite3VdbeAddOp4(tls, v, op, rLhs, labelOk, r2, pColl, -int32(2)) - _sqlite3VdbeChangeP5(tls, v, uint16(*(*int8)(unsafe.Pointer(zAff)))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt8(*(*int8)(unsafe.Pointer(zAff)))) } else { if rLhs != r2 { v6 = int32(OP_Ne) @@ -89602,9 +85474,8 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals v6 = int32(OP_IsNull) } op1 = v6 - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp4(tls, v, op1, rLhs, destIfFalse, r2, pColl, -int32(2)) - _sqlite3VdbeChangeP5(tls, v, uint16(int32(*(*int8)(unsafe.Pointer(zAff)))|int32(SQLITE_JUMPIFNULL))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(int32(*(*int8)(unsafe.Pointer(zAff)))|int32(SQLITE_JUMPIFNULL))) } goto _4 _4: @@ -89752,7 +85623,7 @@ func _codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32 var _ /* value at bp+0 */ float64 if z != uintptr(0) { _sqlite3AtoF(tls, z, bp, _sqlite3Strlen30(tls, z), uint8(SQLITE_UTF8)) - _ = libc.Int32FromInt32(0) /* The new AtoF never returns NaN */ + /* The new AtoF never returns NaN */ if negateFlag != 0 { *(*float64)(unsafe.Pointer(bp)) = -*(*float64)(unsafe.Pointer(bp)) } @@ -89779,14 +85650,12 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_IntValue) != 0 { i = *(*int32)(unsafe.Pointer(pExpr + 8)) - _ = libc.Int32FromInt32(0) if negFlag != 0 { i = -i } _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), i, iMem) } else { z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) - _ = libc.Int32FromInt32(0) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) { if Xsqlite3_strnicmp(tls, z, __ccgo_ts+8257, int32(2)) == 0 { @@ -89823,8 +85692,6 @@ func _sqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr _ = iTabCol iTabCol = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iIdxCol)*2)) if int32(iTabCol) == -int32(2) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = iTabCur + int32(1) _sqlite3ExprCodeCopy(tls, pParse, (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(iIdxCol)*20))).FpExpr, regOut) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 @@ -89845,8 +85712,6 @@ func _sqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pTab uintptr _, _, _ = iAddr, nErr, v v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe nErr = (*TParse)(unsafe.Pointer(pParse)).FnErr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FiSelfTab > 0 { iAddr = _sqlite3VdbeAddOp3(tls, v, int32(OP_IfNullRow), (*TParse)(unsafe.Pointer(pParse)).FiSelfTab-int32(1), 0, regOut) } else { @@ -89875,21 +85740,18 @@ func _sqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT var op, savedSelfTab, x int32 var pCol, pParse, v1, p2, p3 uintptr _, _, _, _, _, _, _, _ = op, pCol, pParse, savedSelfTab, x, v1, p2, p3 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iCol < 0 || iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iTabCur, regOut) } else { - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { op = int32(OP_VColumn) x = iCol } else { v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 pCol = v1 - if int32((*TColumn)(unsafe.Pointer(v1)).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(v1)).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { pParse = _sqlite3VdbeParser(tls, v) - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_BUSY) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_BUSY) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8287, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { savedSelfTab = (*TParse)(unsafe.Pointer(pParse)).FiSelfTab @@ -89929,17 +85791,14 @@ func _sqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT func _sqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 Tu8) (r int32) { var pOp uintptr _ = pOp - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3ExprCodeGetColumnOfTable(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iTable, iColumn, iReg) if p5 != 0 { pOp = _sqlite3VdbeGetLastOp(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe) - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(p5) } - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_VColumn) { - (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(int32(p5) & libc.Int32FromInt32(OPFLAG_NOCHNG)) + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_VColumn) { + (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = libc.Uint16FromInt32(libc.Int32FromUint8(p5) & libc.Int32FromInt32(OPFLAG_NOCHNG)) } } return iReg @@ -89972,7 +85831,7 @@ func _exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { (*TExpr)(unsafe.Pointer(p)).Fop2 = (*TExpr)(unsafe.Pointer(p)).Fop (*TExpr)(unsafe.Pointer(p)).Fop = uint8(TK_REGISTER) (*TExpr)(unsafe.Pointer(p)).FiTable = iReg - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(EP_Skip)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Skip)) } // C documentation @@ -89995,12 +85854,11 @@ func _exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintpt iResult = _sqlite3ExprCodeTemp(tls, pParse, p, piFreeable) } else { *(*int32)(unsafe.Pointer(piFreeable)) = 0 - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_SELECT) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_SELECT) { iResult = _sqlite3CodeSubselect(tls, pParse, p) } else { iResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) *(*int32)(unsafe.Pointer(pParse + 44)) += nResult - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < nResult) { @@ -90024,7 +85882,7 @@ func _exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintpt // ** so that a subsequent copy will not be merged into this one. // */ func _setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { - if int32((*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetLastOp(tls, v))).Fopcode) == int32(OP_Copy) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetLastOp(tls, v))).Fopcode) == int32(OP_Copy) { _sqlite3VdbeChangeP5(tls, v, uint16(1)) /* Tag trailing OP_Copy as not mergeable */ } } @@ -90045,10 +85903,8 @@ func _exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFunc var _ /* caseExpr at bp+0 */ TExpr _, _, _, _, _, _, _, _, _ = aff, azAff, endCoalesce, i, nFarg, pA1, pArg, v, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) nFarg = (*TExprList)(unsafe.Pointer(pFarg)).FnExpr - _ = libc.Int32FromInt32(0) /* All in-line functions have at least one argument */ + /* All in-line functions have at least one argument */ switch iFuncId { case INLINEFUNC_coalesce: /* Attempt a direct implementation of the built-in COALESCE() and @@ -90056,7 +85912,6 @@ func _exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFunc ** arguments past the first non-NULL argument. */ endCoalesce = _sqlite3VdbeMakeLabel(tls, pParse) - _ = libc.Int32FromInt32(0) _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr, target) i = int32(1) for { @@ -90079,7 +85934,7 @@ func _exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFunc return _sqlite3ExprCodeTarget(tls, pParse, bp, target) case int32(INLINEFUNC_sqlite_offset): pArg = (*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pArg)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pArg)).FiTable >= 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pArg)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pArg)).FiTable >= 0 { _sqlite3VdbeAddOp3(tls, v, int32(OP_Offset), (*TExpr)(unsafe.Pointer(pArg)).FiTable, int32((*TExpr)(unsafe.Pointer(pArg)).FiColumn), target) } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, target) @@ -90088,7 +85943,6 @@ func _exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFunc /* The UNLIKELY() function is a no-op. The result is the value ** of the first argument. */ - _ = libc.Int32FromInt32(0) target = _sqlite3ExprCodeTarget(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr, target) break /*********************************************************************** @@ -90098,16 +85952,13 @@ func _exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFunc fallthrough case int32(INLINEFUNC_expr_compare): /* Compare two expressions using sqlite3ExprCompare() */ - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8 + 1*20))).FpExpr, -int32(1)), target) case int32(INLINEFUNC_expr_implies_expr): /* Compare two expressions using sqlite3ExprImpliesExpr() */ - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), _sqlite3ExprImpliesExpr(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8 + 1*20))).FpExpr, -int32(1)), target) case int32(INLINEFUNC_implies_nonnull_row): - _ = libc.Int32FromInt32(0) pA1 = (*(*TExprList_item)(unsafe.Pointer(pFarg + 8 + 1*20))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pA1)).Fop) == int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA1)).Fop) == int32(TK_COLUMN) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), _sqlite3ExprImpliesNonNullRow(tls, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr, (*TExpr)(unsafe.Pointer(pA1)).FiTable, int32(1)), target) } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, target) @@ -90125,9 +85976,7 @@ func _exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFunc 4: __ccgo_ts + 6365, 5: __ccgo_ts + 8335, } - _ = libc.Int32FromInt32(0) aff = _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr) - _ = libc.Int32FromInt32(0) if int32(aff) <= int32(SQLITE_AFF_NONE) { v2 = __ccgo_ts + 8343 } else { @@ -90170,14 +86019,12 @@ func _sqlite3IndexedExprLookup(tls *libc.TLS, pParse uintptr, pExpr uintptr, tar if _sqlite3ExprCompare(tls, uintptr(0), pExpr, (*TIndexedExpr)(unsafe.Pointer(p)).FpExpr, iDataCur) != 0 { goto _1 } - _ = libc.Int32FromInt32(0) - exprAff = uint8(_sqlite3ExprAffinity(tls, pExpr)) - if int32(exprAff) <= int32(SQLITE_AFF_BLOB) && int32((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_BLOB) || int32(exprAff) == int32(SQLITE_AFF_TEXT) && int32((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_TEXT) || int32(exprAff) >= int32(SQLITE_AFF_NUMERIC) && int32((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_NUMERIC) { + exprAff = libc.Uint8FromInt8(_sqlite3ExprAffinity(tls, pExpr)) + if libc.Int32FromUint8(exprAff) <= int32(SQLITE_AFF_BLOB) && libc.Int32FromUint8((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_BLOB) || libc.Int32FromUint8(exprAff) == int32(SQLITE_AFF_TEXT) && libc.Int32FromUint8((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_TEXT) || libc.Int32FromUint8(exprAff) >= int32(SQLITE_AFF_NUMERIC) && libc.Int32FromUint8((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_NUMERIC) { /* Affinity mismatch on a generated column */ goto _1 } v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) if (*TIndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow != 0 { /* If the index is on a NULL row due to an outer join, then we ** cannot extract the value from the index. The value must be @@ -90277,31 +86124,25 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target *(*int32)(unsafe.Pointer(bp)) = 0 /* If non-zero free this temporary register */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Temporary expression node */ p5 = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { op = int32(TK_NULL) } else { - if v2 = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr != uintptr(0) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Leaf)) != libc.Uint32FromInt32(0)); v2 { + if v2 = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr != uintptr(0) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != libc.Uint32FromInt32(0)); v2 { v1 = _sqlite3IndexedExprLookup(tls, pParse, pExpr, target) r1 = v1 } if v2 && v1 >= 0 { return r1 } else { - _ = libc.Int32FromInt32(0) - op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) } } - _ = libc.Int32FromInt32(0) switch op { case int32(TK_AGG_COLUMN): pAggInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { /* Happens when the left table of a RIGHT JOIN is null and ** is using an expression index */ @@ -90310,7 +86151,6 @@ expr_code_doover: } pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*16 if !((*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode != 0) { - _ = libc.Int32FromInt32(0) return (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FuseSortingIdx != 0 { @@ -90339,14 +86179,10 @@ expr_code_doover: fallthrough case int32(TK_COLUMN): iTab = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_FixedCol)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) != uint32(0) { iReg = _sqlite3ExprCodeTarget(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) aff = int32(_sqlite3TableColumnAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn))) if aff > int32(SQLITE_AFF_BLOB) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), iReg, int32(1), 0, uintptr(unsafe.Pointer(&_zAff))+uintptr((aff-int32('B'))*int32(2)), -int32(1)) } return iReg @@ -90354,24 +86190,20 @@ expr_code_doover: if iTab < 0 { if (*TParse)(unsafe.Pointer(pParse)).FiSelfTab < 0 { iCol = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - _ = libc.Int32FromInt32(0) pTab1 = (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iCol < 0 { return -int32(1) - (*TParse)(unsafe.Pointer(pParse)).FiSelfTab } pCol1 = (*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(iCol)*12 iSrc = int32(_sqlite3TableColumnToStorage(tls, pTab1, int16(iCol))) - (*TParse)(unsafe.Pointer(pParse)).FiSelfTab - if int32((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - if int32((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_BUSY) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_BUSY) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8287, libc.VaList(bp+120, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) return 0 } p3 = pCol1 + 10 *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_BUSY)) - if int32((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_NOTAVAIL) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_NOTAVAIL) != 0 { _sqlite3ExprCodeGeneratedColumn(tls, pParse, pTab1, pCol1, iSrc) } p4 = pCol1 + 10 @@ -90400,8 +86232,6 @@ expr_code_doover: return r1 } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iReg = _sqlite3ExprCodeGetColumn(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn), iTab, target, (*TExpr)(unsafe.Pointer(pExpr)).Fop2) return iReg case int32(TK_INTEGER): @@ -90411,11 +86241,9 @@ expr_code_doover: _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), _sqlite3ExprTruthValue(tls, pExpr), target) return target case int32(TK_FLOAT): - _ = libc.Int32FromInt32(0) _codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pExpr + 8)), 0, target) return target case int32(TK_STRING): - _ = libc.Int32FromInt32(0) _sqlite3VdbeLoadString(tls, v, target, *(*uintptr)(unsafe.Pointer(pExpr + 8))) return target default: @@ -90423,23 +86251,15 @@ expr_code_doover: ** Expr node to be passed into this function, it will be handled ** sanely and not crash. But keep the assert() to bring the problem ** to the attention of the developers. */ - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, target) return target case int32(TK_BLOB): - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) + 2 n = _sqlite3Strlen30(tls, z) - int32(1) - _ = libc.Int32FromInt32(0) zBlob = _sqlite3HexToBlob(tls, _sqlite3VdbeDb(tls, v), z, n) _sqlite3VdbeAddOp4(tls, v, int32(OP_Blob), n/int32(2), target, 0, zBlob, -int32(6)) return target case int32(TK_VARIABLE): - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Variable), int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn), target) return target case int32(TK_REGISTER): @@ -90447,8 +86267,6 @@ expr_code_doover: case int32(TK_CAST): /* Expressions of the form: CAST(pLeft AS token) */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Cast), target, int32(_sqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0)))) return inReg case int32(TK_IS): @@ -90476,18 +86294,12 @@ expr_code_doover: case int32(TK_EQ): pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprIsVector(tls, pLeft) != 0 { - _codeVectorCompare(tls, pParse, pExpr, target, uint8(op), uint8(p5)) + _codeVectorCompare(tls, pParse, pExpr, target, libc.Uint8FromInt32(op), libc.Uint8FromInt32(p5)) } else { r1 = _sqlite3ExprCodeTemp(tls, pParse, pLeft, bp) r2 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, bp+4) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), inReg) - _codeCompare(tls, pParse, pLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), p5, libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Commuted)) != uint32(0))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + _codeCompare(tls, pParse, pLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), p5, libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Commuted)) != uint32(0))) if p5 == int32(SQLITE_NULLEQ) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, inReg) } else { @@ -90517,34 +86329,21 @@ expr_code_doover: case int32(TK_RSHIFT): fallthrough case int32(TK_CONCAT): - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) r2 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, bp+4) _sqlite3VdbeAddOp3(tls, v, op, r2, r1, target) case int32(TK_UMINUS): pLeft1 = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pLeft1)).Fop) == int32(TK_INTEGER) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft1)).Fop) == int32(TK_INTEGER) { _codeInteger(tls, pParse, pLeft1, int32(1), target) return target } else { - if int32((*TExpr)(unsafe.Pointer(pLeft1)).Fop) == int32(TK_FLOAT) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft1)).Fop) == int32(TK_FLOAT) { _codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pLeft1 + 8)), int32(1), target) return target } else { (*(*TExpr)(unsafe.Pointer(bp + 8))).Fop = uint8(TK_INTEGER) - (*(*TExpr)(unsafe.Pointer(bp + 8))).Fflags = uint32(libc.Int32FromInt32(EP_IntValue) | libc.Int32FromInt32(EP_TokenOnly)) + (*(*TExpr)(unsafe.Pointer(bp + 8))).Fflags = libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue) | libc.Int32FromInt32(EP_TokenOnly)) *(*int32)(unsafe.Pointer(bp + 8 + 8)) = 0 r1 = _sqlite3ExprCodeTemp(tls, pParse, bp+8, bp) r2 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp+4) @@ -90554,20 +86353,16 @@ expr_code_doover: case int32(TK_BITNOT): fallthrough case int32(TK_NOT): - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) _sqlite3VdbeAddOp2(tls, v, op, r1, inReg) case int32(TK_TRUTH): /* IS TRUE or IS FALSE */ r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) isTrue = _sqlite3ExprTruthValue(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) - bNormal = libc.BoolInt32(int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2) == int32(TK_IS)) + bNormal = libc.BoolInt32(libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2) == int32(TK_IS)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsTrue), r1, inReg, libc.BoolInt32(!(isTrue != 0)), isTrue^bNormal) case int32(TK_ISNULL): fallthrough case int32(TK_NOTNULL): - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), target) r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) addr = _sqlite3VdbeAddOp1(tls, v, op, r1) @@ -90576,10 +86371,8 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _ = libc.Int32FromInt32(0) _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8348, libc.VaList(bp+120, pExpr)) } else { - _ = libc.Int32FromInt32(0) return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } case int32(TK_FUNCTION): /* The function name */ @@ -90587,7 +86380,7 @@ expr_code_doover: db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* The database connection */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc /* The text encoding used by this database */ pColl = uintptr(0) /* A collating sequence */ - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FregResult } if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { @@ -90595,8 +86388,6 @@ expr_code_doover: ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pFarg = *(*uintptr)(unsafe.Pointer(pExpr + 20)) if pFarg != 0 { v8 = (*TExprList)(unsafe.Pointer(pFarg)).FnExpr @@ -90604,7 +86395,6 @@ expr_code_doover: v8 = 0 } nFarg = v8 - _ = libc.Int32FromInt32(0) zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { @@ -90612,11 +86402,9 @@ expr_code_doover: break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return _exprCodeInlineFunction(tls, pParse, pFarg, int32((*TFuncDef)(unsafe.Pointer(pDef)).FpUserData), target) } else { - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != 0 { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != 0 { _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } @@ -90648,15 +86436,9 @@ expr_code_doover: ** or OPFLAG_TYPEOFARG or OPFLAG_BYTELENARG respectively, to avoid ** unnecessary data loading. */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_LENGTH)|libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)) != uint32(0) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_LENGTH)|libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)) != uint32(0) { exprOp = (*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr)).Fop - if int32(exprOp) == int32(TK_COLUMN) || int32(exprOp) == int32(TK_AGG_COLUMN) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(exprOp) == int32(TK_COLUMN) || libc.Int32FromUint8(exprOp) == int32(TK_AGG_COLUMN) { (*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr)).Fop2 = uint8((*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags & uint32(OPFLAG_BYTELENARG)) } } @@ -90676,7 +86458,7 @@ expr_code_doover: ** "glob(B,A). We want to use the A in "A glob B" to test ** for function overloading. But we use the B term in "glob(B,A)". */ - if nFarg >= int32(2) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_InfixFunc)) != uint32(0) { + if nFarg >= int32(2) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_InfixFunc)) != uint32(0) { pDef = _sqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8 + 1*20))).FpExpr) } else { if nFarg > 0 { @@ -90689,7 +86471,7 @@ expr_code_doover: } _sqlite3VdbeAddOp4(tls, v, int32(OP_CollSeq), 0, 0, 0, pColl, -int32(2)) } - _sqlite3VdbeAddFunctionCall(tls, pParse, int32(constMask), r1, target, nFarg, pDef, int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2)) + _sqlite3VdbeAddFunctionCall(tls, pParse, libc.Int32FromUint32(constMask), r1, target, nFarg, pDef, libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2)) if nFarg != 0 { if constMask == uint32(0) { _sqlite3ReleaseTempRange(tls, pParse, r1, nFarg) @@ -90715,11 +86497,10 @@ expr_code_doover: } case int32(TK_SELECT_COLUMN): pLeft2 = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft - if (*TExpr)(unsafe.Pointer(pLeft2)).FiTable == 0 || int32((*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn) > int32((*TExpr)(unsafe.Pointer(pLeft2)).Fop2) { + if (*TExpr)(unsafe.Pointer(pLeft2)).FiTable == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn) > libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft2)).Fop2) { (*TExpr)(unsafe.Pointer(pLeft2)).FiTable = _sqlite3CodeSubselect(tls, pParse, pLeft2) (*TExpr)(unsafe.Pointer(pLeft2)).Fop2 = (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn } - _ = libc.Int32FromInt32(0) n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7958, libc.VaList(bp+120, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) @@ -90751,14 +86532,13 @@ expr_code_doover: _exprCodeBetween(tls, pParse, pExpr, target, uintptr(0), 0) return target case int32(TK_COLLATE): - if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Collate)) != libc.Uint32FromInt32(0)) { + if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) != libc.Uint32FromInt32(0)) { /* A TK_COLLATE Expr node without the EP_Collate tag is a so-called ** "SOFT-COLLATE" that is added to constraints that are pushed down ** from outer queries into sub-queries by the WHERE-clause push-down ** optimization. Clear subtypes as subtypes may not cross a subquery ** boundary. */ - _ = libc.Int32FromInt32(0) _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) _sqlite3VdbeAddOp1(tls, v, int32(OP_ClrSubtype), target) return target @@ -90773,14 +86553,9 @@ expr_code_doover: pExpr = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft goto expr_code_doover /* 2018-04-28: Prevent deep recursion. OSSFuzz. */ case int32(TK_TRIGGER): - _ = libc.Int32FromInt32(0) pTab2 = (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab iCol1 = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) p1 = (*TExpr)(unsafe.Pointer(pExpr)).FiTable*(int32((*TTable)(unsafe.Pointer(pTab2)).FnCol)+int32(1)) + int32(1) + int32(_sqlite3TableColumnToStorage(tls, pTab2, int16(iCol1))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Param), p1, target) /* If the column has REAL affinity, it may currently be stored as an ** integer. Use OP_RealAffinity to make sure it is really real. @@ -90804,9 +86579,7 @@ expr_code_doover: okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { - _ = libc.Int32FromInt32(0) if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { - _ = libc.Int32FromInt32(0) inReg = (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FiFirstReg + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) break } @@ -90826,7 +86599,6 @@ expr_code_doover: */ (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor _sqlite3VdbeJumpHere(tls, v, addrINR) break @@ -90856,8 +86628,6 @@ expr_code_doover: pTest = uintptr(0) /* X==Ei (form A) or just Ei (form B) */ pDel = uintptr(0) db1 = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pEList = *(*uintptr)(unsafe.Pointer(pExpr + 20)) aListelem = pEList + 8 nExpr = (*TExprList)(unsafe.Pointer(pEList)).FnExpr @@ -90887,7 +86657,6 @@ expr_code_doover: break } if pX != 0 { - _ = libc.Int32FromInt32(0) (*(*TExpr)(unsafe.Pointer(bp + 60))).FpRight = (*(*TExprList_item)(unsafe.Pointer(aListelem + uintptr(i1)*20))).FpExpr } else { pTest = (*(*TExprList_item)(unsafe.Pointer(aListelem + uintptr(i1)*20))).FpExpr @@ -90911,7 +86680,6 @@ expr_code_doover: _setDoNotMergeFlagOnCopy(tls, v) _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): - _ = libc.Int32FromInt32(0) if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8399, 0) return 0 @@ -90919,7 +86687,6 @@ expr_code_doover: if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { _sqlite3MayAbort(tls, pParse) } - _ = libc.Int32FromInt32(0) if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Ignore) { _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), SQLITE_OK, int32(OE_Ignore), 0, *(*uintptr)(unsafe.Pointer(pExpr + 8)), 0) } else { @@ -90962,8 +86729,6 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r var addr, i, v2, v4 int32 var p, pItem, pItem1, v, v3, v5 uintptr _, _, _, _, _, _, _, _, _, _ = addr, i, p, pItem, pItem1, v, v2, v3, v4, v5 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr if regDest < 0 && p != 0 { pItem = p + 8 @@ -90983,9 +86748,8 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r } } pExpr = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) - if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { + if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { @@ -91037,7 +86801,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -91065,21 +86829,18 @@ func _sqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32 var op Tu8 var pX uintptr _, _, _ = inReg, op, pX - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FpVdbe == uintptr(0) { return } inReg = _sqlite3ExprCodeTarget(tls, pParse, pExpr, target) if inReg != target { pX = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if pX != 0 && ((*TExpr)(unsafe.Pointer(pX)).Fflags&uint32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) || int32((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_REGISTER)) { + if pX != 0 && ((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_REGISTER)) { op = uint8(OP_Copy) } else { op = uint8(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(op), inReg, target) + _sqlite3VdbeAddOp2(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, libc.Int32FromUint8(op), inReg, target) } } @@ -91145,16 +86906,14 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ var pExpr, pItem, pOp, v, v5 uintptr var v4, v6 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _ = copyOp, i, inReg, j, n, pExpr, pItem, pOp, v, v1, v3, v4, v5, v6 - if int32(flags)&int32(SQLITE_ECEL_DUP) != 0 { + if libc.Int32FromUint8(flags)&int32(SQLITE_ECEL_DUP) != 0 { v1 = int32(OP_Copy) } else { v1 = int32(OP_SCopy) } - copyOp = uint8(v1) + copyOp = libc.Uint8FromInt32(v1) v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Never gets this far otherwise */ + /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) @@ -91166,34 +86925,34 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ break } pExpr = (*TExprList_item)(unsafe.Pointer(pItem)).FpExpr - if v4 = int32(flags)&int32(SQLITE_ECEL_REF) != 0; v4 { - v3 = int32((*(*struct { + if v4 = libc.Int32FromUint8(flags)&int32(SQLITE_ECEL_REF) != 0; v4 { + v3 = libc.Int32FromUint16((*(*struct { FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem + 16))).FiOrderByCol) j = v3 } if v4 && v3 > 0 { - if int32(flags)&int32(SQLITE_ECEL_OMITREF) != 0 { + if libc.Int32FromUint8(flags)&int32(SQLITE_ECEL_OMITREF) != 0 { i-- n-- } else { - _sqlite3VdbeAddOp2(tls, v, int32(copyOp), j+srcReg-int32(1), target+i) + _sqlite3VdbeAddOp2(tls, v, libc.Int32FromUint8(copyOp), j+srcReg-int32(1), target+i) } } else { - if int32(flags)&int32(SQLITE_ECEL_FACTOR) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if libc.Int32FromUint8(flags)&int32(SQLITE_ECEL_FACTOR) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target+i) } else { inReg = _sqlite3ExprCodeTarget(tls, pParse, pExpr, target+i) if inReg != target+i { - if v6 = int32(copyOp) == int32(OP_Copy); v6 { + if v6 = libc.Int32FromUint8(copyOp) == int32(OP_Copy); v6 { v5 = _sqlite3VdbeGetLastOp(tls, v) pOp = v5 } - if v6 && int32((*TVdbeOp)(unsafe.Pointer(v5)).Fopcode) == int32(OP_Copy) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1+(*TVdbeOp)(unsafe.Pointer(pOp)).Fp3+int32(1) == inReg && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2+(*TVdbeOp)(unsafe.Pointer(pOp)).Fp3+int32(1) == target+i && int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5) == 0 { + if v6 && libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(v5)).Fopcode) == int32(OP_Copy) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1+(*TVdbeOp)(unsafe.Pointer(pOp)).Fp3+int32(1) == inReg && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2+(*TVdbeOp)(unsafe.Pointer(pOp)).Fp3+int32(1) == target+i && libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5) == 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3++ } else { - _sqlite3VdbeAddOp2(tls, v, int32(copyOp), inReg, target+i) + _sqlite3VdbeAddOp2(tls, v, libc.Int32FromUint8(copyOp), inReg, target+i) } } } @@ -91244,9 +87003,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, libc.Xmemset(tls, bp+52, 0, uint32(52)) libc.Xmemset(tls, bp+104, 0, uint32(52)) libc.Xmemset(tls, bp, 0, uint32(52)) - _ = libc.Int32FromInt32(0) pDel = _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, 0) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_AND) (*(*TExpr)(unsafe.Pointer(bp))).FpLeft = bp + 52 (*(*TExpr)(unsafe.Pointer(bp))).FpRight = bp + 104 @@ -91302,15 +87060,13 @@ func _sqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 op = 0 *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - _ = libc.Int32FromInt32(0) if v == uintptr(0) { return } /* Existence of VDBE checked by caller */ if pExpr == uintptr(0) { return } /* No way this can happen */ - _ = libc.Int32FromInt32(0) - op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) switch op { case int32(TK_OR): goto _1 @@ -91373,7 +87129,7 @@ _3: goto _18 _4: ; /* IS TRUE or IS NOT TRUE */ - isNot = libc.BoolInt32(int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2) == int32(TK_ISNOT)) + isNot = libc.BoolInt32(libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2) == int32(TK_ISNOT)) isTrue = _sqlite3ExprTruthValue(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if isTrue^isNot != 0 { if isNot != 0 { @@ -91419,20 +87175,12 @@ _7: } r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) r2 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, bp+4) - _codeCompare(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, dest, jumpIfNull, libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Commuted)) != uint32(0))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + _codeCompare(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, dest, jumpIfNull, libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Commuted)) != uint32(0))) goto _18 _14: ; _13: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) _sqlite3VdbeTypeofColumn(tls, v, r1) _sqlite3VdbeAddOp2(tls, v, op, r1, dest) @@ -91459,10 +87207,10 @@ _17: goto default_expr default_expr: ; - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { _sqlite3VdbeGoto(tls, v, dest) } else { - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { /* No-op */ } else { r1 = _sqlite3ExprCodeTemp(tls, pParse, pExpr, bp) @@ -91499,14 +87247,12 @@ func _sqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int3 op = 0 *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - _ = libc.Int32FromInt32(0) if v == uintptr(0) { return } /* Existence of VDBE checked by caller */ if pExpr == uintptr(0) { return } - _ = libc.Int32FromInt32(0) /* The value of pExpr->op and op are related as follows: ** ** pExpr->op op @@ -91525,18 +87271,10 @@ func _sqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int3 ** can compute the mapping above using the following expression. ** Assert()s verify that the computation is correct. */ - op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) + libc.Int32FromInt32(TK_ISNULL)&libc.Int32FromInt32(1) ^ int32(1) - libc.Int32FromInt32(TK_ISNULL)&libc.Int32FromInt32(1) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) + libc.Int32FromInt32(TK_ISNULL)&libc.Int32FromInt32(1) ^ int32(1) - libc.Int32FromInt32(TK_ISNULL)&libc.Int32FromInt32(1) /* Verify correct alignment of TK_ and OP_ constants */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - switch int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) { case int32(TK_OR): goto _1 case int32(TK_AND): @@ -91581,7 +87319,7 @@ _1: if pAlt != pExpr { _sqlite3ExprIfFalse(tls, pParse, pAlt, dest, jumpIfNull) } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) { _sqlite3ExprIfFalse(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, dest, jumpIfNull) _sqlite3ExprIfFalse(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, dest, jumpIfNull) } else { @@ -91598,7 +87336,7 @@ _3: goto _18 _4: ; /* IS TRUE or IS NOT TRUE */ - isNot = libc.BoolInt32(int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2) == int32(TK_ISNOT)) + isNot = libc.BoolInt32(libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2) == int32(TK_ISNOT)) isTrue = _sqlite3ExprTruthValue(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if isTrue^isNot != 0 { /* IS TRUE and IS NOT FALSE */ @@ -91622,7 +87360,7 @@ _6: ; _5: ; - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) { v21 = int32(TK_NE) } else { v21 = int32(TK_EQ) @@ -91646,13 +87384,7 @@ _7: } r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) r2 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, bp+4) - _codeCompare(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, dest, jumpIfNull, libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Commuted)) != uint32(0))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + _codeCompare(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, dest, jumpIfNull, libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Commuted)) != uint32(0))) goto _18 _14: ; @@ -91681,10 +87413,10 @@ _17: goto default_expr default_expr: ; - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { _sqlite3VdbeGoto(tls, v, dest) } else { - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { /* no-op */ } else { r1 = _sqlite3ExprCodeTemp(tls, pParse, pExpr, bp) @@ -91710,7 +87442,7 @@ func _sqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest i _, _ = db, pCopy db = (*TParse)(unsafe.Pointer(pParse)).Fdb pCopy = _sqlite3ExprDup(tls, db, pExpr, 0) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { _sqlite3ExprIfFalse(tls, pParse, pCopy, dest, jumpIfNull) } _sqlite3ExprDelete(tls, db, pCopy) @@ -91800,7 +87532,7 @@ func _sqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, } return v1 } - if pParse != 0 && int32((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_VARIABLE) && _exprCompareVariable(tls, pParse, pA, pB) != 0 { + if pParse != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_VARIABLE) && _exprCompareVariable(tls, pParse, pA, pB) != 0 { return 0 } combinedFlags = (*TExpr)(unsafe.Pointer(pA)).Fflags | (*TExpr)(unsafe.Pointer(pB)).Fflags @@ -91810,52 +87542,49 @@ func _sqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, } return int32(2) } - if int32((*TExpr)(unsafe.Pointer(pA)).Fop) != int32((*TExpr)(unsafe.Pointer(pB)).Fop) || int32((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_RAISE) { - if int32((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_COLLATE) && _sqlite3ExprCompare(tls, pParse, (*TExpr)(unsafe.Pointer(pA)).FpLeft, pB, iTab) < int32(2) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) != libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pB)).Fop) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_RAISE) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_COLLATE) && _sqlite3ExprCompare(tls, pParse, (*TExpr)(unsafe.Pointer(pA)).FpLeft, pB, iTab) < int32(2) { return int32(1) } - if int32((*TExpr)(unsafe.Pointer(pB)).Fop) == int32(TK_COLLATE) && _sqlite3ExprCompare(tls, pParse, pA, (*TExpr)(unsafe.Pointer(pB)).FpLeft, iTab) < int32(2) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pB)).Fop) == int32(TK_COLLATE) && _sqlite3ExprCompare(tls, pParse, pA, (*TExpr)(unsafe.Pointer(pB)).FpLeft, iTab) < int32(2) { return int32(1) } - if int32((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_AGG_COLUMN) && int32((*TExpr)(unsafe.Pointer(pB)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pB)).FiTable < 0 && (*TExpr)(unsafe.Pointer(pA)).FiTable == iTab { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pB)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pB)).FiTable < 0 && (*TExpr)(unsafe.Pointer(pA)).FiTable == iTab { /* fall through */ } else { return int32(2) } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(pA + 8)) != 0 { - if int32((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_FUNCTION) || int32((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_AGG_FUNCTION) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_FUNCTION) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_AGG_FUNCTION) { if _sqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 { return int32(2) } - _ = libc.Int32FromInt32(0) - if libc.BoolInt32((*TExpr)(unsafe.Pointer(pA)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0)) != libc.BoolInt32((*TExpr)(unsafe.Pointer(pB)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0)) { + if libc.BoolInt32((*TExpr)(unsafe.Pointer(pA)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0)) != libc.BoolInt32((*TExpr)(unsafe.Pointer(pB)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0)) { return int32(2) } - if (*TExpr)(unsafe.Pointer(pA)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pA)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { if _sqlite3WindowCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pA)).Fy)), *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pB)).Fy)), int32(1)) != 0 { return int32(2) } } } else { - if int32((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_NULL) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_NULL) { return 0 } else { - if int32((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_COLLATE) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_COLLATE) { if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 { return int32(2) } } else { - if *(*uintptr)(unsafe.Pointer(pB + 8)) != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_AGG_COLUMN) && libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 { + if *(*uintptr)(unsafe.Pointer(pB + 8)) != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_AGG_COLUMN) && libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 { return int32(2) } } } } } - if (*TExpr)(unsafe.Pointer(pA)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)|libc.Int32FromInt32(EP_Commuted)) != (*TExpr)(unsafe.Pointer(pB)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)|libc.Int32FromInt32(EP_Commuted)) { + if (*TExpr)(unsafe.Pointer(pA)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)|libc.Int32FromInt32(EP_Commuted)) != (*TExpr)(unsafe.Pointer(pB)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)|libc.Int32FromInt32(EP_Commuted)) { return int32(2) } if combinedFlags&uint32(EP_TokenOnly) == uint32(0) { @@ -91871,14 +87600,14 @@ func _sqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, if _sqlite3ExprListCompare(tls, *(*uintptr)(unsafe.Pointer(pA + 20)), *(*uintptr)(unsafe.Pointer(pB + 20)), iTab) != 0 { return int32(2) } - if int32((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_STRING) && int32((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_TRUEFALSE) && combinedFlags&uint32(EP_Reduced) == uint32(0) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_STRING) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_TRUEFALSE) && combinedFlags&uint32(EP_Reduced) == uint32(0) { if int32((*TExpr)(unsafe.Pointer(pA)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pB)).FiColumn) { return int32(2) } - if int32((*TExpr)(unsafe.Pointer(pA)).Fop2) != int32((*TExpr)(unsafe.Pointer(pB)).Fop2) && int32((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_TRUTH) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop2) != libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pB)).Fop2) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_TRUTH) { return int32(2) } - if int32((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_IN) && (*TExpr)(unsafe.Pointer(pA)).FiTable != (*TExpr)(unsafe.Pointer(pB)).FiTable && (*TExpr)(unsafe.Pointer(pA)).FiTable != iTab { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) != int32(TK_IN) && (*TExpr)(unsafe.Pointer(pA)).FiTable != (*TExpr)(unsafe.Pointer(pB)).FiTable && (*TExpr)(unsafe.Pointer(pA)).FiTable != iTab { return int32(2) } } @@ -91924,7 +87653,7 @@ func _sqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) } pExprA = (*(*TExprList_item)(unsafe.Pointer(pA + 8 + uintptr(i)*20))).FpExpr pExprB = (*(*TExprList_item)(unsafe.Pointer(pB + 8 + uintptr(i)*20))).FpExpr - if int32((*(*TExprList_item)(unsafe.Pointer(pA + 8 + uintptr(i)*20))).Ffg.FsortFlags) != int32((*(*TExprList_item)(unsafe.Pointer(pB + 8 + uintptr(i)*20))).Ffg.FsortFlags) { + if libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pA + 8 + uintptr(i)*20))).Ffg.FsortFlags) != libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pB + 8 + uintptr(i)*20))).Ffg.FsortFlags) { return int32(1) } v2 = _sqlite3ExprCompare(tls, uintptr(0), pExprA, pExprB, iTab) @@ -91961,23 +87690,17 @@ func _sqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) func _exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) (r int32) { var pList uintptr _ = pList - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _sqlite3ExprCompare(tls, pParse, p, pNN, iTab) == 0 { - return libc.BoolInt32(int32((*TExpr)(unsafe.Pointer(pNN)).Fop) != int32(TK_NULL)) + return libc.BoolInt32(libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pNN)).Fop) != int32(TK_NULL)) } - switch int32((*TExpr)(unsafe.Pointer(p)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) { case int32(TK_IN): - if seenNot != 0 && (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_xIsSelect)) != uint32(0) { + if seenNot != 0 && (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_xIsSelect)) != uint32(0) { return 0 } - _ = libc.Int32FromInt32(0) return _exprImpliesNotNull(tls, pParse, (*TExpr)(unsafe.Pointer(p)).FpLeft, pNN, iTab, int32(1)) case int32(TK_BETWEEN): - _ = libc.Int32FromInt32(0) pList = *(*uintptr)(unsafe.Pointer(p + 20)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if seenNot != 0 { return 0 } @@ -92033,7 +87756,7 @@ func _exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, if seenNot != 0 { return 0 } - if int32((*TExpr)(unsafe.Pointer(p)).Fop2) != int32(TK_IS) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop2) != int32(TK_IS) { return 0 } return _exprImpliesNotNull(tls, pParse, (*TExpr)(unsafe.Pointer(p)).FpLeft, pNN, iTab, int32(1)) @@ -92076,10 +87799,10 @@ func _sqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uin if _sqlite3ExprCompare(tls, pParse, pE1, pE2, iTab) == 0 { return int32(1) } - if int32((*TExpr)(unsafe.Pointer(pE2)).Fop) == int32(TK_OR) && (_sqlite3ExprImpliesExpr(tls, pParse, pE1, (*TExpr)(unsafe.Pointer(pE2)).FpLeft, iTab) != 0 || _sqlite3ExprImpliesExpr(tls, pParse, pE1, (*TExpr)(unsafe.Pointer(pE2)).FpRight, iTab) != 0) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE2)).Fop) == int32(TK_OR) && (_sqlite3ExprImpliesExpr(tls, pParse, pE1, (*TExpr)(unsafe.Pointer(pE2)).FpLeft, iTab) != 0 || _sqlite3ExprImpliesExpr(tls, pParse, pE1, (*TExpr)(unsafe.Pointer(pE2)).FpRight, iTab) != 0) { return int32(1) } - if int32((*TExpr)(unsafe.Pointer(pE2)).Fop) == int32(TK_NOTNULL) && _exprImpliesNotNull(tls, pParse, pE1, (*TExpr)(unsafe.Pointer(pE2)).FpLeft, iTab, 0) != 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE2)).Fop) == int32(TK_NOTNULL) && _exprImpliesNotNull(tls, pParse, pE1, (*TExpr)(unsafe.Pointer(pE2)).FpLeft, iTab, 0) != 0 { return int32(1) } return 0 @@ -92092,7 +87815,7 @@ func _sqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uin // ** separately have the implies-not-null-row property. // */ func _bothImplyNotNullRow(tls *libc.TLS, pWalker uintptr, pE1 uintptr, pE2 uintptr) { - if int32((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == 0 { + if libc.Int32FromUint16((*TWalker)(unsafe.Pointer(pWalker)).FeCode) == 0 { _sqlite3WalkExpr(tls, pWalker, pE1) if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(0) @@ -92119,10 +87842,10 @@ func _bothImplyNotNullRow(tls *libc.TLS, pWalker uintptr, pE1 uintptr, pE2 uintp func _impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { var pLeft, pRight uintptr _, _ = pLeft, pRight - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return int32(WRC_Prune) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_InnerON)) != uint32(0) && (*TWalker)(unsafe.Pointer(pWalker)).FmWFlags != 0 { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) != uint32(0) && (*TWalker)(unsafe.Pointer(pWalker)).FmWFlags != 0 { /* If iCur is used in an inner-join ON clause to the left of a ** RIGHT JOIN, that does *not* mean that the table must be non-null. ** But it is difficult to check for that condition precisely. @@ -92130,7 +87853,7 @@ func _impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** ignored while attempting to simplify a RIGHT JOIN. */ return int32(WRC_Prune) } - switch int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) { case int32(TK_ISNOT): fallthrough case int32(TK_ISNULL): @@ -92177,8 +87900,6 @@ func _impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) case int32(TK_BETWEEN): /* In "x NOT BETWEEN y AND z" either x must be non-null-row or else ** both y and z must be non-null row */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3WalkExpr(tls, pWalker, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) _bothImplyNotNullRow(tls, pWalker, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 1*20))).FpExpr) return int32(WRC_Prune) @@ -92201,9 +87922,7 @@ func _impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight /* The y.pTab=0 assignment in wherecode.c always happens after the ** impliesNotNullRow() test */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab != uintptr(0) && int32((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) || int32((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pRight)).Fy.FpTab != uintptr(0) && int32((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pRight)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pRight)).Fy.FpTab != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pRight)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { return int32(WRC_Prune) } fallthrough @@ -92245,10 +87964,10 @@ func _sqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32, isRJ in if p == uintptr(0) { return 0 } - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_NOTNULL) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_NOTNULL) { p = (*TExpr)(unsafe.Pointer(p)).FpLeft } else { - for int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_AND) { + for libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_AND) { if _sqlite3ExprImpliesNonNullRow(tls, (*TExpr)(unsafe.Pointer(p)).FpLeft, iTab, isRJ) != 0 { return int32(1) } @@ -92262,7 +87981,7 @@ func _sqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32, isRJ in (*(*TWalker)(unsafe.Pointer(bp))).FmWFlags = libc.BoolUint16(isRJ != 0) *(*int32)(unsafe.Pointer(bp + 24)) = iTab _sqlite3WalkExpr(tls, bp, p) - return int32((*(*TWalker)(unsafe.Pointer(bp))).FeCode) + return libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode) } /* @@ -92287,7 +88006,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -92353,7 +88072,7 @@ func _selectRefEnter(tls *libc.TLS, pWalker uintptr, pSelect uintptr) (r int32) } j = (*TRefSrcList)(unsafe.Pointer(p)).FnExclude *(*Ti64)(unsafe.Pointer(p + 8)) += int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) - piNew = _sqlite3DbRealloc(tls, (*TRefSrcList)(unsafe.Pointer(p)).Fdb, (*TRefSrcList)(unsafe.Pointer(p)).FaiExclude, uint64((*TRefSrcList)(unsafe.Pointer(p)).FnExclude*int64(4))) + piNew = _sqlite3DbRealloc(tls, (*TRefSrcList)(unsafe.Pointer(p)).Fdb, (*TRefSrcList)(unsafe.Pointer(p)).FaiExclude, libc.Uint64FromInt64((*TRefSrcList)(unsafe.Pointer(p)).FnExclude*int64(4))) if piNew == uintptr(0) { (*TRefSrcList)(unsafe.Pointer(p)).FnExclude = 0 return int32(WRC_Abort) @@ -92381,7 +88100,6 @@ func _selectRefLeave(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { p = *(*uintptr)(unsafe.Pointer(pWalker + 24)) pSrc = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc if (*TRefSrcList)(unsafe.Pointer(p)).FnExclude != 0 { - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer(p + 8)) -= int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) } } @@ -92400,7 +88118,7 @@ func _exprRefToSrcList(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) var i, nSrc, v1 int32 var p, pSrc, p3, p5 uintptr _, _, _, _, _, _, _ = i, nSrc, p, pSrc, v1, p3, p5 - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_COLUMN) { p = *(*uintptr)(unsafe.Pointer(pWalker + 24)) pSrc = (*TRefSrcList)(unsafe.Pointer(p)).FpRef if pSrc != 0 { @@ -92464,7 +88182,6 @@ func _sqlite3ReferencesSrcList(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSr defer tls.Free(48) var _ /* w at bp+0 */ TWalker var _ /* x at bp+28 */ TRefSrcList - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp, 0, uint32(28)) libc.Xmemset(tls, bp+28, 0, uint32(20)) (*(*TWalker)(unsafe.Pointer(bp))).FxExprCallback = __ccgo_fp(_exprRefToSrcList) @@ -92473,22 +88190,17 @@ func _sqlite3ReferencesSrcList(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSr *(*uintptr)(unsafe.Pointer(bp + 24)) = bp + 28 (*(*TRefSrcList)(unsafe.Pointer(bp + 28))).Fdb = (*TParse)(unsafe.Pointer(pParse)).Fdb (*(*TRefSrcList)(unsafe.Pointer(bp + 28))).FpRef = pSrcList - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3WalkExprList(tls, bp, *(*uintptr)(unsafe.Pointer(pExpr + 20))) if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3WalkExprList(tls, bp, *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20))) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { _sqlite3WalkExpr(tls, bp, (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FpFilter) } if (*(*TRefSrcList)(unsafe.Pointer(bp + 28))).FaiExclude != 0 { _sqlite3DbNNFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*(*TRefSrcList)(unsafe.Pointer(bp + 28))).FaiExclude) } - if int32((*(*TWalker)(unsafe.Pointer(bp))).FeCode)&int32(0x01) != 0 { + if libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode)&int32(0x01) != 0 { return int32(1) } else { if (*(*TWalker)(unsafe.Pointer(bp))).FeCode != 0 { @@ -92517,13 +88229,12 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int var db, pAggInfo, pParse uintptr var iAgg int32 _, _, _, _ = db, iAgg, pAggInfo, pParse - if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Reduced)) != libc.Uint32FromInt32(0)) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo != uintptr(0) { + if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Reduced)) != libc.Uint32FromInt32(0)) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo != uintptr(0) { pAggInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo iAgg = int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*16))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { @@ -92531,7 +88242,6 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int } } } else { - _ = libc.Int32FromInt32(0) if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(iAgg)*24))).FpFExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { @@ -92598,7 +88308,6 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, var pCol, pE, pGB, pTerm, v4 uintptr var v3 Tu16 _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 - _ = libc.Int32FromInt32(0) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -92608,7 +88317,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 @@ -92620,17 +88329,15 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ - _ = libc.Int32FromInt32(0) return } pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*16 - _ = libc.Int32FromInt32(0) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr - if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy pTerm = pGB + 8 n = (*TExprList)(unsafe.Pointer(pGB)).FnExpr @@ -92640,7 +88347,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, break } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr - if int32((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) break } @@ -92655,14 +88362,13 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, v4 = pAggInfo + 2 v3 = *(*Tu16)(unsafe.Pointer(v4)) *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) } goto fix_up_expr fix_up_expr: ; - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) } (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = int16(k) @@ -92687,11 +88393,8 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList pAggInfo = *(*uintptr)(unsafe.Pointer(pNC + 8)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - switch int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) { default: - _ = libc.Int32FromInt32(0) if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_InAggFunc) == 0 { break } @@ -92718,7 +88421,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if pIEpr == uintptr(0) { break } - if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == libc.Uint32FromInt32(0)) { + if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == libc.Uint32FromInt32(0)) { break } i = 0 @@ -92755,8 +88458,6 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*16))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg @@ -92775,7 +88476,6 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if !(i < (*TSrcList)(unsafe.Pointer(pSrcList)).FnSrc) { break } - _ = libc.Int32FromInt32(0) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor { _findOrCreateAggInfoColumn(tls, pParse, pAggInfo, pExpr) break @@ -92789,7 +88489,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) } return WRC_Continue case int32(TK_AGG_FUNCTION): - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_InAggFunc) == 0 && (*TWalker)(unsafe.Pointer(pWalker)).FwalkerDepth == int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_InAggFunc) == 0 && (*TWalker)(unsafe.Pointer(pWalker)).FwalkerDepth == libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { /* Check to see if pExpr is a duplicate of another aggregate ** function that is already in the pAggInfo structure */ @@ -92817,10 +88517,8 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if i >= 0 { - _ = libc.Int32FromInt32(0) pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24 (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 { v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr } else { @@ -92828,21 +88526,15 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) } nArg = v5 (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - _ = libc.Int32FromInt32(0) if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v7 = pParse + 40 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr, 0) == 0 { (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) } else { (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) } @@ -92850,7 +88542,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) } else { (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { v9 = pParse + 40 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ @@ -92862,7 +88554,6 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) } /* Make pExpr point to the appropriate pAggInfo->aFunc[] entry */ - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = int16(i) (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo return int32(WRC_Prune) @@ -92894,7 +88585,6 @@ func _sqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { (*(*TWalker)(unsafe.Pointer(bp))).FwalkerDepth = 0 *(*uintptr)(unsafe.Pointer(bp + 24)) = pNC (*(*TWalker)(unsafe.Pointer(bp))).FpParse = uintptr(0) - _ = libc.Int32FromInt32(0) _sqlite3WalkExpr(tls, bp, pExpr) } @@ -92937,7 +88627,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v2, v4 uintptr var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 - if int32((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { v2 = pParse + 44 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) @@ -92960,7 +88650,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { var v2 uintptr _, _ = v1, v2 if iReg != 0 { - if int32((*TParse)(unsafe.Pointer(pParse)).FnTempReg) < int32(libc.Uint32FromInt64(32)/libc.Uint32FromInt64(4)) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) < libc.Int32FromUint32(libc.Uint32FromInt64(32)/libc.Uint32FromInt64(4)) { v2 = pParse + 19 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ @@ -93186,8 +88876,6 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_rename_table } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pTab = _sqlite3LocateTableItem(tls, pParse, uint32(0), pSrc+8) if !(pTab != 0) { goto exit_rename_table @@ -93215,7 +88903,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9183, zName) { goto exit_rename_table } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9189, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } @@ -93226,7 +88914,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3ViewGetColumnNames(tls, pParse, pTab) != 0 { goto exit_rename_table } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { pVTab = _sqlite3GetVTable(tls, db, pTab) if (*Tsqlite3_module)(unsafe.Pointer((*Tsqlite3_vtab)(unsafe.Pointer((*TVTable)(unsafe.Pointer(pVTab)).FpVtab)).FpModule)).FxRename == uintptr(0) { pVTab = uintptr(0) @@ -93314,21 +89002,16 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr var _ /* pVal at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iDb, pCol, pDflt, pNew, pTab, r1, rc, v, zCol, zDb, zEnd, zTab, v1 /* Temporary registers */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return } - _ = libc.Int32FromInt32(0) pNew = (*TParse)(unsafe.Pointer(pParse)).FpNewTable - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pNew)).FpSchema) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName zTab = (*TTable)(unsafe.Pointer(pNew)).FzName + 16 /* Skip the "sqlite_altertab_" prefix on the name */ pCol = (*TTable)(unsafe.Pointer(pNew)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))*12 pDflt = _sqlite3ColumnExpr(tls, pNew, pCol) pTab = _sqlite3FindTable(tls, db, zTab, zDb) - _ = libc.Int32FromInt32(0) /* Invoke the authorization callback. */ if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, uintptr(0)) != 0 { return @@ -93337,7 +89020,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** If there is a NOT NULL constraint, then the default value for the ** column must not be NULL. */ - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10095, 0) return } @@ -93345,16 +89028,14 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10127, 0) return } - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { /* If the default value for the new column was specified with a ** literal NULL, then set pDflt to 0. This simplifies checking ** for an SQL NULL default below. */ - _ = libc.Int32FromInt32(0) - if pDflt != 0 && int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pDflt)).FpLeft)).Fop) == int32(TK_NULL) { + if pDflt != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pDflt)).FpLeft)).Fop) == int32(TK_NULL) { pDflt = uintptr(0) } - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -93371,9 +89052,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr if pDflt != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _sqlite3ValueFromExpr(tls, db, pDflt, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp) - _ = libc.Int32FromInt32(0) if rc != SQLITE_OK { - _ = libc.Int32FromInt32(0) return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { @@ -93382,7 +89061,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10312) } } @@ -93390,15 +89069,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr zCol = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pColDef)).Fz, uint64((*TToken)(unsafe.Pointer(pColDef)).Fn)) if zCol != 0 { zEnd = zCol + uintptr((*TToken)(unsafe.Pointer(pColDef)).Fn-uint32(1)) - for zEnd > zCol && (int32(*(*int8)(unsafe.Pointer(zEnd))) == int32(';') || int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd)))])&int32(0x01) != 0) { + for zEnd > zCol && (int32(*(*int8)(unsafe.Pointer(zEnd))) == int32(';') || libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zEnd)))])&int32(0x01) != 0) { v1 = zEnd zEnd-- *(*int8)(unsafe.Pointer(v1)) = int8('\000') } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3NestedParse(tls, pParse, __ccgo_ts+10339, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -93426,7 +89103,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr /* Reload the table definition */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ - if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { + if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { _sqlite3NestedParse(tls, pParse, __ccgo_ts+10485, libc.VaList(bp+16, zTab, zDb)) } } @@ -93457,8 +89134,6 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { _, _, _, _, _, _, _ = db, i, iDb, nAlloc, pCol, pNew, pTab db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Look up the table being altered. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_begin_add_column } @@ -93466,12 +89141,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { if !(pTab != 0) { goto exit_begin_add_column } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10838, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10872, 0) goto exit_begin_add_column } @@ -93479,8 +89154,6 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } _sqlite3MayAbort(tls, pParse) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) /* Put a copy of the Table struct in Parse.pNewTable for the ** sqlite3AddColumn() function and friends to modify. But modify @@ -93496,16 +89169,13 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TParse)(unsafe.Pointer(pParse)).FpNewTable = pNew (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol - _ = libc.Int32FromInt32(0) nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - _ = libc.Int32FromInt32(0) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(uint32(12)*uint32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(uint32(12)*libc.Uint32FromInt32(nAlloc))) (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10902, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { - _ = libc.Int32FromInt32(0) goto exit_begin_add_column } - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pNew)).FaCol, (*TTable)(unsafe.Pointer(pTab)).FaCol, uint32(12)*uint32((*TTable)(unsafe.Pointer(pNew)).FnCol)) + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pNew)).FaCol, (*TTable)(unsafe.Pointer(pTab)).FaCol, uint32(12)*libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pNew)).FnCol)) i = 0 for { if !(i < int32((*TTable)(unsafe.Pointer(pNew)).FnCol)) { @@ -93519,7 +89189,6 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ; i++ } - _ = libc.Int32FromInt32(0) (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -93539,7 +89208,6 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 44))).FaddColOffset - _ = libc.Int32FromInt32(0) goto exit_begin_add_column exit_begin_add_column: ; @@ -93563,10 +89231,10 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i var zType, v1 uintptr _, _ = zType, v1 zType = uintptr(0) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { zType = __ccgo_ts + 10921 } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { zType = __ccgo_ts + 10926 } if zType != 0 { @@ -93611,7 +89279,6 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld } /* Which schema holds the table to be altered */ iSchema = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _ = libc.Int32FromInt32(0) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iSchema)*16))).FzDbSName /* Invoke the authorization callback. */ if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, uintptr(0)) != 0 { @@ -93652,8 +89319,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zNew != 0) { goto exit_rename_column } - _ = libc.Int32FromInt32(0) - bQuote = int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) + bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) _sqlite3NestedParse(tls, pParse, __ccgo_ts+11014, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3NestedParse(tls, pParse, __ccgo_ts+11196, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ @@ -93736,8 +89402,7 @@ type RenameCtx1 = TRenameCtx1 func _sqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) (r uintptr) { var pNew uintptr _ = pNew - _ = libc.Int32FromInt32(0) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != int32(PARSE_MODE_UNMAP) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != int32(PARSE_MODE_UNMAP) { pNew = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(16)) if pNew != 0 { (*TRenameToken)(unsafe.Pointer(pNew)).Fp = pPtr @@ -93785,7 +89450,7 @@ func _renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) _ = pParse pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) { _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+44) } return WRC_Continue @@ -93808,7 +89473,6 @@ func _renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { if pWith != 0 { pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse pCopy = uintptr(0) - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer((*(*TCte)(unsafe.Pointer(pWith + 12))).FpSelect)).FselFlags&uint32(SF_Expanded) == uint32(0) { /* Push a copy of the With object onto the with-stack. We use a copy ** here as the original will be expanded and resolved (flags SF_Expanded @@ -93853,7 +89517,6 @@ func _renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { func _unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { var ii int32 _ = ii - _ = libc.Int32FromInt32(0) ii = 0 for { if !(ii < (*TIdList)(unsafe.Pointer(pIdList)).FnId) { @@ -93880,7 +89543,7 @@ func _renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(libc.Int32FromInt32(SF_View)|libc.Int32FromInt32(SF_CopyCte)) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_View)|libc.Int32FromInt32(SF_CopyCte)) != 0 { return int32(WRC_Prune) } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { @@ -94046,7 +89709,7 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) // ** descend into sub-select statements. // */ func _renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { - if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(libc.Int32FromInt32(SF_View)|libc.Int32FromInt32(SF_CopyCte)) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_View)|libc.Int32FromInt32(SF_CopyCte)) != 0 { return int32(WRC_Prune) } _renameWalkWith(tls, pWalker, p) @@ -94068,10 +89731,10 @@ func _renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32 var p uintptr _ = p p = *(*uintptr)(unsafe.Pointer(pWalker + 24)) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRIGGER) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) == (*TRenameCtx)(unsafe.Pointer(p)).FiCol && (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).FpTriggerTab == (*TRenameCtx)(unsafe.Pointer(p)).FpTab { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRIGGER) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) == (*TRenameCtx)(unsafe.Pointer(p)).FiCol && (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).FpTriggerTab == (*TRenameCtx)(unsafe.Pointer(p)).FpTab { _renameTokenFind(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, p, pExpr) } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) == (*TRenameCtx)(unsafe.Pointer(p)).FiCol && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) && (*TRenameCtx)(unsafe.Pointer(p)).FpTab == (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) == (*TRenameCtx)(unsafe.Pointer(p)).FiCol && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) && (*TRenameCtx)(unsafe.Pointer(p)).FpTab == (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab { _renameTokenFind(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, p, pExpr) } } @@ -94219,14 +89882,14 @@ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uin return int32(SQLITE_NOMEM) } if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11352, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(117285)) + return _sqlite3CorruptError(tls, int32(117290)) } if bTemp != 0 { v1 = int32(1) } else { v1 = _sqlite3FindDbName(tls, db, zDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(v1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) @@ -94235,7 +89898,7 @@ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uin rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(117296)) + rc = _sqlite3CorruptError(tls, int32(117301)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -94280,10 +89943,9 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - _ = libc.Int32FromInt32(0) - zOut = _sqlite3DbMallocZero(tls, db, uint64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) } else { - zOut = _sqlite3DbMallocZero(tls, db, uint64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -94295,15 +89957,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { nOut = int32(nSql) - libc.Xmemcpy(tls, zOut, zSql, uint32(nSql)) + libc.Xmemcpy(tls, zOut, zSql, libc.Uint32FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = uint32(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { + nReplace = libc.Uint32FromInt64(nNew) zReplace = zNew } else { - nReplace = uint32(nQuot) + nReplace = libc.Uint32FromInt64(nQuot) zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -94326,11 +89988,11 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, } Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11366, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = uint32(_sqlite3Strlen30(tls, zReplace)) + nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) } iOff = int32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int32(zSql) if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(uint32(iOff)+nReplace), zOut+uintptr(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint32(nOut)-(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } @@ -94360,8 +90022,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - _ = libc.Int32FromInt32(0) - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*20+8+4, uint32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*20+8+4, libc.Uint32FromInt32(val), 0, 0x3) goto _1 _1: ; @@ -94390,13 +90051,12 @@ func _renameResolveTrigger(tls *libc.TLS, pParse uintptr) (r int32) { rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint32(36)) (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab = _sqlite3FindTable(tls, db, (*TTrigger)(unsafe.Pointer(pNew)).Ftable, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(_sqlite3SchemaToIndex(tls, db, (*TTrigger)(unsafe.Pointer(pNew)).FpTabSchema))*16))).FzDbSName) (*TParse)(unsafe.Pointer(pParse)).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pNew)).Fop /* ALWAYS() because if the table of the trigger does not exist, the ** error would have been hit before this point */ if (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0 { - rc = _sqlite3ViewGetColumnNames(tls, pParse, (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab) + rc = libc.BoolInt32(_sqlite3ViewGetColumnNames(tls, pParse, (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0) } /* Resolve symbols in WHEN clause */ if rc == SQLITE_OK && (*TTrigger)(unsafe.Pointer(pNew)).FpWhen != 0 { @@ -94439,8 +90099,6 @@ func _renameResolveTrigger(tls *libc.TLS, pParse uintptr) (r int32) { v2 = SQLITE_OK } rc = v2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TTriggerStep)(unsafe.Pointer(pStep)).FpExprList != 0 { (*TSelect)(unsafe.Pointer(pSel)).FpEList = uintptr(0) } @@ -94473,7 +90131,6 @@ func _renameResolveTrigger(tls *libc.TLS, pParse uintptr) (r int32) { if rc == SQLITE_OK { rc = _sqlite3ResolveExprListNames(tls, bp, (*TTriggerStep)(unsafe.Pointer(pStep)).FpExprList) } - _ = libc.Int32FromInt32(0) if (*TTriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 && rc == SQLITE_OK { pUpsert = (*TTriggerStep)(unsafe.Pointer(pStep)).FpUpsert (*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = pSrc @@ -94668,11 +90325,11 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp goto renameColumnFunc_done } if (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable != 0 { - if int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= uint32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) (*(*TParse)(unsafe.Pointer(bp + 20))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+20, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -94688,7 +90345,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp goto renameColumnFunc_done } } else { - if int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FeTabType) == TABTYP_NORM { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FeTabType) == TABTYP_NORM { /* A regular table */ bFKOnly = Xsqlite3_stricmp(tls, zTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FzName) (*(*TRenameCtx)(unsafe.Pointer(bp))).FpTab = (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable @@ -94735,7 +90392,6 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp i++ } } - _ = libc.Int32FromInt32(0) pFKey = (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -94806,7 +90462,6 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp _renameWalkTrigger(tls, bp+304, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger) } } - _ = libc.Int32FromInt32(0) rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) goto renameColumnFunc_done renameColumnFunc_done: @@ -94837,7 +90492,7 @@ func _renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) var p uintptr _ = p p = *(*uintptr)(unsafe.Pointer(pWalker + 24)) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) && (*TRenameCtx)(unsafe.Pointer(p)).FpTab == (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) && (*TRenameCtx)(unsafe.Pointer(p)).FpTab == (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab { _renameTokenFind(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, p, pExpr+44) } return WRC_Continue @@ -94854,11 +90509,10 @@ func _renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) (r in _, _, _, _ = i, p, pItem, pSrc p = *(*uintptr)(unsafe.Pointer(pWalker + 24)) pSrc = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc - if (*TSelect)(unsafe.Pointer(pSelect)).FselFlags&uint32(libc.Int32FromInt32(SF_View)|libc.Int32FromInt32(SF_CopyCte)) != 0 { + if (*TSelect)(unsafe.Pointer(pSelect)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_View)|libc.Int32FromInt32(SF_CopyCte)) != 0 { return int32(WRC_Prune) } if pSrc == uintptr(0) { - _ = libc.Int32FromInt32(0) return int32(WRC_Abort) } i = 0 @@ -94932,18 +90586,17 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp + 284 rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) if rc == SQLITE_OK { - isLegacy = int32((*Tsqlite3)(unsafe.Pointer(db)).Fflags & libc.Uint64FromInt32(SQLITE_LegacyAlter)) + isLegacy = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags & libc.Uint64FromInt32(SQLITE_LegacyAlter)) if (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 { pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if isLegacy == 0 { pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+332, 0, uint32(36)) (*(*TNameContext)(unsafe.Pointer(bp + 332))).FpParse = bp - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= uint32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+332) @@ -94957,8 +90610,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } } else { /* Modify any FK definitions to point to the new table. */ - if (isLegacy == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0) && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { - _ = libc.Int32FromInt32(0) + if (isLegacy == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { pFKey = (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -95060,7 +90712,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } func _renameQuotefixExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_STRING) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_DblQuoted) != 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_STRING) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_DblQuoted) != 0 { _renameTokenFind(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, *(*uintptr)(unsafe.Pointer(pWalker + 24)), pExpr) } return WRC_Continue @@ -95123,11 +90775,11 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp + 284 if (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 { - if int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= uint32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -95221,21 +90873,21 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zInput = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) bTemp = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 4*4))) - isLegacy = int32((*Tsqlite3)(unsafe.Pointer(db)).Fflags & libc.Uint64FromInt32(SQLITE_LegacyAlter)) + isLegacy = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags & libc.Uint64FromInt32(SQLITE_LegacyAlter)) zWhen = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 5*4))) bNoDQS = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 6*4))) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = int32((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) if bNoDQS != 0 { - *(*Tu64)(unsafe.Pointer(db + 28)) &= uint64(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + *(*Tu64)(unsafe.Pointer(db + 28)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 28)) |= uint64(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + *(*Tu64)(unsafe.Pointer(db + 28)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) if rc == SQLITE_OK { - if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { + if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+284, 0, uint32(36)) (*(*TNameContext)(unsafe.Pointer(bp + 284))).FpParse = bp _sqlite3SelectPrep(tls, bp, (*(*struct { @@ -95307,7 +90959,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(118255)) + rc = _sqlite3CorruptError(tls, int32(118260)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) @@ -95315,7 +90967,6 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pEnd = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol+int32(1))*12))).FzCnName) zEnd = (*TRenameToken)(unsafe.Pointer(pEnd)).Ft.Fz } else { - _ = libc.Int32FromInt32(0) zEnd = zSql + uintptr((*(*struct { FaddColOffset int32 FpFKey uintptr @@ -95358,8 +91009,6 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Database containing pTab ("main" etc.) */ zCol = uintptr(0) /* Index of column zCol in pTab->aCol[] */ /* Look up the table being altered. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_drop_column } @@ -95378,7 +91027,6 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName /* Find the index of the column being dropped. */ zCol = _sqlite3NameFromToken(tls, db, pName) if zCol == uintptr(0) { - _ = libc.Int32FromInt32(0) goto exit_drop_column } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) @@ -95388,8 +91036,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { v1 = __ccgo_ts + 11378 } else { v1 = __ccgo_ts + 5653 @@ -95404,7 +91052,6 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } /* Edit the sqlite_schema table */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _ = libc.Int32FromInt32(0) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName /* Invoke the authorization callback. */ if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { @@ -95417,7 +91064,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11587, int32(1)) /* Edit rows of table on disk */ - if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { + if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) @@ -95436,10 +91083,10 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 44)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, i, reg+i+int32(1)) @@ -95448,7 +91095,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ; i++ } - nField = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) + nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } v8 = pParse + 44 *(*int32)(unsafe.Pointer(v8))++ @@ -95459,11 +91106,11 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if i != iCol && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { + if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) - if iPos < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { + if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } regOut = reg + int32(1) + iPos - libc.BoolInt32(iPos > iColPos) @@ -95495,7 +91142,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _sqlite3VdbeAddOp3(tls, v, int32(OP_MakeRecord), reg+int32(1), nField, regRec) if pPk != 0 { - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iCur, regRec, reg+int32(1), int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iCur, regRec, reg+int32(1), libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) } else { _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iCur, regRec, reg) } @@ -95516,33 +91163,33 @@ exit_drop_column: // ** Register built-in functions used to help implement ALTER TABLE // */ func _sqlite3AlterFunctions(tls *libc.TLS) { - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aAlterTableFuncs)), int32(libc.Uint32FromInt64(200)/libc.Uint32FromInt64(40))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aAlterTableFuncs)), libc.Int32FromUint32(libc.Uint32FromInt64(200)/libc.Uint32FromInt64(40))) } var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int8(9), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FzName: __ccgo_ts + 11605, }, 1: { FnArg: int8(7), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FzName: __ccgo_ts + 11626, }, 2: { FnArg: int8(7), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FzName: __ccgo_ts + 11646, }, 3: { FnArg: int8(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FzName: __ccgo_ts + 11665, }, 4: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FzName: __ccgo_ts + 11684, }, } @@ -95726,7 +91373,7 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW _, _, _, _, _, _, _, _, _, _, _ = aCreateTbl, aRoot, db, i, nToOpen, pDb, pStat, v, zTab, v1, v3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { v1 = int32(2) } else { v1 = int32(1) @@ -95735,15 +91382,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW if v == uintptr(0) { return } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 /* Create new statistic tables if they do not exist, or clear them ** if they do already exist. */ i = 0 for { - if !(i < int32(libc.Uint32FromInt64(24)/libc.Uint32FromInt64(8))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(24)/libc.Uint32FromInt64(8))) { break } zTab = _aTable[i].FzName @@ -95757,7 +91402,7 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ _sqlite3NestedParse(tls, pParse, __ccgo_ts+11787, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = uint32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -95773,7 +91418,7 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW _sqlite3NestedParse(tls, pParse, __ccgo_ts+11840, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ - _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), int32(aRoot[i]), iDb) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) } } } @@ -95788,8 +91433,7 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW if !(i < nToOpen) { break } - _ = libc.Int32FromInt32(0) - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), iStatCur+i, int32(aRoot[i]), iDb, int32(3)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), iStatCur+i, libc.Int32FromUint32(aRoot[i]), iDb, int32(3)) _sqlite3VdbeChangeP5(tls, v, uint16(aCreateTbl[i])) goto _4 _4: @@ -95907,7 +91551,6 @@ type StatAccum1 = TStatAccum1 // /* Reclaim memory used by a StatSample // */ func _sampleClear(tls *libc.TLS, db uintptr, p uintptr) { - _ = libc.Int32FromInt32(0) if (*TStatSample)(unsafe.Pointer(p)).FnRowid != 0 { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(p)).Fu))) (*TStatSample)(unsafe.Pointer(p)).FnRowid = uint32(0) @@ -95919,14 +91562,13 @@ func _sampleClear(tls *libc.TLS, db uintptr, p uintptr) { // /* Initialize the BLOB value of a ROWID // */ func _sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr) { - _ = libc.Int32FromInt32(0) if (*TStatSample)(unsafe.Pointer(p)).FnRowid != 0 { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(p)).Fu))) } - *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(p)).Fu)) = _sqlite3DbMallocRawNN(tls, db, uint64(n)) + *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(p)).Fu)) = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(n)) if *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(p)).Fu)) != 0 { - (*TStatSample)(unsafe.Pointer(p)).FnRowid = uint32(n) - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(p)).Fu)), pData, uint32(n)) + (*TStatSample)(unsafe.Pointer(p)).FnRowid = libc.Uint32FromInt32(n) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(p)).Fu)), pData, libc.Uint32FromInt32(n)) } else { (*TStatSample)(unsafe.Pointer(p)).FnRowid = uint32(0) } @@ -95937,7 +91579,6 @@ func _sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintpt // /* Initialize the INTEGER value of a ROWID. // */ func _sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid Ti64) { - _ = libc.Int32FromInt32(0) if (*TStatSample)(unsafe.Pointer(p)).FnRowid != 0 { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(p)).Fu))) } @@ -95954,11 +91595,11 @@ func _sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { (*TStatSample)(unsafe.Pointer(pTo)).FisPSample = (*TStatSample)(unsafe.Pointer(pFrom)).FisPSample (*TStatSample)(unsafe.Pointer(pTo)).FiCol = (*TStatSample)(unsafe.Pointer(pFrom)).FiCol (*TStatSample)(unsafe.Pointer(pTo)).FiHash = (*TStatSample)(unsafe.Pointer(pFrom)).FiHash - libc.Xmemcpy(tls, (*TStatSample)(unsafe.Pointer(pTo)).FanEq, (*TStatSample)(unsafe.Pointer(pFrom)).FanEq, uint32(8)*uint32((*TStatAccum)(unsafe.Pointer(p)).FnCol)) - libc.Xmemcpy(tls, (*TStatSample)(unsafe.Pointer(pTo)).FanLt, (*TStatSample)(unsafe.Pointer(pFrom)).FanLt, uint32(8)*uint32((*TStatAccum)(unsafe.Pointer(p)).FnCol)) - libc.Xmemcpy(tls, (*TStatSample)(unsafe.Pointer(pTo)).FanDLt, (*TStatSample)(unsafe.Pointer(pFrom)).FanDLt, uint32(8)*uint32((*TStatAccum)(unsafe.Pointer(p)).FnCol)) + libc.Xmemcpy(tls, (*TStatSample)(unsafe.Pointer(pTo)).FanEq, (*TStatSample)(unsafe.Pointer(pFrom)).FanEq, uint32(8)*libc.Uint32FromInt32((*TStatAccum)(unsafe.Pointer(p)).FnCol)) + libc.Xmemcpy(tls, (*TStatSample)(unsafe.Pointer(pTo)).FanLt, (*TStatSample)(unsafe.Pointer(pFrom)).FanLt, uint32(8)*libc.Uint32FromInt32((*TStatAccum)(unsafe.Pointer(p)).FnCol)) + libc.Xmemcpy(tls, (*TStatSample)(unsafe.Pointer(pTo)).FanDLt, (*TStatSample)(unsafe.Pointer(pFrom)).FanDLt, uint32(8)*libc.Uint32FromInt32((*TStatAccum)(unsafe.Pointer(p)).FnCol)) if (*TStatSample)(unsafe.Pointer(pFrom)).FnRowid != 0 { - _sampleSetRowid(tls, (*TStatAccum)(unsafe.Pointer(p)).Fdb, pTo, int32((*TStatSample)(unsafe.Pointer(pFrom)).FnRowid), *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(pFrom)).Fu))) + _sampleSetRowid(tls, (*TStatAccum)(unsafe.Pointer(p)).Fdb, pTo, libc.Int32FromUint32((*TStatSample)(unsafe.Pointer(pFrom)).FnRowid), *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(pFrom)).Fu))) } else { _sampleSetRowidInt64(tls, (*TStatAccum)(unsafe.Pointer(p)).Fdb, pTo, *(*Ti64)(unsafe.Pointer(pFrom + 12))) } @@ -96031,7 +91672,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { v1 = int32(SQLITE_STAT4_SAMPLES) } else { v1 = 0 @@ -96041,24 +91682,21 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* Decode the three function arguments */ _ = argc nCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))) - _ = libc.Int32FromInt32(0) nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Allocate the space required for the StatAccum object */ - n = int32(uint32(112) + uint32(8)*uint32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint32(n) + libc.Uint32FromInt64(8)*uint32(nColUp)) /* StatAccum.anEq */ + n = libc.Int32FromUint32(uint32(112) + uint32(8)*libc.Uint32FromInt32(nColUp)) /* StatAccum.anDLt */ + n = int32(uint32(n) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(nColUp)) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint32(n) + (libc.Uint32FromInt64(8)*uint32(nColUp) + libc.Uint32FromInt64(36)*uint32(nCol+mxSample) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(3)*uint32(nColUp)*uint32(nCol+mxSample))) + n = int32(uint32(n) + (libc.Uint32FromInt64(8)*libc.Uint32FromInt32(nColUp) + libc.Uint32FromInt64(36)*libc.Uint32FromInt32(nCol+mxSample) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(3)*libc.Uint32FromInt32(nColUp)*libc.Uint32FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, uint64(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return } (*TStatAccum)(unsafe.Pointer(p)).Fdb = db - (*TStatAccum)(unsafe.Pointer(p)).FnEst = uint64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) + (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol @@ -96074,9 +91712,9 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).FmxSample = v2 if mxSample != 0 { /* Used to iterate through p->aSample[] */ (*TStatAccum)(unsafe.Pointer(p)).FiGet = -int32(1) - (*TStatAccum)(unsafe.Pointer(p)).FnPSample = (*TStatAccum)(unsafe.Pointer(p)).FnEst/uint64(mxSample/libc.Int32FromInt32(3)+libc.Int32FromInt32(1)) + libc.Uint64FromInt32(1) + (*TStatAccum)(unsafe.Pointer(p)).FnPSample = (*TStatAccum)(unsafe.Pointer(p)).FnEst/libc.Uint64FromInt32(mxSample/libc.Int32FromInt32(3)+libc.Int32FromInt32(1)) + libc.Uint64FromInt32(1) (*TStatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt = (*TStatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(nColUp)*8 - (*TStatAccum)(unsafe.Pointer(p)).FiPrn = uint32(0x689e962d)*uint32(nCol) ^ uint32(0xd0944565)*uint32(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) + (*TStatAccum)(unsafe.Pointer(p)).FiPrn = uint32(0x689e962d)*libc.Uint32FromInt32(nCol) ^ uint32(0xd0944565)*libc.Uint32FromInt32(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) /* Set up the StatAccum.a[] and aBest[] arrays */ (*TStatAccum)(unsafe.Pointer(p)).Fa = (*TStatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(nColUp)*8 (*TStatAccum)(unsafe.Pointer(p)).FaBest = (*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr(mxSample)*36 @@ -96087,17 +91725,16 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { break } (*(*TStatSample)(unsafe.Pointer((*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*36))).FanEq = pSpace - pSpace += uintptr(libc.Uint32FromInt64(8) * uint32(nColUp)) + pSpace += uintptr(libc.Uint32FromInt64(8) * libc.Uint32FromInt32(nColUp)) (*(*TStatSample)(unsafe.Pointer((*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*36))).FanLt = pSpace - pSpace += uintptr(libc.Uint32FromInt64(8) * uint32(nColUp)) + pSpace += uintptr(libc.Uint32FromInt64(8) * libc.Uint32FromInt32(nColUp)) (*(*TStatSample)(unsafe.Pointer((*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*36))).FanDLt = pSpace - pSpace += uintptr(libc.Uint32FromInt64(8) * uint32(nColUp)) + pSpace += uintptr(libc.Uint32FromInt64(8) * libc.Uint32FromInt32(nColUp)) goto _3 _3: ; i++ } - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < nCol) { @@ -96145,7 +91782,6 @@ func _sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintp var i, nCol int32 _, _ = i, nCol nCol = (*TStatAccum)(unsafe.Pointer(pAccum)).FnCol - _ = libc.Int32FromInt32(0) i = (*TStatSample)(unsafe.Pointer(pNew)).FiCol + int32(1) for { if !(i < nCol) { @@ -96181,8 +91817,6 @@ func _sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) _, _ = nEqNew, nEqOld nEqNew = *(*TtRowcnt)(unsafe.Pointer((*TStatSample)(unsafe.Pointer(pNew)).FanEq + uintptr((*TStatSample)(unsafe.Pointer(pNew)).FiCol)*8)) nEqOld = *(*TtRowcnt)(unsafe.Pointer((*TStatSample)(unsafe.Pointer(pOld)).FanEq + uintptr((*TStatSample)(unsafe.Pointer(pOld)).FiCol)*8)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if nEqNew > nEqOld { return int32(1) } @@ -96206,7 +91840,6 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { var i, iMin int32 _, _, _, _, _, _, _, _, _ = anDLt, anEq, anLt, i, iMin, pMin, pOld, pSample, pUpgrade pSample = uintptr(0) - _ = libc.Int32FromInt32(0) /* StatAccum.nMaxEqZero is set to the maximum number of leading 0 ** values in the anEq[] array of any sample in StatAccum.a[]. In ** other words, if nMaxEqZero is n, then it is guaranteed that there @@ -96214,9 +91847,8 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { if nEqZero > (*TStatAccum)(unsafe.Pointer(p)).FnMaxEqZero { (*TStatAccum)(unsafe.Pointer(p)).FnMaxEqZero = nEqZero } - if int32((*TStatSample)(unsafe.Pointer(pNew)).FisPSample) == 0 { + if libc.Int32FromUint8((*TStatSample)(unsafe.Pointer(pNew)).FisPSample) == 0 { pUpgrade = uintptr(0) - _ = libc.Int32FromInt32(0) /* This sample is being added because the prefix that ends in column ** iCol occurs many times in the table. However, if we have already ** added a sample that shares this prefix, there is no need to add @@ -96232,8 +91864,6 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { if (*TStatSample)(unsafe.Pointer(pOld)).FisPSample != 0 { return } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pUpgrade == uintptr(0) || _sampleIsBetter(tls, p, pOld, pUpgrade) != 0 { pUpgrade = pOld } @@ -96256,7 +91886,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { anLt = (*TStatSample)(unsafe.Pointer(pMin)).FanLt anDLt = (*TStatSample)(unsafe.Pointer(pMin)).FanDLt _sampleClear(tls, (*TStatAccum)(unsafe.Pointer(p)).Fdb, pMin) - libc.Xmemmove(tls, pMin, pMin+1*36, uint32(36)*uint32((*TStatAccum)(unsafe.Pointer(p)).FnSample-(*TStatAccum)(unsafe.Pointer(p)).FiMin-libc.Int32FromInt32(1))) + libc.Xmemmove(tls, pMin, pMin+1*36, uint32(36)*libc.Uint32FromInt32((*TStatAccum)(unsafe.Pointer(p)).FnSample-(*TStatAccum)(unsafe.Pointer(p)).FiMin-libc.Int32FromInt32(1))) pSample = (*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr((*TStatAccum)(unsafe.Pointer(p)).FnSample-int32(1))*36 (*TStatSample)(unsafe.Pointer(pSample)).FnRowid = uint32(0) (*TStatSample)(unsafe.Pointer(pSample)).FanEq = anEq @@ -96267,13 +91897,12 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { /* The "rows less-than" for the rowid column must be greater than that ** for the last sample in the p->a[] array. Otherwise, the samples would ** be out of order. */ - _ = libc.Int32FromInt32(0) /* Insert the new sample */ pSample = (*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr((*TStatAccum)(unsafe.Pointer(p)).FnSample)*36 _sampleCopy(tls, p, pSample, pNew) (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ - libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint32(8)*uint32(nEqZero)) + libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint32(8)*libc.Uint32FromInt32(nEqZero)) goto find_new_min find_new_min: ; @@ -96295,7 +91924,6 @@ find_new_min: ; i++ } - _ = libc.Int32FromInt32(0) (*TStatAccum)(unsafe.Pointer(p)).FiMin = iMin } } @@ -96341,7 +91969,6 @@ func _samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { if !(j < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - _ = libc.Int32FromInt32(0) goto _3 _3: ; @@ -96413,8 +92040,6 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { iChng = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) _ = argc _ = context - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TStatAccum)(unsafe.Pointer(p)).FnRow == uint64(0) { /* This is the first call to this function. Do initialization. */ i = 0 @@ -96496,7 +92121,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { i++ } } else { - if (*TStatAccum)(unsafe.Pointer(p)).FnLimit != 0 && (*TStatAccum)(unsafe.Pointer(p)).FnRow > uint64((*TStatAccum)(unsafe.Pointer(p)).FnLimit)*uint64(int32((*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead)+libc.Int32FromInt32(1)) { + if (*TStatAccum)(unsafe.Pointer(p)).FnLimit != 0 && (*TStatAccum)(unsafe.Pointer(p)).FnRow > libc.Uint64FromInt32((*TStatAccum)(unsafe.Pointer(p)).FnLimit)*libc.Uint64FromInt32(libc.Int32FromUint8((*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead)+libc.Int32FromInt32(1)) { (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead++ Xsqlite3_result_int(tls, context, libc.BoolInt32(*(*TtRowcnt)(unsafe.Pointer((*TStatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt)) > uint64(0))) } @@ -96548,9 +92173,6 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { p = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) /* STAT4 has a parameter on this routine. */ eCall = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if eCall == STAT_GET_STAT1 { /* Loop counter */ _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, ((*TStatAccum)(unsafe.Pointer(p)).FnKeyCol+int32(1))*int32(100)) @@ -96571,7 +92193,6 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { iVal = uint64(1) } Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11883, libc.VaList(bp+56, iVal)) - _ = libc.Int32FromInt32(0) goto _2 _2: ; @@ -96589,12 +92210,11 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if (*TStatSample)(unsafe.Pointer(pS)).FnRowid == uint32(0) { Xsqlite3_result_int64(tls, context, *(*Ti64)(unsafe.Pointer(pS + 12))) } else { - Xsqlite3_result_blob(tls, context, *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(pS)).Fu)), int32((*TStatSample)(unsafe.Pointer(pS)).FnRowid), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_blob(tls, context, *(*uintptr)(unsafe.Pointer(&(*TStatSample)(unsafe.Pointer(pS)).Fu)), libc.Int32FromUint32((*TStatSample)(unsafe.Pointer(pS)).FnRowid), uintptr(-libc.Int32FromInt32(1))) } } } else { aCnt = uintptr(0) - _ = libc.Int32FromInt32(0) switch eCall { case int32(STAT_GET_NEQ): aCnt = (*(*TStatSample)(unsafe.Pointer((*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr((*TStatAccum)(unsafe.Pointer(p)).FiGet)*36))).FanEq @@ -96639,7 +92259,6 @@ func init() { func _callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) { _sqlite3VdbeAddOp2(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Integer), iParam, regStat+int32(1)) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat, regOut, libc.Int32FromInt32(1)+libc.Int32FromInt32(IsStat4), uintptr(unsafe.Pointer(&_statGetFuncdef)), 0) } @@ -96688,12 +92307,11 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint doOnce = int32(1) /* Flag for a one-time computation */ pStat1 = uintptr(0) _sqlite3TouchRegister(tls, pParse, iMem) - _ = libc.Int32FromInt32(0) v = _sqlite3GetVdbe(tls, pParse) if v == uintptr(0) || pTab == uintptr(0) { return } - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { /* Do not gather statistics on views or virtual tables */ return } @@ -96701,10 +92319,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on system tables */ return } - _ = libc.Int32FromInt32(0) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ANALYZE), (*TTable)(unsafe.Pointer(pTab)).FzName, uintptr(0), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) != 0 { return } @@ -96750,14 +92365,14 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint needTableCnt = uint8(0) } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { - nCol = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) zIdxName = (*TTable)(unsafe.Pointer(pTab)).FzName nColTest = nCol - int32(1) } else { - nCol = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) zIdxName = (*TIndex)(unsafe.Pointer(pIdx)).FzName if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 { - v14 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) - int32(1) + v14 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) - int32(1) } else { v14 = nCol - int32(1) } @@ -96807,8 +92422,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint ** the sqlite_stat4 table. */ _sqlite3TouchRegister(tls, pParse, regPrev+nColTest) /* Open a read-only cursor on the index being analyzed. */ - _ = libc.Int32FromInt32(0) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), iIdxCur, int32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), iIdxCur, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) /* Implementation of the following: ** @@ -96822,7 +92436,6 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint ** stat_init() ** goto chng_addr_0; */ - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit, regTemp2) /* Arguments to stat_init(): ** (1) the number of columns in the index including the rowid @@ -96830,16 +92443,15 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint ** (2) the number of columns in the key without the rowid/pk ** (3) estimated number of rows in the index. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nCol, regStat+int32(1)) - _ = libc.Int32FromInt32(0) - _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol), regRowid) - _sqlite3VdbeAddOp3(tls, v, int32(OP_Count), iIdxCur, regTemp, libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) != uint32(0))) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol), regRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Count), iIdxCur, regTemp, libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) != uint32(0))) _sqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat+int32(1), regStat, int32(4), uintptr(unsafe.Pointer(&_statInitFuncdef)), 0) addrGotoEnd = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iIdxCur) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regChng) addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*uint32(nColTest))) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*libc.Uint32FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -96855,7 +92467,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint */ _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) - if nColTest == int32(1) && int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) == int32(1) && int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) != OE_None { + if nColTest == int32(1) && libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) == int32(1) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) != OE_None { /* For a single-column UNIQUE index, once we have found a non-NULL ** row, we know that all the rest will be distinct, so skip ** subsequent distinctness tests. */ @@ -96908,31 +92520,28 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint ** Next csr ** if !eof(csr) goto next_row; */ - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { - _ = libc.Int32FromInt32(0) + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), iIdxCur, regRowid) } else { pPk = _sqlite3PrimaryKeyIndex(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpTable) - regKey = _sqlite3GetTempRange(tls, pParse, int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) + regKey = _sqlite3GetTempRange(tls, pParse, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) j = 0 for { - if !(j < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { + if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: ; j++ } - _sqlite3VdbeAddOp3(tls, v, int32(OP_MakeRecord), regKey, int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol), regRowid) - _sqlite3ReleaseTempRange(tls, pParse, regKey, int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_MakeRecord), regKey, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol), regRowid) + _sqlite3ReleaseTempRange(tls, pParse, regKey, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) } } - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddFunctionCall(tls, pParse, int32(1), regStat, regTemp, libc.Int32FromInt32(2)+libc.Int32FromInt32(IsStat4), uintptr(unsafe.Pointer(&_statPushFuncdef)), 0) if (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit != 0 { j1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), regTemp) @@ -96953,14 +92562,13 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11914, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) /* Add the entries to the stat4 table. */ - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) && (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0 { + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) && (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0 { regEq = regStat1 regLt = regStat1 + int32(1) regDLt = regStat1 + int32(2) @@ -96972,7 +92580,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint } else { v18 = int32(OP_NotFound) } - seekOp = uint8(v18) + seekOp = libc.Uint8FromInt32(v18) /* No STAT4 data is generated if the number of rows is zero */ if addrGotoEnd == 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Cast), regStat1, int32(SQLITE_AFF_INTEGER)) @@ -96987,9 +92595,9 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint break } /* Number of columns in pX */ if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pX + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { - nColX = int32((*TIndex)(unsafe.Pointer(pX)).FnKeyCol) + nColX = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pX)).FnKeyCol) } else { - nColX = int32((*TIndex)(unsafe.Pointer(pX)).FnColumn) + nColX = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pX)).FnColumn) } if nColX > mxCol { mxCol = nColX @@ -97003,16 +92611,14 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3TouchRegister(tls, pParse, regCol+mxCol) doOnce = 0 _sqlite3ClearTempRegCache(tls, pParse) /* tag-20230325-1 */ - _ = libc.Int32FromInt32(0) } - _ = libc.Int32FromInt32(0) addrNext = _sqlite3VdbeCurrentAddr(tls, v) _callStatGet(tls, pParse, regStat, int32(STAT_GET_ROWID), regSampleRowid) addrIsNull = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), regSampleRowid) _callStatGet(tls, pParse, regStat, int32(STAT_GET_NEQ), regEq) _callStatGet(tls, pParse, regStat, int32(STAT_GET_NLT), regLt) _callStatGet(tls, pParse, regStat, int32(STAT_GET_NDLT), regDLt) - _sqlite3VdbeAddOp4Int(tls, v, int32(seekOp), iTabCur, addrNext, regSampleRowid, 0) + _sqlite3VdbeAddOp4Int(tls, v, libc.Int32FromUint8(seekOp), iTabCur, addrNext, regSampleRowid, 0) i = 0 for { if !(i < nCol) { @@ -97047,7 +92653,6 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11914, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) @@ -97089,7 +92694,6 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab - _ = libc.Int32FromInt32(0) k = (*THash)(unsafe.Pointer(pSchema + 8)).Ffirst for { if !(k != 0) { @@ -97116,8 +92720,6 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) { var iDb, iStatCur int32 _, _ = iDb, iStatCur - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -97156,11 +92758,9 @@ func _sqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Read the database schema. If an error occurs, leave an error message ** and code in pParse and return NULL. */ - _ = libc.Int32FromInt32(0) if SQLITE_OK != _sqlite3ReadSchema(tls, pParse) { return } - _ = libc.Int32FromInt32(0) if pName1 == uintptr(0) { /* Form 1: Analyze everything */ i = 0 @@ -97213,7 +92813,7 @@ func _sqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp } } } - if v8 = int32((*Tsqlite3)(unsafe.Pointer(db)).FnSqlExec) == 0; v8 { + if v8 = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FnSqlExec) == 0; v8 { v7 = _sqlite3GetVdbe(tls, pParse) v = v7 } @@ -97270,7 +92870,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, if !(v2 >= int32('0') && c <= int32('9')) { break } - v = v*uint64(10) + uint64(c) - uint64('0') + v = v*uint64(10) + libc.Uint64FromInt32(c) - uint64('0') z++ } if aOut != 0 { @@ -97299,7 +92899,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, if sz < int32(2) { sz = int32(2) } - (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, uint64(sz)) + (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { if Xsqlite3_strglob(tls, __ccgo_ts+11947, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 6, 0x40) @@ -97344,7 +92944,6 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not var _ /* fakeIdx at bp+0 */ TIndex _, _, _, _, _, _ = aiRowEst, nCol, pIndex, pInfo, pTable, z pInfo = pData - _ = libc.Int32FromInt32(0) _ = NotUsed _ = argc if argv == uintptr(0) || *(*uintptr)(unsafe.Pointer(argv)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(argv + 2*4)) == uintptr(0) { @@ -97366,12 +92965,12 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not z = *(*uintptr)(unsafe.Pointer(argv + 2*4)) if pIndex != 0 { aiRowEst = uintptr(0) - nCol = int32((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol) + int32(1) + nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol) + int32(1) /* Index.aiRowEst may already be set here if there are duplicate ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint32(8)*uint32(nCol))) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint32(8)*libc.Uint32FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -97403,8 +93002,6 @@ func _sqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { var j int32 var p uintptr _, _ = j, p - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample != 0 { j = 0 for { @@ -97459,13 +93056,13 @@ func _initAvgEq(tls *libc.TLS, pIdx uintptr) { sumEq = uint64(0) /* Sum of the nEq values */ avgEq = uint64(0) /* Number of rows in index */ nSum100 = 0 /* Number of distinct values in index */ - if !((*TIndex)(unsafe.Pointer(pIdx)).FaiRowEst != 0) || iCol >= int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) || *(*TtRowcnt)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(iCol+int32(1))*8)) == uint64(0) { + if !((*TIndex)(unsafe.Pointer(pIdx)).FaiRowEst != 0) || iCol >= libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) || *(*TtRowcnt)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(iCol+int32(1))*8)) == uint64(0) { nRow = *(*TtRowcnt)(unsafe.Pointer((*TIndexSample)(unsafe.Pointer(pFinal)).FanLt + uintptr(iCol)*8)) - nDist100 = int64(uint64(libc.Int64FromInt32(100)) * *(*TtRowcnt)(unsafe.Pointer((*TIndexSample)(unsafe.Pointer(pFinal)).FanDLt + uintptr(iCol)*8))) + nDist100 = libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromInt32(100)) * *(*TtRowcnt)(unsafe.Pointer((*TIndexSample)(unsafe.Pointer(pFinal)).FanDLt + uintptr(iCol)*8))) nSample-- } else { nRow = *(*TtRowcnt)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowEst)) - nDist100 = int64(uint64(libc.Int64FromInt32(100)) * *(*TtRowcnt)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowEst)) / *(*TtRowcnt)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(iCol+int32(1))*8))) + nDist100 = libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromInt32(100)) * *(*TtRowcnt)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowEst)) / *(*TtRowcnt)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(iCol+int32(1))*8))) } (*TIndex)(unsafe.Pointer(pIdx)).FnRowEst0 = nRow /* Set nSum to the number of distinct (iCol+1) field prefixes that @@ -97487,7 +93084,7 @@ func _initAvgEq(tls *libc.TLS, pIdx uintptr) { i++ } if nDist100 > nSum100 && sumEq < nRow { - avgEq = uint64(libc.Int64FromInt32(100)) * (nRow - sumEq) / uint64(nDist100-nSum100) + avgEq = libc.Uint64FromInt64(libc.Int64FromInt32(100)) * (nRow - sumEq) / libc.Uint64FromInt64(nDist100-nSum100) } if avgEq == uint64(0) { avgEq = uint64(1) @@ -97543,7 +93140,6 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, nByte, nCol, nIdxCol, nSample, pIdx, pIdx1, pPrevIdx, pSample, pSpace, rc, zIndex, zIndex1, zSql /* Result codes from subroutines */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Text of the SQL statement */ pPrevIdx = uintptr(0) /* A slot in pIdx->aSample[] */ - _ = libc.Int32FromInt32(0) zSql = _sqlite3MPrintf(tls, db, zSql1, libc.VaList(bp+16, zDb)) if !(zSql != 0) { return int32(SQLITE_NOMEM) @@ -97561,7 +93157,6 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u } nSample = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) pIdx = _findIndexOrPrimaryKey(tls, db, zIndex, zDb) - _ = libc.Int32FromInt32(0) if pIdx == uintptr(0) { continue } @@ -97569,18 +93164,17 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u /* The same index appears in sqlite_stat4 under multiple names */ continue } - _ = libc.Int32FromInt32(0) if !((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { - nIdxCol = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + nIdxCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) } else { - nIdxCol = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + nIdxCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample - nByte = int32(uint32(20) * uint32(nSample)) - nByte = int32(uint32(nByte) + libc.Uint32FromInt64(8)*uint32(nIdxCol)*libc.Uint32FromInt32(3)*uint32(nSample)) - nByte = int32(uint32(nByte) + uint32(nIdxCol)*libc.Uint32FromInt64(8)) /* Space for Index.aAvgEq[] */ - (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + nByte = libc.Int32FromUint32(uint32(20) * libc.Uint32FromInt32(nSample)) + nByte = int32(uint32(nByte) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(nIdxCol)*libc.Uint32FromInt32(3)*libc.Uint32FromInt32(nSample)) + nByte = int32(uint32(nByte) + libc.Uint32FromInt32(nIdxCol)*libc.Uint32FromInt64(8)) /* Space for Index.aAvgEq[] */ + (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) return int32(SQLITE_NOMEM) @@ -97605,7 +93199,6 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u ; i++ } - _ = libc.Int32FromInt32(0) } rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc != 0 { @@ -97654,13 +93247,13 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u ** buffer. In any case, eight 0x00 bytes prevents this from causing ** a buffer overread. */ (*TIndexSample)(unsafe.Pointer(pSample)).Fn = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) - (*TIndexSample)(unsafe.Pointer(pSample)).Fp = _sqlite3DbMallocZero(tls, db, uint64((*TIndexSample)(unsafe.Pointer(pSample)).Fn+int32(8))) + (*TIndexSample)(unsafe.Pointer(pSample)).Fp = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32((*TIndexSample)(unsafe.Pointer(pSample)).Fn+int32(8))) if (*TIndexSample)(unsafe.Pointer(pSample)).Fp == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) return int32(SQLITE_NOMEM) } if (*TIndexSample)(unsafe.Pointer(pSample)).Fn != 0 { - libc.Xmemcpy(tls, (*TIndexSample)(unsafe.Pointer(pSample)).Fp, Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)), uint32((*TIndexSample)(unsafe.Pointer(pSample)).Fn)) + libc.Xmemcpy(tls, (*TIndexSample)(unsafe.Pointer(pSample)).Fp, Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)), libc.Uint32FromInt32((*TIndexSample)(unsafe.Pointer(pSample)).Fn)) } (*TIndex)(unsafe.Pointer(pIdx1)).FnSample++ } @@ -97683,12 +93276,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { var v2 bool _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { + if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11733, zDb) pStat4 = v1 } - if v2 && v1 != uintptr(0) && int32((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { + if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { rc = _loadStatTbl(tls, db, __ccgo_ts+11959, __ccgo_ts+12028, zDb) } return rc @@ -97725,17 +93317,14 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { _, _, _, _, _, _, _, _, _, _, _ = i, pIdx, pIdx1, pIdx2, pSchema, pStat1, pTab, rc, zSql, v3, v5 rc = SQLITE_OK pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Clear any prior statistics */ - _ = libc.Int32FromInt32(0) i = (*THash)(unsafe.Pointer(pSchema + 8)).Ffirst for { if !(i != 0) { break } pTab = (*THashElem)(unsafe.Pointer(i)).Fdata - *(*Tu32)(unsafe.Pointer(pTab + 28)) &= uint32(^libc.Int32FromInt32(TF_HasStat1)) + *(*Tu32)(unsafe.Pointer(pTab + 28)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(TF_HasStat1)) goto _1 _1: ; @@ -97760,7 +93349,7 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11707, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 - if v3 != 0 && int32((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { + if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12080, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -97770,7 +93359,6 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { } } /* Set appropriate defaults on all indexes not in the sqlite_stat1 table */ - _ = libc.Int32FromInt32(0) i = (*THash)(unsafe.Pointer(pSchema + 24)).Ffirst for { if !(i != 0) { @@ -97794,9 +93382,9 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { if (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 { v5 = 0 } else { - v5 = int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) + v5 = libc.Int32FromUint16((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(v5) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = libc.Uint16FromInt32(v5) } i = (*THash)(unsafe.Pointer(pSchema + 24)).Ffirst for { @@ -97859,7 +93447,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { _ = rc rc = SQLITE_OK if pExpr != 0 { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_ID) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_ID) { rc = _sqlite3ResolveExprNames(tls, pName, pExpr) } else { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) @@ -97970,7 +93558,6 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { break } - _ = libc.Int32FromInt32(0) if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12161, libc.VaList(bp+32, zName)) goto attach_error @@ -97990,7 +93577,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint32FromInt64(16)*libc.Uint32FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(uint32(16)*uint32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1)))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(uint32(16)*libc.Uint32FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1)))) if aNew == uintptr(0) { return } @@ -98012,9 +93599,8 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) return } - _ = libc.Int32FromInt32(0) *(*uint32)(unsafe.Pointer(bp + 8)) |= uint32(SQLITE_OPEN_MAIN_DB) - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp)), db, pNew+4, 0, int32(*(*uint32)(unsafe.Pointer(bp + 8)))) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp)), db, pNew+4, 0, libc.Int32FromUint32(*(*uint32)(unsafe.Pointer(bp + 8)))) (*Tsqlite3)(unsafe.Pointer(db)).FnDb++ (*TDb)(unsafe.Pointer(pNew)).FzDbSName = _sqlite3DbStrDup(tls, db, zName) } @@ -98028,20 +93614,20 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if !((*TDb)(unsafe.Pointer(pNew)).FpSchema != 0) { rc = int32(SQLITE_NOMEM) } else { - if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && int32((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { + if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12220, 0) rc = int32(SQLITE_ERROR) } } _sqlite3BtreeEnter(tls, (*TDb)(unsafe.Pointer(pNew)).FpBt) pPager = _sqlite3BtreePager(tls, (*TDb)(unsafe.Pointer(pNew)).FpBt) - _sqlite3PagerLockingMode(tls, pPager, int32((*Tsqlite3)(unsafe.Pointer(db)).FdfltLockMode)) + _sqlite3PagerLockingMode(tls, pPager, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FdfltLockMode)) _sqlite3BtreeSecureDelete(tls, (*TDb)(unsafe.Pointer(pNew)).FpBt, _sqlite3BtreeSecureDelete(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpBt, -int32(1))) _sqlite3BtreeSetPagerFlags(tls, (*TDb)(unsafe.Pointer(pNew)).FpBt, uint32(uint64(PAGER_SYNCHRONOUS_FULL)|(*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(PAGER_FLAGS_MASK))) _sqlite3BtreeLeave(tls, (*TDb)(unsafe.Pointer(pNew)).FpBt) } } - (*TDb)(unsafe.Pointer(pNew)).Fsafety_level = uint8(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) + (*TDb)(unsafe.Pointer(pNew)).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) if rc == SQLITE_OK && (*TDb)(unsafe.Pointer(pNew)).FzDbSName == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -98054,17 +93640,15 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == SQLITE_OK { _sqlite3BtreeEnterAll(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) - *(*Tu32)(unsafe.Pointer(db + 24)) &= uint32(^libc.Int32FromInt32(DBFLAG_SchemaKnownOk)) + *(*Tu32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_SchemaKnownOk)) if !(int32(uint32(*(*uint8)(unsafe.Pointer(db + 168 + 8))&0x4>>2)) != 0) { rc = _sqlite3Init(tls, db, bp+12) } _sqlite3BtreeLeaveAll(tls, db) - _ = libc.Int32FromInt32(0) } if rc != 0 { if !(int32(uint32(*(*uint8)(unsafe.Pointer(db + 168 + 8))&0x4>>2)) != 0) { iDb = (*Tsqlite3)(unsafe.Pointer(db)).FnDb - int32(1) - _ = libc.Int32FromInt32(0) if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpBt != 0 { _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpBt) (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpBt = uintptr(0) @@ -98153,7 +93737,6 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { } /* If any TEMP triggers reference the schema being detached, move those ** triggers to reference the TEMP schema itself. */ - _ = libc.Int32FromInt32(0) pEntry = (*THash)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema + 40)).Ffirst for pEntry != 0 { pTrig = (*THashElem)(unsafe.Pointer(pEntry)).Fdata @@ -98199,8 +93782,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut goto attach_end } if pAuthArg != 0 { - if int32((*TExpr)(unsafe.Pointer(pAuthArg)).Fop) == int32(TK_STRING) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pAuthArg)).Fop) == int32(TK_STRING) { zAuthArg = *(*uintptr)(unsafe.Pointer(pAuthArg + 8)) } else { zAuthArg = uintptr(0) @@ -98215,7 +93797,6 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut _sqlite3ExprCode(tls, pParse, pFilename, regArgs) _sqlite3ExprCode(tls, pParse, pDbname, regArgs+int32(1)) _sqlite3ExprCode(tls, pParse, pKey, regArgs+int32(2)) - _ = libc.Int32FromInt32(0) if v != 0 { _sqlite3VdbeAddFunctionCall(tls, pParse, 0, regArgs+int32(3)-int32((*TFuncDef)(unsafe.Pointer(pFunc)).FnArg), regArgs+int32(3), int32((*TFuncDef)(unsafe.Pointer(pFunc)).FnArg), pFunc, 0) /* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this @@ -98288,9 +93869,9 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { _ = pFix pFix = *(*uintptr)(unsafe.Pointer(p + 24)) if !((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp != 0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FromDDL)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_VARIABLE) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_VARIABLE) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { @@ -98325,7 +93906,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer(pList)).FnSrc) { break } - if int32((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 { + if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 { if (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0 { if iDb != _sqlite3FindDbName(tls, db, (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase) { _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12437, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase)) @@ -98375,7 +93956,6 @@ func _sqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zTy var db uintptr _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) (*TDbFixer)(unsafe.Pointer(pFix)).FpParse = pParse (*TDbFixer)(unsafe.Pointer(pFix)).FzDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName (*TDbFixer)(unsafe.Pointer(pFix)).FpSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema @@ -98603,19 +94183,15 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint var pTab, zCol uintptr _, _, _, _, _ = iCol, iDb, iSrc, pTab, zCol pTab = uintptr(0) /* Index of column in table */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSchema) if iDb < 0 { /* An attempt to read a column out of a subquery or other ** temporary table. */ return } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRIGGER) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRIGGER) { pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - _ = libc.Int32FromInt32(0) iSrc = 0 for { if !(iSrc < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { @@ -98636,17 +94212,14 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint return } if iCol >= 0 { - _ = libc.Int32FromInt32(0) zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName } else { if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - _ = libc.Int32FromInt32(0) zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName } else { zCol = __ccgo_ts + 8030 } } - _ = libc.Int32FromInt32(0) if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -98668,8 +94241,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, /* Don't do any authorization checks if the database is initializing ** or if the parser is being invoked from within sqlite3_declare_vtab. */ - _ = libc.Int32FromInt32(0) - if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0) || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0) || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { return SQLITE_OK } /* EVIDENCE-OF: R-43249-19882 The third through sixth parameters to the @@ -98699,7 +94271,6 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, // ** popped. Or if pParse==0, this routine is a no-op. // */ func _sqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr) { - _ = libc.Int32FromInt32(0) (*TAuthContext)(unsafe.Pointer(pContext)).FpParse = pParse (*TAuthContext)(unsafe.Pointer(pContext)).FzAuthContext = (*TParse)(unsafe.Pointer(pParse)).FzAuthContext (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = zContext @@ -98775,7 +94346,6 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc var i, nBytes, v3 int32 var p, pToplevel, v1, v4 uintptr _, _, _, _, _, _, _ = i, nBytes, p, pToplevel, v1, v3, v4 - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FpToplevel != 0 { v1 = (*TParse)(unsafe.Pointer(pParse)).FpToplevel } else { @@ -98797,8 +94367,8 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc ; i++ } - nBytes = int32(uint32(16) * uint32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) - (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, uint64(nBytes)) + nBytes = libc.Int32FromUint32(uint32(16) * libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) + (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { v4 = pToplevel + 116 v3 = *(*int32)(unsafe.Pointer(v4)) @@ -98835,7 +94405,6 @@ func _codeTableLocks(tls *libc.TLS, pParse uintptr) { var p, pVdbe uintptr _, _, _, _ = i, p, p1, pVdbe pVdbe = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TParse)(unsafe.Pointer(pParse)).FnTableLock) { @@ -98843,7 +94412,7 @@ func _codeTableLocks(tls *libc.TLS, pParse uintptr) { } p = (*TParse)(unsafe.Pointer(pParse)).FaTableLock + uintptr(i)*16 p1 = (*TTableLock)(unsafe.Pointer(p)).FiDb - _sqlite3VdbeAddOp4(tls, pVdbe, int32(OP_TableLock), p1, int32((*TTableLock)(unsafe.Pointer(p)).FiTab), int32((*TTableLock)(unsafe.Pointer(p)).FisWriteLock), (*TTableLock)(unsafe.Pointer(p)).FzLockName, -int32(1)) + _sqlite3VdbeAddOp4(tls, pVdbe, int32(OP_TableLock), p1, libc.Int32FromUint32((*TTableLock)(unsafe.Pointer(p)).FiTab), libc.Int32FromUint8((*TTableLock)(unsafe.Pointer(p)).FisWriteLock), (*TTableLock)(unsafe.Pointer(p)).FzLockName, -int32(1)) goto _1 _1: ; @@ -98873,9 +94442,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { var addrRewind, i, iDb, reg, v2 int32 var db, pEL, pRet, pReturning, pSchema, v, vtab uintptr _, _, _, _, _, _, _, _, _, _, _, _ = addrRewind, db, i, iDb, pEL, pRet, pReturning, pSchema, reg, v, vtab, v2 - _ = libc.Int32FromInt32(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).Fnested != 0 { return } @@ -98885,7 +94452,6 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } return } - _ = libc.Int32FromInt32(0) /* Begin by generating some termination code at the end of the ** vdbe program */ @@ -98900,7 +94466,6 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } } - _ = libc.Int32FromInt32(0) if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { pReturning = *(*uintptr)(unsafe.Pointer(pParse + 144)) @@ -98931,9 +94496,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { ** transaction on each used database and to verify the schema cookie ** on each used database. */ - _ = libc.Int32FromInt32(0) _sqlite3VdbeJumpHere(tls, v, 0) - _ = libc.Int32FromInt32(0) iDb = 0 for { if libc.BoolInt32((*TParse)(unsafe.Pointer(pParse)).FcookieMask&(libc.Uint32FromInt32(1)<<iDb) != uint32(0)) == 0 { @@ -98942,7 +94505,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { _sqlite3VdbeUsesBtree(tls, v, iDb) pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Transaction), iDb, libc.BoolInt32((*TParse)(unsafe.Pointer(pParse)).FwriteMask&(libc.Uint32FromInt32(1)<<iDb) != uint32(0)), (*TSchema)(unsafe.Pointer(pSchema)).Fschema_cookie, (*TSchema)(unsafe.Pointer(pSchema)).FiGeneration) - if int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _sqlite3VdbeChangeP5(tls, v, uint16(1)) } goto _3 @@ -98989,7 +94552,6 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { break } - _ = libc.Int32FromInt32(0) _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pEL + 8 + uintptr(i)*20))).FpExpr, *(*int32)(unsafe.Pointer(pEL + 8 + uintptr(i)*20 + 16))) goto _5 _5: @@ -99008,12 +94570,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } /* Get the VDBE program ready for execution */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* A minimum of one cursor is required if autoincrement is used * See ticket [a696379c1f08866] */ - _ = libc.Int32FromInt32(0) _sqlite3VdbeMakeReady(tls, v, pParse) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_DONE) } else { @@ -99052,7 +94611,7 @@ func _sqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint if (*TParse)(unsafe.Pointer(pParse)).FeParseMode != 0 { return } - _ = libc.Int32FromInt32(0) /* Nesting should only be of limited depth */ + /* Nesting should only be of limited depth */ ap = va zSql = _sqlite3VMPrintf(tls, db, zFormat, ap) _ = ap @@ -99097,7 +94656,6 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp _, _ = i, p p = uintptr(0) /* All mutexes are required for schema access. Make sure we hold them. */ - _ = libc.Int32FromInt32(0) if zDatabase != 0 { i = 0 for { @@ -99150,7 +94708,6 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { break } - _ = libc.Int32FromInt32(0) p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, zName) if p != 0 { break @@ -99201,7 +94758,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt /* If zName is the not the name of a table in the schema created using ** CREATE, then check to see if it is the name of an virtual table that ** can be an eponymous virtual table. */ - if int32((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+396, zName) if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12560, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) @@ -99215,7 +94772,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) } else { - if int32((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && int32((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) } } @@ -99232,7 +94789,6 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6924, libc.VaList(bp+8, zMsg, zName)) } } else { - _ = libc.Int32FromInt32(0) } return p } @@ -99252,7 +94808,6 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt var iDb int32 var zDb uintptr _, _ = iDb, zDb - _ = libc.Int32FromInt32(0) if (*TSrcItem)(unsafe.Pointer(p)).FpSchema != 0 { iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(p)).FpSchema) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*16))).FzDbSName @@ -99300,7 +94855,6 @@ func _sqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) (r _, _, _, _, _ = i, j, p, pSchema, v2 p = uintptr(0) /* All mutexes are required for schema access. Make sure we hold them. */ - _ = libc.Int32FromInt32(0) i = OMIT_TEMPDB for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -99313,11 +94867,9 @@ func _sqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) (r } j = v2 /* Search TEMP before MAIN */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*16))).FpSchema - _ = libc.Int32FromInt32(0) if zDb != 0 && _sqlite3DbIsNamed(tls, db, j, zDb) == 0 { goto _1 } - _ = libc.Int32FromInt32(0) p = _sqlite3HashFind(tls, pSchema+24, zName) if p != 0 { break @@ -99358,7 +94910,6 @@ func _sqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { func _sqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr) { var p, pHash, pIndex uintptr _, _, _ = p, pHash, pIndex - _ = libc.Int32FromInt32(0) pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema + 24 pIndex = _sqlite3HashInsert(tls, pHash, zIdxName, uintptr(0)) if pIndex != 0 { @@ -99435,14 +94986,12 @@ func _sqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { var i int32 var p1, p2 uintptr _, _, _ = i, p1, p2 - _ = libc.Int32FromInt32(0) if iDb >= 0 { - _ = libc.Int32FromInt32(0) p1 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema + 78 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(DB_ResetWanted)) p2 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema + 78 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(DB_ResetWanted)) - *(*Tu32)(unsafe.Pointer(db + 24)) &= uint32(^libc.Int32FromInt32(DBFLAG_SchemaKnownOk)) + *(*Tu32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_SchemaKnownOk)) } if (*Tsqlite3)(unsafe.Pointer(db)).FnSchemaLock == uint32(0) { i = 0 @@ -99450,7 +94999,7 @@ func _sqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { break } - if int32((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema)).FschemaFlags)&int32(DB_ResetWanted) == int32(DB_ResetWanted) { + if libc.Int32FromUint16((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema)).FschemaFlags)&int32(DB_ResetWanted) == int32(DB_ResetWanted) { _sqlite3SchemaClear(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema) } goto _3 @@ -99491,7 +95040,7 @@ func _sqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { ; i++ } - *(*Tu32)(unsafe.Pointer(db + 24)) &= uint32(^(libc.Int32FromInt32(DBFLAG_SchemaChange) | libc.Int32FromInt32(DBFLAG_SchemaKnownOk))) + *(*Tu32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(DBFLAG_SchemaChange) | libc.Int32FromInt32(DBFLAG_SchemaKnownOk))) _sqlite3VtabUnlockList(tls, db) _sqlite3BtreeLeaveAll(tls, db) if (*Tsqlite3)(unsafe.Pointer(db)).FnSchemaLock == uint32(0) { @@ -99505,7 +95054,7 @@ func _sqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { // ** This routine is called when a commit occurs. // */ func _sqlite3CommitInternalChanges(tls *libc.TLS, db uintptr) { - *(*Tu32)(unsafe.Pointer(db + 24)) &= uint32(^libc.Int32FromInt32(DBFLAG_SchemaChange)) + *(*Tu32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_SchemaChange)) } // C documentation @@ -99519,27 +95068,26 @@ func _sqlite3ColumnSetExpr(tls *libc.TLS, pParse uintptr, pTab uintptr, pCol uin var pList uintptr var v1 int32 _, _ = pList, v1 - _ = libc.Int32FromInt32(0) pList = (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 44))).FpDfltList - if int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt) == 0 || pList == uintptr(0) || (*TExprList)(unsafe.Pointer(pList)).FnExpr < int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt) { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) == 0 || pList == uintptr(0) || (*TExprList)(unsafe.Pointer(pList)).FnExpr < libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) { if pList == uintptr(0) { v1 = int32(1) } else { v1 = (*TExprList)(unsafe.Pointer(pList)).FnExpr + int32(1) } - (*TColumn)(unsafe.Pointer(pCol)).FiDflt = uint16(v1) + (*TColumn)(unsafe.Pointer(pCol)).FiDflt = libc.Uint16FromInt32(v1) (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 44))).FpDfltList = _sqlite3ExprListAppend(tls, pParse, pList, pExpr) } else { - _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*20))).FpExpr) - (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*20))).FpExpr = pExpr + _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*20))).FpExpr) + (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*20))).FpExpr = pExpr } } @@ -99551,10 +95099,10 @@ func _sqlite3ColumnSetExpr(tls *libc.TLS, pParse uintptr, pTab uintptr, pCol uin // ** Return NULL if the column has no associated expression. // */ func _sqlite3ColumnExpr(tls *libc.TLS, pTab uintptr, pCol uintptr) (r uintptr) { - if int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt) == 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) == 0 { return uintptr(0) } - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { return uintptr(0) } if (*(*struct { @@ -99568,14 +95116,14 @@ func _sqlite3ColumnExpr(tls *libc.TLS, pTab uintptr, pCol uintptr) (r uintptr) { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr - })(unsafe.Pointer(pTab + 44))).FpDfltList)).FnExpr < int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt) { + })(unsafe.Pointer(pTab + 44))).FpDfltList)).FnExpr < libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) { return uintptr(0) } return (*(*TExprList_item)(unsafe.Pointer((*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr - })(unsafe.Pointer(pTab + 44))).FpDfltList + 8 + uintptr(int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*20))).FpExpr + })(unsafe.Pointer(pTab + 44))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*20))).FpExpr } // C documentation @@ -99587,16 +95135,15 @@ func _sqlite3ColumnSetColl(tls *libc.TLS, db uintptr, pCol uintptr, zColl uintpt var n, nColl Ti64 var zNew, p1 uintptr _, _, _, _ = n, nColl, zNew, p1 - _ = libc.Int32FromInt32(0) n = int64(_sqlite3Strlen30(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(1)) - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { n += int64(_sqlite3Strlen30(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName+uintptr(n)) + int32(1)) } nColl = int64(_sqlite3Strlen30(tls, zColl) + int32(1)) - zNew = _sqlite3DbRealloc(tls, db, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, uint64(nColl+n)) + zNew = _sqlite3DbRealloc(tls, db, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, libc.Uint64FromInt64(nColl+n)) if zNew != 0 { (*TColumn)(unsafe.Pointer(pCol)).FzCnName = zNew - libc.Xmemcpy(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName+uintptr(n), zColl, uint32(nColl)) + libc.Xmemcpy(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName+uintptr(n), zColl, libc.Uint32FromInt64(nColl)) p1 = pCol + 10 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_HASCOLL)) } @@ -99610,14 +95157,14 @@ func _sqlite3ColumnSetColl(tls *libc.TLS, db uintptr, pCol uintptr, zColl uintpt func _sqlite3ColumnColl(tls *libc.TLS, pCol uintptr) (r uintptr) { var z uintptr _ = z - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASCOLL) == 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASCOLL) == 0 { return uintptr(0) } z = (*TColumn)(unsafe.Pointer(pCol)).FzCnName for *(*int8)(unsafe.Pointer(z)) != 0 { z++ } - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { for cond := true; cond; cond = *(*int8)(unsafe.Pointer(z)) != 0 { z++ } @@ -99635,8 +95182,6 @@ func _sqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { var i int32 var pCol, v1 uintptr _, _, _ = i, pCol, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v1 = (*TTable)(unsafe.Pointer(pTable)).FaCol pCol = v1 if v1 != uintptr(0) { @@ -99645,7 +95190,6 @@ func _sqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(pTable)).FnCol)) { break } - _ = libc.Int32FromInt32(0) _sqlite3DbFree(tls, db, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) goto _2 _2: @@ -99654,7 +95198,7 @@ func _sqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { pCol += 12 } _sqlite3DbNNFreeNN(tls, db, (*TTable)(unsafe.Pointer(pTable)).FaCol) - if int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM { _sqlite3ExprListDelete(tls, db, (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -99664,7 +95208,7 @@ func _sqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { if (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) { (*TTable)(unsafe.Pointer(pTable)).FaCol = uintptr(0) (*TTable)(unsafe.Pointer(pTable)).FnCol = 0 - if int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM { (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -99702,12 +95246,9 @@ func _deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { break } pNext = (*TIndex)(unsafe.Pointer(pIndex)).FpNext - _ = libc.Int32FromInt32(0) - if (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) && !(int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { zName = (*TIndex)(unsafe.Pointer(pIndex)).FzName _sqlite3HashInsert(tls, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema+24, zName, uintptr(0)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } _sqlite3FreeIndex(tls, db, pIndex) goto _1 @@ -99715,13 +95256,12 @@ func _deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { ; pIndex = pNext } - if int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM { _sqlite3FkDelete(tls, db, pTable) } else { - if int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VTAB) { _sqlite3VtabClear(tls, db, pTable) } else { - _ = libc.Int32FromInt32(0) _sqlite3SelectDelete(tls, db, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTable)).Fu))).FpSelect) @@ -99735,7 +95275,6 @@ func _deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { _sqlite3ExprListDelete(tls, db, (*TTable)(unsafe.Pointer(pTable)).FpCheck) _sqlite3DbFree(tls, db, pTable) /* Verify that no lookaside memory was used by schema tables */ - _ = libc.Int32FromInt32(0) } func _sqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { @@ -99744,7 +95283,6 @@ func _sqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { var v3 bool _, _, _ = v1, v2, v3 /* Do not delete the table until the reference count reaches zero. */ - _ = libc.Int32FromInt32(0) if !(pTable != 0) { return } @@ -99772,10 +95310,6 @@ func _sqlite3DeleteTableGeneric(tls *libc.TLS, db uintptr, pTable uintptr) { func _sqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr) { var p, pDb uintptr _, _ = p, pDb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Zero-length table names are allowed */ pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 p = _sqlite3HashInsert(tls, (*TDb)(unsafe.Pointer(pDb)).FpSchema+8, zTabName, uintptr(0)) @@ -99908,7 +95442,6 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u var iDb int32 _, _ = db, iDb /* Database holding the object */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12595, 0) @@ -99921,8 +95454,7 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u return -int32(1) } } else { - _ = libc.Int32FromInt32(0) - iDb = int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) + iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) *(*uintptr)(unsafe.Pointer(pUnqual)) = pName1 } return iDb @@ -99934,7 +95466,7 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u // ** True if PRAGMA writable_schema is ON // */ func _sqlite3WritableSchema(tls *libc.TLS, db uintptr) (r int32) { - return libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_Defensive)) == uint64(SQLITE_WriteSchema)) + return libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_Defensive)) == uint64(SQLITE_WriteSchema)) } // C documentation @@ -99966,7 +95498,7 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return int32(SQLITE_ERROR) } } else { - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6589, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6589, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12632, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } @@ -100008,7 +95540,7 @@ func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) _ = i i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { @@ -100044,7 +95576,7 @@ func _sqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol Ti16) (r Ti1 if !(i <= int32(iCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { iCol++ } goto _1 @@ -100098,7 +95630,6 @@ func _sqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol Ti16) (r Ti1 var i int32 var n Ti16 _, _ = i, n - _ = libc.Int32FromInt32(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasVirtual) == uint32(0) || int32(iCol) < 0 { return iCol } @@ -100108,7 +95639,7 @@ func _sqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol Ti16) (r Ti1 if !(i < int32(iCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { n++ } goto _1 @@ -100116,7 +95647,7 @@ func _sqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol Ti16) (r Ti1 ; i++ } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { /* iCol is a virtual column itself */ return int16(int32((*TTable)(unsafe.Pointer(pTab)).FnNVCol) + i - int32(n)) } else { @@ -100181,7 +95712,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Unqualified name of the table to create */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum == uint32(1) { /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ - iDb = int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) + iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { v1 = __ccgo_ts + 6597 } else { @@ -100205,7 +95736,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui iDb = int32(1) } zName = _sqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenMap(tls, pParse, zName, *(*uintptr)(unsafe.Pointer(bp))) } } @@ -100221,11 +95752,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error } - if int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) == int32(1) { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) == int32(1) { isTemp = int32(1) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { v3 = __ccgo_ts + 6597 @@ -100235,7 +95764,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error } - if !(isVirtual != 0) && _sqlite3AuthCheck(tls, pParse, int32(_aCode[isTemp+int32(2)*isView]), zName, uintptr(0), zDb) != 0 { + if !(isVirtual != 0) && _sqlite3AuthCheck(tls, pParse, libc.Int32FromUint8(_aCode[isTemp+int32(2)*isView]), zName, uintptr(0), zDb) != 0 { goto begin_table_error } /* Make sure the new table name does not collide with an existing @@ -100245,7 +95774,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** and types will be used, so there is no need to test for namespace ** collisions. */ - if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { + if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { zDb1 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if SQLITE_OK != _sqlite3ReadSchema(tls, pParse) { goto begin_table_error @@ -100253,14 +95782,13 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui pTable = _sqlite3FindTable(tls, db, zName, zDb1) if pTable != 0 { if !(noErr != 0) { - if int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { v4 = __ccgo_ts + 10921 } else { v4 = __ccgo_ts + 9183 } _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12715, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { - _ = libc.Int32FromInt32(0) _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) } @@ -100273,7 +95801,6 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } pTable = _sqlite3DbMallocZero(tls, db, uint64(64)) if pTable == uintptr(0) { - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ goto begin_table_error @@ -100283,8 +95810,6 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui (*TTable)(unsafe.Pointer(pTable)).FpSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema (*TTable)(unsafe.Pointer(pTable)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pTable)).FnRowLogEst = int16(200) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FpNewTable = pTable /* Begin generating the code that will insert the table record into ** the schema table. Note in particular that we must go ahead @@ -100332,7 +95857,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } fileFormat = v15 _sqlite3VdbeAddOp3(tls, v, int32(OP_SetCookie), iDb, int32(BTREE_FILE_FORMAT), fileFormat) - _sqlite3VdbeAddOp3(tls, v, int32(OP_SetCookie), iDb, int32(BTREE_TEXT_ENCODING), int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_SetCookie), iDb, int32(BTREE_TEXT_ENCODING), libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc)) _sqlite3VdbeJumpHere(tls, v, addr1) /* This just creates a place-holder record in the sqlite_schema table. ** The record created does not contain anything yet. It will be replaced @@ -100346,7 +95871,6 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pParse + 144)) = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) @@ -100425,7 +95949,6 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12771, 0) } else { - _ = libc.Int32FromInt32(0) } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) pRet = _sqlite3DbMallocZero(tls, db, uint64(144)) @@ -100452,7 +95975,6 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { (*TReturning)(unsafe.Pointer(pRet)).FretTStep.FpTrig = pRet + 8 (*TReturning)(unsafe.Pointer(pRet)).FretTStep.FpExprList = pList pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema + 40 - _ = libc.Int32FromInt32(0) if _sqlite3HashInsert(tls, pHash, pRet+104, pRet+8) == pRet+8 { _sqlite3OomFault(tls, db) } @@ -100491,7 +96013,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12825, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) return } - if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3DequoteToken(tls, bp) } /* Because keywords GENERATE ALWAYS can be converted into identifiers @@ -100500,12 +96022,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** text. */ if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12848, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn -= uint32(6) - for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1)))))])&int32(0x01) != 0 { + for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn-- } if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12855, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn -= uint32(9) - for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1)))))])&int32(0x01) != 0 { + for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn-- } } @@ -100520,9 +96042,9 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok if !(i < int32(SQLITE_N_STDTYPE)) { break } - if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn == uint32(_sqlite3StdTypeLen[i]) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz, _sqlite3StdType[i], int32((*(*TToken)(unsafe.Pointer(bp + 8))).Fn)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn == uint32(_sqlite3StdTypeLen[i]) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz, _sqlite3StdType[i], libc.Int32FromUint32((*(*TToken)(unsafe.Pointer(bp + 8))).Fn)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn = uint32(0) - eType = uint8(i + int32(1)) + eType = libc.Uint8FromInt32(i + int32(1)) affinity = _sqlite3StdTypeAffinity[i] if int32(affinity) <= int32(SQLITE_AFF_TEXT) { szEst = uint8(5) @@ -100535,11 +96057,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok i++ } } - z = _sqlite3DbMallocRaw(tls, db, uint64(int64((*(*TToken)(unsafe.Pointer(bp))).Fn)+int64(1)+int64((*(*TToken)(unsafe.Pointer(bp + 8))).Fn)+libc.BoolInt64((*(*TToken)(unsafe.Pointer(bp + 8))).Fn > libc.Uint32FromInt32(0)))) + z = _sqlite3DbMallocRaw(tls, db, libc.Uint64FromInt64(libc.Int64FromUint32((*(*TToken)(unsafe.Pointer(bp))).Fn)+int64(1)+libc.Int64FromUint32((*(*TToken)(unsafe.Pointer(bp + 8))).Fn)+libc.BoolInt64((*(*TToken)(unsafe.Pointer(bp + 8))).Fn > libc.Uint32FromInt32(0)))) if z == uintptr(0) { return } - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenMap(tls, pParse, z, bp) } libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, (*(*TToken)(unsafe.Pointer(bp))).Fn) @@ -100551,7 +96073,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FhName) == int32(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FzCnName) == 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FzCnName) == 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12865, libc.VaList(bp+24, z)) _sqlite3DbFree(tls, db, z) return @@ -100561,7 +96083,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ; i++ } - aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, uint64((int64((*TTable)(unsafe.Pointer(p)).FnCol)+int64(1))*int64(12))) + aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64((int64((*TTable)(unsafe.Pointer(p)).FnCol)+int64(1))*int64(12))) if aNew == uintptr(0) { _sqlite3DbFree(tls, db, z) return @@ -100607,17 +96129,16 @@ func _sqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { return } pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*12 - libc.SetBitFieldPtr8Uint32(pCol+4, uint32(uint8(onError)), 0, 0xf) + libc.SetBitFieldPtr8Uint32(pCol+4, uint32(libc.Uint8FromInt32(onError)), 0, 0xf) *(*Tu32)(unsafe.Pointer(p + 28)) |= uint32(TF_HasNotNull) /* Set the uniqNotNull flag on any UNIQUE or PK indexes already created ** on this column. */ - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_UNIQUE) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_UNIQUE) != 0 { pIdx = (*TTable)(unsafe.Pointer(p)).FpIndex for { if !(pIdx != 0) { break } - _ = libc.Int32FromInt32(0) if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn))) == int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1) { libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 3, 0x8) } @@ -100668,37 +96189,36 @@ func _sqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) (r int8) { h = uint32(0) aff = int8(SQLITE_AFF_NUMERIC) zChar = uintptr(0) - _ = libc.Int32FromInt32(0) for *(*int8)(unsafe.Pointer(zIn)) != 0 { x = *(*Tu8)(unsafe.Pointer(zIn)) h = h<<libc.Int32FromInt32(8) + uint32(_sqlite3UpperToLower[x]) zIn++ - if h == uint32(libc.Int32FromUint8('c')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('h')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('a')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('r')) { /* CHAR */ + if h == libc.Uint32FromInt32(libc.Int32FromUint8('c')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('h')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('a')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('r')) { /* CHAR */ aff = int8(SQLITE_AFF_TEXT) zChar = zIn } else { - if h == uint32(libc.Int32FromUint8('c')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('l')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('o')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('b')) { /* CLOB */ + if h == libc.Uint32FromInt32(libc.Int32FromUint8('c')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('l')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('o')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('b')) { /* CLOB */ aff = int8(SQLITE_AFF_TEXT) } else { - if h == uint32(libc.Int32FromUint8('t')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('e')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('x')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('t')) { /* TEXT */ + if h == libc.Uint32FromInt32(libc.Int32FromUint8('t')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('e')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('x')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('t')) { /* TEXT */ aff = int8(SQLITE_AFF_TEXT) } else { - if h == uint32(libc.Int32FromUint8('b')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('l')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('o')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('b')) && (int32(aff) == int32(SQLITE_AFF_NUMERIC) || int32(aff) == int32(SQLITE_AFF_REAL)) { + if h == libc.Uint32FromInt32(libc.Int32FromUint8('b')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('l')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('o')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('b')) && (int32(aff) == int32(SQLITE_AFF_NUMERIC) || int32(aff) == int32(SQLITE_AFF_REAL)) { aff = int8(SQLITE_AFF_BLOB) if int32(*(*int8)(unsafe.Pointer(zIn))) == int32('(') { zChar = zIn } } else { - if h == uint32(libc.Int32FromUint8('r')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('e')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('a')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('l')) && int32(aff) == int32(SQLITE_AFF_NUMERIC) { + if h == libc.Uint32FromInt32(libc.Int32FromUint8('r')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('e')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('a')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('l')) && int32(aff) == int32(SQLITE_AFF_NUMERIC) { aff = int8(SQLITE_AFF_REAL) } else { - if h == uint32(libc.Int32FromUint8('f')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('l')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('o')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('a')) && int32(aff) == int32(SQLITE_AFF_NUMERIC) { + if h == libc.Uint32FromInt32(libc.Int32FromUint8('f')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('l')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('o')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('a')) && int32(aff) == int32(SQLITE_AFF_NUMERIC) { aff = int8(SQLITE_AFF_REAL) } else { - if h == uint32(libc.Int32FromUint8('d')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('o')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('u')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('b')) && int32(aff) == int32(SQLITE_AFF_NUMERIC) { + if h == libc.Uint32FromInt32(libc.Int32FromUint8('d')<<libc.Int32FromInt32(24)+libc.Int32FromUint8('o')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('u')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('b')) && int32(aff) == int32(SQLITE_AFF_NUMERIC) { aff = int8(SQLITE_AFF_REAL) } else { - if h&uint32(0x00FFFFFF) == uint32(libc.Int32FromUint8('i')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('n')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('t')) { /* INT */ + if h&uint32(0x00FFFFFF) == libc.Uint32FromInt32(libc.Int32FromUint8('i')<<libc.Int32FromInt32(16)+libc.Int32FromUint8('n')<<libc.Int32FromInt32(8)+libc.Int32FromUint8('t')) { /* INT */ aff = int8(SQLITE_AFF_INTEGER) break } @@ -100717,7 +96237,7 @@ func _sqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) (r int8) { if int32(aff) < int32(SQLITE_AFF_NUMERIC) { if zChar != 0 { for *(*int8)(unsafe.Pointer(zChar)) != 0 { - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zChar)))])&int32(0x04) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zChar)))])&int32(0x04) != 0 { /* BLOB(k), VARCHAR(k), CHAR(k) -> r=(k/4+1) */ _sqlite3GetInt32(tls, zChar, bp) break @@ -100732,7 +96252,7 @@ func _sqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) (r int8) { if *(*int32)(unsafe.Pointer(bp)) > int32(255) { *(*int32)(unsafe.Pointer(bp)) = int32(255) } - (*TColumn)(unsafe.Pointer(pCol)).FszEst = uint8(*(*int32)(unsafe.Pointer(bp))) + (*TColumn)(unsafe.Pointer(pCol)).FszEst = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp))) } return aff } @@ -100759,12 +96279,12 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar db = (*TParse)(unsafe.Pointer(pParse)).Fdb p = (*TParse)(unsafe.Pointer(pParse)).FpNewTable if p != uintptr(0) { - isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) + isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*12 - if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, uint8(isInit)) != 0) { + if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12936, 0) } else { libc.Xmemset(tls, bp, 0, uint32(52)) @@ -100778,7 +96298,7 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar } } } - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameExprUnmap(tls, pParse, pExpr) } _sqlite3ExprDelete(tls, db, pExpr) @@ -100803,10 +96323,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar // ** unchanged. // */ func _sqlite3StringToId(tls *libc.TLS, p uintptr) { - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_STRING) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_STRING) { (*TExpr)(unsafe.Pointer(p)).Fop = uint8(TK_ID) } else { - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLLATE) && int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(p)).FpLeft)).Fop) == int32(TK_STRING) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLLATE) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(p)).FpLeft)).Fop) == int32(TK_STRING) { (*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(p)).FpLeft)).Fop = uint8(TK_ID) } } @@ -100822,7 +96342,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { _ = p1 p1 = pCol + 10 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12977, 0) } } @@ -100877,10 +96397,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError break } pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr) - _ = libc.Int32FromInt32(0) _sqlite3StringToId(tls, pCExpr) - if int32((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) iCol = 0 for { @@ -100905,14 +96423,13 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError } } if nTerm == int32(1) && pCol != 0 && int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4)) == int32(COLTYPE_INTEGER) && sortOrder != int32(SQLITE_SO_DESC) { - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && pList != 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && pList != 0 { pCExpr1 = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8))).FpExpr) _sqlite3RenameTokenRemap(tls, pParse, pTab+32, pCExpr1) } (*TTable)(unsafe.Pointer(pTab)).FiPKey = int16(iCol) - (*TTable)(unsafe.Pointer(pTab)).FkeyConf = uint8(onError) - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(autoInc * int32(TF_Autoincrement)) + (*TTable)(unsafe.Pointer(pTab)).FkeyConf = libc.Uint8FromInt32(onError) + *(*Tu32)(unsafe.Pointer(pTab + 28)) |= libc.Uint32FromInt32(autoInc * int32(TF_Autoincrement)) if pList != 0 { (*TParse)(unsafe.Pointer(pParse)).FiPkSortOrder = (*(*TExprList_item)(unsafe.Pointer(pList + 8))).Ffg.FsortFlags } @@ -100945,14 +96462,14 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt _, _ = db, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if pTab != 0 && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*16))).FpBt) != 0) { + if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*16))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+80, int32(1)) } else { zStart++ for { - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart)))])&int32(0x01) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zStart)))])&int32(0x01) != 0) { break } goto _1 @@ -100960,11 +96477,11 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt ; zStart++ } - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd + uintptr(-libc.Int32FromInt32(1)))))])&int32(0x01) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zEnd + uintptr(-libc.Int32FromInt32(1)))))])&int32(0x01) != 0 { zEnd-- } (*(*TToken)(unsafe.Pointer(bp))).Fz = zStart - (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(int32(zEnd) - int32((*(*TToken)(unsafe.Pointer(bp))).Fz)) + (*(*TToken)(unsafe.Pointer(bp))).Fn = libc.Uint32FromInt32(int32(zEnd) - int32((*(*TToken)(unsafe.Pointer(bp))).Fz)) _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, bp, int32(1)) } } else { @@ -100984,7 +96501,7 @@ func _sqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { _, _, _, _, _, _ = db, i, p, pIdx, zColl, v1 v1 = (*TParse)(unsafe.Pointer(pParse)).FpNewTable p = v1 - if v1 == uintptr(0) || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if v1 == uintptr(0) || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { return } i = int32((*TTable)(unsafe.Pointer(p)).FnCol) - int32(1) @@ -101004,7 +96521,6 @@ func _sqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { if !(pIdx != 0) { break } - _ = libc.Int32FromInt32(0) if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn))) == i { *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl)) = _sqlite3ColumnColl(tls, (*TTable)(unsafe.Pointer(p)).FaCol+uintptr(i)*12) } @@ -101035,11 +96551,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_done } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*12 - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13126, 0) goto generated_done } - if int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { @@ -101053,25 +96569,23 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } } } - if int32(eType) == int32(COLFLAG_VIRTUAL) { + if libc.Int32FromUint8(eType) == int32(COLFLAG_VIRTUAL) { (*TTable)(unsafe.Pointer(pTab)).FnNVCol-- } p1 = pCol + 10 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | int32(eType)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint8(eType)) *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(eType) - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { _makeColumnPartOfPrimaryKey(tls, pParse, pCol) /* For the error message */ } - if pExpr != 0 && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ID) { + if pExpr != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ID) { /* The value of a generated column needs to be a real expression, not ** just a reference to another column, in order for covering index ** optimizations to work correctly. So if the value is not an expression, ** turn it into one by adding a unary "+" operator. */ pExpr = _sqlite3PExpr(tls, pParse, int32(TK_UPLUS), pExpr, uintptr(0)) } - if pExpr != 0 && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_RAISE) { + if pExpr != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_RAISE) { (*TExpr)(unsafe.Pointer(pExpr)).FaffExpr = (*TColumn)(unsafe.Pointer(pCol)).Faffinity } _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) @@ -101113,8 +96627,7 @@ func _sqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { _, _ = db, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) - _sqlite3VdbeAddOp3(tls, v, int32(OP_SetCookie), iDb, int32(BTREE_SCHEMA_VERSION), int32(libc.Uint32FromInt32(1)+uint32((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema)).Fschema_cookie))) + _sqlite3VdbeAddOp3(tls, v, int32(OP_SetCookie), iDb, int32(BTREE_SCHEMA_VERSION), libc.Int32FromUint32(libc.Uint32FromInt32(1)+libc.Uint32FromInt32((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema)).Fschema_cookie))) } // C documentation @@ -101173,7 +96686,7 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { if !(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j))) != 0) { break } - if !(int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))])&libc.Int32FromInt32(0x06) != 0) && int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != int32('_') { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))])&libc.Int32FromInt32(0x06) != 0) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != int32('_') { break } goto _1 @@ -101181,7 +96694,7 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { ; j++ } - needQuote = libc.BoolInt32(int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent))])&int32(0x04) != 0 || _sqlite3KeywordCode(tls, zIdent, j) != int32(TK_ID) || int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != 0 || j == 0) + needQuote = libc.BoolInt32(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent))])&int32(0x04) != 0 || _sqlite3KeywordCode(tls, zIdent, j) != int32(TK_ID) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != 0 || j == 0) if needQuote != 0 { v2 = i i++ @@ -101194,8 +96707,8 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { } v4 = i i++ - *(*int8)(unsafe.Pointer(z + uintptr(v4))) = int8(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) - if int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) == int32('"') { + *(*int8)(unsafe.Pointer(z + uintptr(v4))) = libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) == int32('"') { v5 = i i++ *(*int8)(unsafe.Pointer(z + uintptr(v5))) = int8('"') @@ -101253,7 +96766,7 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { zEnd = __ccgo_ts + 13226 } n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(n)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -101274,14 +96787,10 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) zType = _azType1[int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] len1 = _sqlite3Strlen30(tls, zType) - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zType, uint32(len1)) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zType, libc.Uint32FromInt32(len1)) *(*int32)(unsafe.Pointer(bp)) += len1 - _ = libc.Int32FromInt32(0) goto _3 _3: ; @@ -101311,27 +96820,26 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int var nByte int32 var zExtra uintptr _, _ = nByte, zExtra - if int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { + if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - _ = libc.Int32FromInt32(0) - nByte = int32((libc.Uint32FromInt64(4) + libc.Uint32FromInt64(2) + libc.Uint32FromInt64(2) + libc.Uint32FromInt32(1)) * uint32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + nByte = libc.Int32FromUint32((libc.Uint32FromInt64(4) + libc.Uint32FromInt64(2) + libc.Uint32FromInt64(2) + libc.Uint32FromInt32(1)) * libc.Uint32FromInt32(N)) + zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FazColl, uint32(4)*uint32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FazColl = zExtra - zExtra += uintptr(uint32(4) * uint32(N)) - libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaiRowLogEst, uint32(2)*uint32(int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+libc.Int32FromInt32(1))) + zExtra += uintptr(uint32(4) * libc.Uint32FromInt32(N)) + libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaiRowLogEst, uint32(2)*libc.Uint32FromInt32(libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(pIdx)).FaiRowLogEst = zExtra - zExtra += uintptr(uint32(2) * uint32(N)) + zExtra += uintptr(uint32(2) * libc.Uint32FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn, uint32(2)*uint32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn = zExtra - zExtra += uintptr(uint32(2) * uint32(N)) + zExtra += uintptr(uint32(2) * libc.Uint32FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = uint16(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -101381,17 +96889,16 @@ func _estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { aCol = (*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } x = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)) - _ = libc.Int32FromInt32(0) if int32(x) < 0 { v2 = int32(1) } else { - v2 = int32((*(*TColumn)(unsafe.Pointer(aCol + uintptr(x)*12))).FszEst) + v2 = libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(x)*12))).FszEst) } - wIndex += uint32(v2) + wIndex += libc.Uint32FromInt32(v2) goto _1 _1: ; @@ -101443,19 +96950,12 @@ func _hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) (r int32) { func _isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) (r int32) { var i, j int32 _, _ = i, j - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) j = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(iCol)*2))) - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < nKey) { break } - _ = libc.Int32FromInt32(0) if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) == j && _sqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(iCol)*4))) == 0 { return int32(1) } @@ -101495,14 +96995,14 @@ func _recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { _, _, _, _ = j, m, pTab, x m = uint64(0) pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - j = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) - int32(1) + j = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) - int32(1) for { if !(j >= 0) { break } x = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2))) - if x >= 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { - if x < int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { + if x >= 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { + if x < libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { m |= libc.Uint64FromInt32(1) << x } } @@ -101512,7 +97012,7 @@ func _recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { j-- } (*TIndex)(unsafe.Pointer(pIdx)).FcolNotIdxed = ^m - _ = libc.Int32FromInt32(0) /* See note-20221022-a */ + /* See note-20221022-a */ } // C documentation @@ -101559,7 +97059,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 && int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12 + 4))&0xf>>0)) == OE_None { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 && int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12 + 4))&0xf>>0)) == OE_None { libc.SetBitFieldPtr8Uint32((*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12+4, libc.Uint32FromInt32(OE_Abort), 0, 0xf) } goto _1 @@ -101572,9 +97072,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(pParse + 144)) != 0 { - _ = libc.Int32FromInt32(0) _sqlite3VdbeChangeP3(tls, v, *(*int32)(unsafe.Pointer(pParse + 144)), int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally @@ -101584,26 +97082,22 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { _sqlite3TokenInit(tls, bp, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName) pList = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3ExprAlloc(tls, db, int32(TK_ID), bp, 0)) if pList == uintptr(0) { - *(*Tu32)(unsafe.Pointer(pTab + 28)) &= uint32(^libc.Int32FromInt32(TF_WithoutRowid)) + *(*Tu32)(unsafe.Pointer(pTab + 28)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(TF_WithoutRowid)) return } - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenRemap(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pList + 8))).FpExpr, pTab+32) } (*(*TExprList_item)(unsafe.Pointer(pList + 8))).Ffg.FsortFlags = (*TParse)(unsafe.Pointer(pParse)).FiPkSortOrder - _ = libc.Int32FromInt32(0) (*TTable)(unsafe.Pointer(pTab)).FiPKey = int16(-int32(1)) - _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, int32((*TTable)(unsafe.Pointer(pTab)).FkeyConf), uintptr(0), uintptr(0), 0, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) + _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FkeyConf), uintptr(0), uintptr(0), 0, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { - *(*Tu32)(unsafe.Pointer(pTab + 28)) &= uint32(^libc.Int32FromInt32(TF_WithoutRowid)) + *(*Tu32)(unsafe.Pointer(pTab + 28)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(TF_WithoutRowid)) return } - _ = libc.Int32FromInt32(0) pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - _ = libc.Int32FromInt32(0) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - _ = libc.Int32FromInt32(0) /* ** Remove all redundant columns from the PRIMARY KEY. For example, change ** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)". Later @@ -101613,7 +97107,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { j = v3 i = v3 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } if _isDupColumn(tls, pPk, j, pPk, i) != 0 { @@ -101630,23 +97124,21 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - (*TIndex)(unsafe.Pointer(pPk)).FnKeyCol = uint16(j) + (*TIndex)(unsafe.Pointer(pPk)).FnKeyCol = libc.Uint16FromInt32(j) } - _ = libc.Int32FromInt32(0) libc.SetBitFieldPtr16Uint32(pPk+56, libc.Uint32FromInt32(1), 5, 0x20) if !(int32(uint32(*(*uint8)(unsafe.Pointer(db + 168 + 8))&0x2>>1)) != 0) { libc.SetBitFieldPtr16Uint32(pPk+56, libc.Uint32FromInt32(1), 3, 0x8) } v5 = (*TIndex)(unsafe.Pointer(pPk)).FnKeyCol (*TIndex)(unsafe.Pointer(pPk)).FnColumn = v5 - nPk = int32(v5) + nPk = libc.Int32FromUint16(v5) /* Bypass the creation of the PRIMARY KEY btree and the sqlite_schema ** table entry. This is only required if currently generating VDBE ** code for a CREATE TABLE (not when parsing one as part of reading ** a database schema). */ if v != 0 && (*TIndex)(unsafe.Pointer(pPk)).Ftnum > uint32(0) { - _ = libc.Int32FromInt32(0) - _sqlite3VdbeChangeOpcode(tls, v, int32((*TIndex)(unsafe.Pointer(pPk)).Ftnum), uint8(OP_Goto)) + _sqlite3VdbeChangeOpcode(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pPk)).Ftnum), uint8(OP_Goto)) } /* The root page of the PRIMARY KEY is the table root page */ (*TIndex)(unsafe.Pointer(pPk)).Ftnum = (*TTable)(unsafe.Pointer(pTab)).Ftnum @@ -101668,7 +97160,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { if !(i < nPk) { break } - if !(_isDupColumn(tls, pIdx, int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol), pPk, i) != 0) { + if !(_isDupColumn(tls, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol), pPk, i) != 0) { n++ } goto _7 @@ -101681,16 +97173,16 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 - j = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + j = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) for { if !(i < nPk) { break } - if !(_isDupColumn(tls, pIdx, int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol), pPk, i) != 0) { + if !(_isDupColumn(tls, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol), pPk, i) != 0) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*4)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { @@ -101704,8 +97196,6 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto _6 _6: ; @@ -101719,7 +97209,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if !(_hasColumn(tls, (*TIndex)(unsafe.Pointer(pPk)).FaiColumn, nPk, i) != 0) && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { + if !(_hasColumn(tls, (*TIndex)(unsafe.Pointer(pPk)).FaiColumn, nPk, i) != 0) && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { nExtra++ } goto _10 @@ -101736,8 +97226,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if !(_hasColumn(tls, (*TIndex)(unsafe.Pointer(pPk)).FaiColumn, j, i) != 0) && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { - _ = libc.Int32FromInt32(0) + if !(_hasColumn(tls, (*TIndex)(unsafe.Pointer(pPk)).FaiColumn, j, i) != 0) && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)) = int16(i) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(j)*4)) = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) j++ @@ -101747,8 +97236,6 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _recomputeColumnsNotIndexed(tls, pPk) } @@ -101762,7 +97249,7 @@ func _sqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uint var nName int32 var pMod uintptr _, _ = nName, pMod /* Module for the virtual table */ - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { return 0 } nName = _sqlite3Strlen30(tls, (*TTable)(unsafe.Pointer(pTab)).FzName) @@ -101801,7 +97288,6 @@ func _sqlite3MarkAllShadowTablesOf(tls *libc.TLS, db uintptr, pTab uintptr) { var k, pMod, pOther uintptr var nName int32 _, _, _, _ = k, nName, pMod, pOther /* For looping through the symbol table */ - _ = libc.Int32FromInt32(0) pMod = _sqlite3HashFind(tls, db+396, *(*uintptr)(unsafe.Pointer((*(*struct { FnArg int32 FazArg uintptr @@ -101819,7 +97305,6 @@ func _sqlite3MarkAllShadowTablesOf(tls *libc.TLS, db uintptr, pTab uintptr) { if (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxShadowName == uintptr(0) { return } - _ = libc.Int32FromInt32(0) nName = _sqlite3Strlen30(tls, (*TTable)(unsafe.Pointer(pTab)).FzName) k = (*THash)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FpSchema + 8)).Ffirst for { @@ -101827,8 +97312,7 @@ func _sqlite3MarkAllShadowTablesOf(tls *libc.TLS, db uintptr, pTab uintptr) { break } pOther = (*THashElem)(unsafe.Pointer(k)).Fdata - _ = libc.Int32FromInt32(0) - if !(int32((*TTable)(unsafe.Pointer(pOther)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pOther)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { goto _1 } if (*TTable)(unsafe.Pointer(pOther)).FtabFlags&uint32(TF_Shadow) != 0 { @@ -101866,7 +97350,7 @@ func _sqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) if pTab == uintptr(0) { return 0 } - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { return 0 } return _sqlite3IsShadowTableOf(tls, db, pTab, zName) @@ -101924,7 +97408,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ** table itself. So mark it read-only. */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - if pSelect != 0 || !(int32((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { + if pSelect != 0 || !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1662, 0) return } @@ -101951,7 +97435,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*12 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4)) == COLTYPE_CUSTOM { - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13265, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1662))) } else { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13298, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) @@ -101962,7 +97446,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TColumn)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_BLOB) } } - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 && int32((*TTable)(unsafe.Pointer(p)).FiPKey) != ii && int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) == OE_None { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 && int32((*TTable)(unsafe.Pointer(p)).FiPKey) != ii && int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) == OE_None { libc.SetBitFieldPtr8Uint32(pCol+4, libc.Uint32FromInt32(OE_Abort), 0, 0xf) *(*Tu32)(unsafe.Pointer(p + 28)) |= uint32(TF_HasNotNull) } @@ -101972,8 +97456,6 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii++ } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { @@ -101984,7 +97466,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13375, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } - *(*Tu32)(unsafe.Pointer(p + 28)) |= uint32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) + *(*Tu32)(unsafe.Pointer(p + 28)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) _convertToWithoutRowidTable(tls, pParse, p) } iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) @@ -102060,7 +97542,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* ** Initialize zType for the new view or table. */ - if int32((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ zType = __ccgo_ts + 9183 zType2 = __ccgo_ts + 13451 @@ -102083,7 +97565,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ** be redundant. */ if pSelect != 0 { /* Write cursor on the new table */ - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) (*TParse)(unsafe.Pointer(pParse)).FnErr++ return @@ -102116,7 +97598,6 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if pSelTab == uintptr(0) { return } - _ = libc.Int32FromInt32(0) v12 = (*TTable)(unsafe.Pointer(pSelTab)).FnCol (*TTable)(unsafe.Pointer(p)).FnNVCol = v12 (*TTable)(unsafe.Pointer(p)).FnCol = v12 @@ -102166,9 +97647,8 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Check to see if we need to create an sqlite_sequence table for ** keeping track of autoincrement keys. */ - if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { + if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 - _ = libc.Int32FromInt32(0) if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { _sqlite3NestedParse(tls, pParse, __ccgo_ts+13575, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } @@ -102185,11 +97665,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { pSchema = (*TTable)(unsafe.Pointer(p)).FpSchema - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOld = _sqlite3HashInsert(tls, pSchema+8, (*TTable)(unsafe.Pointer(p)).FzName, p) if pOld != 0 { - _ = libc.Int32FromInt32(0) /* Malloc must have failed inside HashInsert() */ + /* Malloc must have failed inside HashInsert() */ _sqlite3OomFault(tls, db) return } @@ -102198,14 +97676,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - _ = libc.Int32FromInt32(0) if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9705) == 0 { - _ = libc.Int32FromInt32(0) (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } - if !(pSelect != 0) && int32((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { - _ = libc.Int32FromInt32(0) + if !(pSelect != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { if (*TToken)(unsafe.Pointer(pCons)).Fz == uintptr(0) { pCons = pEnd } @@ -102261,7 +97736,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui ** they will persist after the current sqlite3_exec() call returns. */ *(*Tu32)(unsafe.Pointer(pSelect + 4)) |= uint32(SF_View) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(p)).Fu))).FpSelect = pSelect @@ -102280,15 +97755,13 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui ** the end. */ *(*TToken)(unsafe.Pointer(bp)) = (*TParse)(unsafe.Pointer(pParse)).FsLastToken - _ = libc.Int32FromInt32(0) if int32(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz))) != int32(';') { (*(*TToken)(unsafe.Pointer(bp))).Fz += uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn) } (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(0) n = int32((*(*TToken)(unsafe.Pointer(bp))).Fz) - int32((*TToken)(unsafe.Pointer(pBegin)).Fz) - _ = libc.Int32FromInt32(0) z = (*TToken)(unsafe.Pointer(pBegin)).Fz - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n-int32(1)))))])&int32(0x01) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(n-int32(1)))))])&int32(0x01) != 0 { n-- } (*(*TToken)(unsafe.Pointer(bp))).Fz = z + uintptr(n-int32(1)) @@ -102299,7 +97772,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameExprlistUnmap(tls, pParse, pCNames) } _sqlite3ExprListDelete(tls, db, pCNames) @@ -102310,8 +97783,9 @@ create_view_fail: // // /* // ** The Table structure pTable is really a VIEW. Fill in the names of -// ** the columns of the view in the pTable structure. Return the number -// ** of errors. If an error is seen leave an error message in pParse->zErrMsg. +// ** the columns of the view in the pTable structure. Return non-zero if +// ** there are errors. If an error is seen an error message is left +// ** in pParse->zErrMsg. // */ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32) { bp := tls.Alloc(16) @@ -102323,8 +97797,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 _, _, _, _, _, _, _, _, _, _, _ = db, eParseMode, nErr, nSelect, nTab, pSel, pSelTab, rc, xAuth, v1, p2 /* Copy of the SELECT that implements the view */ nErr = 0 /* Number of errors encountered */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Saved xAuth pointer */ - _ = libc.Int32FromInt32(0) - if int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VTAB) { (*Tsqlite3)(unsafe.Pointer(db)).FnSchemaLock++ rc = _sqlite3VtabCallConnect(tls, pParse, pTable) (*Tsqlite3)(unsafe.Pointer(db)).FnSchemaLock-- @@ -102334,7 +97807,6 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** already known. This routine is not called unless either the ** table is virtual or nCol is zero. */ - _ = libc.Int32FromInt32(0) /* A negative nCol is a special marker meaning that we are currently ** trying to compute the column names. If we enter this routine with ** a negative nCol, it means two or more views form a loop, like this: @@ -102354,7 +97826,6 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13708, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } - _ = libc.Int32FromInt32(0) /* If we get this far, it means we need to compute the table names. ** Note that the call to sqlite3ResultSetOfSelect() will expand any ** "*" elements in the results set of the view and will assign cursors @@ -102362,7 +97833,6 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** to be permanent. So the computation is done on a copy of the SELECT ** statement that defines the view. */ - _ = libc.Int32FromInt32(0) pSel = _sqlite3SelectDup(tls, db, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTable)).Fu))).FpSelect, 0) @@ -102394,20 +97864,17 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 */ _sqlite3ColumnsFromExprList(tls, pParse, (*TTable)(unsafe.Pointer(pTable)).FpCheck, pTable+34, pTable+4) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && int32((*TTable)(unsafe.Pointer(pTable)).FnCol) == (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpEList)).FnExpr { - _ = libc.Int32FromInt32(0) _sqlite3SubqueryColumnTypes(tls, pParse, pTable, pSel, int8(SQLITE_AFF_NONE)) } } else { /* CREATE VIEW name AS... without an argument list. Construct ** the column names from the SELECT statement that defines the view. */ - _ = libc.Int32FromInt32(0) (*TTable)(unsafe.Pointer(pTable)).FnCol = (*TTable)(unsafe.Pointer(pSelTab)).FnCol (*TTable)(unsafe.Pointer(pTable)).FaCol = (*TTable)(unsafe.Pointer(pSelTab)).FaCol *(*Tu32)(unsafe.Pointer(pTable + 28)) |= (*TTable)(unsafe.Pointer(pSelTab)).FtabFlags & uint32(COLFLAG_NOINSERT) (*TTable)(unsafe.Pointer(pSelTab)).FnCol = 0 (*TTable)(unsafe.Pointer(pSelTab)).FaCol = uintptr(0) - _ = libc.Int32FromInt32(0) } } (*TTable)(unsafe.Pointer(pTable)).FnNVCol = (*TTable)(unsafe.Pointer(pTable)).FnCol @@ -102417,9 +97884,9 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 if (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 { v1 = 0 } else { - v1 = int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) + v1 = libc.Int32FromUint16((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(v1) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = libc.Uint16FromInt32(v1) (*TParse)(unsafe.Pointer(pParse)).FeParseMode = eParseMode } else { nErr++ @@ -102429,12 +97896,11 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DeleteColumnNames(tls, db, pTable) } - return nErr + return nErr + (*TParse)(unsafe.Pointer(pParse)).FnErr } func _sqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - if !(int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && int32((*TTable)(unsafe.Pointer(pTable)).FnCol) > 0 { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && int32((*TTable)(unsafe.Pointer(pTable)).FnCol) > 0 { return 0 } return _viewGetColumnNames(tls, pParse, pTable) @@ -102448,8 +97914,7 @@ func _sqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) ( func _sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { var i, pTab, p2 uintptr _, _, _ = i, pTab, p2 - _ = libc.Int32FromInt32(0) - if !(int32((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(idx)*16))).FpSchema)).FschemaFlags)&libc.Int32FromInt32(DB_UnresetViews) == libc.Int32FromInt32(DB_UnresetViews)) { + if !(libc.Int32FromUint16((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(idx)*16))).FpSchema)).FschemaFlags)&libc.Int32FromInt32(DB_UnresetViews) == libc.Int32FromInt32(DB_UnresetViews)) { return } i = (*THash)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(idx)*16))).FpSchema + 8)).Ffirst @@ -102458,7 +97923,7 @@ func _sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { break } pTab = (*THashElem)(unsafe.Pointer(i)).Fdata - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { _sqlite3DeleteColumnNames(tls, db, pTab) } goto _1 @@ -102492,7 +97957,6 @@ func _sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { func _sqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom TPgno, iTo TPgno) { var pDb, pElem, pHash, pIdx, pTab uintptr _, _, _, _, _ = pDb, pElem, pHash, pIdx, pTab - _ = libc.Int32FromInt32(0) pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 pHash = (*TDb)(unsafe.Pointer(pDb)).FpSchema + 8 pElem = (*THash)(unsafe.Pointer(pHash)).Ffirst @@ -102602,7 +98066,6 @@ func _destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { break } iIdx = (*TIndex)(unsafe.Pointer(pIdx)).Ftnum - _ = libc.Int32FromInt32(0) if (iDestroyed == uint32(0) || iIdx < iDestroyed) && iIdx > iLargest { iLargest = iIdx } @@ -102615,8 +98078,7 @@ func _destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { return } else { iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _ = libc.Int32FromInt32(0) - _destroyRootPage(tls, pParse, int32(iLargest), iDb) + _destroyRootPage(tls, pParse, libc.Int32FromUint32(iLargest), iDb) iDestroyed = iLargest } } @@ -102665,9 +98127,8 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 v = _sqlite3GetVdbe(tls, pParse) - _ = libc.Int32FromInt32(0) _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { _sqlite3VdbeAddOp0(tls, v, int32(OP_VBegin)) } /* Drop all triggers associated with the table being dropped. Code @@ -102676,7 +98137,6 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 */ pTrigger = _sqlite3TriggerList(tls, pParse, pTab) for pTrigger != 0 { - _ = libc.Int32FromInt32(0) _sqlite3DropTriggerPtr(tls, pParse, pTrigger) pTrigger = (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext } @@ -102696,13 +98156,13 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** database. */ _sqlite3NestedParse(tls, pParse, __ccgo_ts+13879, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) - if !(isView != 0) && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } /* Remove the table entry from SQLite's internal schema and modify ** the schema cookie. */ - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { _sqlite3VdbeAddOp4(tls, v, int32(OP_VDestroy), iDb, 0, 0, (*TTable)(unsafe.Pointer(pTab)).FzName, 0) _sqlite3MayAbort(tls, pParse) } @@ -102764,16 +98224,13 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_drop_table } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _sqlite3ReadSchema(tls, pParse) != 0 { goto exit_drop_table } if noErr != 0 { (*Tsqlite3)(unsafe.Pointer(db)).FsuppressErr++ } - _ = libc.Int32FromInt32(0) - pTab = _sqlite3LocateTableItem(tls, pParse, uint32(isView), pName+8) + pTab = _sqlite3LocateTableItem(tls, pParse, libc.Uint32FromInt32(isView), pName+8) if noErr != 0 { (*Tsqlite3)(unsafe.Pointer(db)).FsuppressErr-- } @@ -102785,11 +98242,10 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _ = libc.Int32FromInt32(0) /* If pTab is a virtual table, call ViewGetColumnNames() to ensure ** it is initialized. */ - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) && _sqlite3ViewGetColumnNames(tls, pParse, pTab) != 0 { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) && _sqlite3ViewGetColumnNames(tls, pParse, pTab) != 0 { goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { @@ -102810,7 +98266,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 code = int32(SQLITE_DROP_VIEW) } } else { - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { code = int32(SQLITE_DROP_VTABLE) zArg2 = (*TModule)(unsafe.Pointer((*TVTable)(unsafe.Pointer(_sqlite3GetVTable(tls, db, pTab))).FpMod)).FzName } else { @@ -102834,11 +98290,11 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ - if isView != 0 && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { + if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13974, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } - if !(isView != 0) && int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14008, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } @@ -102888,8 +98344,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p db = (*TParse)(unsafe.Pointer(pParse)).Fdb pFKey = uintptr(0) p = (*TParse)(unsafe.Pointer(pParse)).FpNewTable - _ = libc.Int32FromInt32(0) - if p == uintptr(0) || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { + if p == uintptr(0) || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { goto fk_end } if pFromCol == uintptr(0) { @@ -102910,7 +98365,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = int64(uint32(44) + uint32(nCol-libc.Int32FromInt32(1))*uint32(8) + (*TToken)(unsafe.Pointer(pTo)).Fn + uint32(1)) + nByte = libc.Int64FromUint32(uint32(44) + libc.Uint32FromInt32(nCol-libc.Int32FromInt32(1))*uint32(8) + (*TToken)(unsafe.Pointer(pTo)).Fn + uint32(1)) if pToCol != 0 { i = 0 for { @@ -102924,12 +98379,11 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p i++ } } - pFKey = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + pFKey = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pFKey == uintptr(0) { goto fk_end } (*TFKey)(unsafe.Pointer(pFKey)).FpFrom = p - _ = libc.Int32FromInt32(0) (*TFKey)(unsafe.Pointer(pFKey)).FpNextFrom = (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -102937,7 +98391,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p })(unsafe.Pointer(p + 44))).FpFKey z = pFKey + 36 + uintptr(nCol)*8 (*TFKey)(unsafe.Pointer(pFKey)).FzTo = z - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenMap(tls, pParse, z, pTo) } libc.Xmemcpy(tls, z, (*TToken)(unsafe.Pointer(pTo)).Fz, (*TToken)(unsafe.Pointer(pTo)).Fn) @@ -102971,7 +98425,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14197, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*20))).FzEName)) goto fk_end } - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenRemap(tls, pParse, pFKey+36+uintptr(i)*8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*20))).FzEName) } goto _2 @@ -102988,10 +98442,10 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p } n = _sqlite3Strlen30(tls, (*(*TExprList_item)(unsafe.Pointer(pToCol + 8 + uintptr(i)*20))).FzEName) (*(*TsColMap)(unsafe.Pointer(pFKey + 36 + uintptr(i)*8))).FzCol = z - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenRemap(tls, pParse, z, (*(*TExprList_item)(unsafe.Pointer(pToCol + 8 + uintptr(i)*20))).FzEName) } - libc.Xmemcpy(tls, z, (*(*TExprList_item)(unsafe.Pointer(pToCol + 8 + uintptr(i)*20))).FzEName, uint32(n)) + libc.Xmemcpy(tls, z, (*(*TExprList_item)(unsafe.Pointer(pToCol + 8 + uintptr(i)*20))).FzEName, libc.Uint32FromInt32(n)) *(*int8)(unsafe.Pointer(z + uintptr(n))) = 0 z += uintptr(n + int32(1)) goto _4 @@ -103001,22 +98455,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p } } (*TFKey)(unsafe.Pointer(pFKey)).FisDeferred = uint8(0) - *(*Tu8)(unsafe.Pointer(pFKey + 25)) = uint8(flags & libc.Int32FromInt32(0xff)) /* ON DELETE action */ - *(*Tu8)(unsafe.Pointer(pFKey + 25 + 1)) = uint8(flags >> libc.Int32FromInt32(8) & libc.Int32FromInt32(0xff)) /* ON UPDATE action */ - _ = libc.Int32FromInt32(0) + *(*Tu8)(unsafe.Pointer(pFKey + 25)) = libc.Uint8FromInt32(flags & libc.Int32FromInt32(0xff)) /* ON DELETE action */ + *(*Tu8)(unsafe.Pointer(pFKey + 25 + 1)) = libc.Uint8FromInt32(flags >> libc.Int32FromInt32(8) & libc.Int32FromInt32(0xff)) /* ON UPDATE action */ pNextTo = _sqlite3HashInsert(tls, (*TTable)(unsafe.Pointer(p)).FpSchema+56, (*TFKey)(unsafe.Pointer(pFKey)).FzTo, pFKey) if pNextTo == pFKey { _sqlite3OomFault(tls, db) goto fk_end } if pNextTo != 0 { - _ = libc.Int32FromInt32(0) (*TFKey)(unsafe.Pointer(pFKey)).FpNextTo = pNextTo (*TFKey)(unsafe.Pointer(pNextTo)).FpPrevTo = pFKey } /* Link the foreign key to the table as the last step. */ - _ = libc.Int32FromInt32(0) (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -103048,7 +98499,7 @@ func _sqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { if v1 == uintptr(0) { return } - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { return } v2 = (*(*struct { @@ -103060,8 +98511,8 @@ func _sqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { if v2 == uintptr(0) { return } - _ = libc.Int32FromInt32(0) /* EV: R-30323-21917 */ - (*TFKey)(unsafe.Pointer(pFKey)).FisDeferred = uint8(isDeferred) + /* EV: R-30323-21917 */ + (*TFKey)(unsafe.Pointer(pFKey)).FisDeferred = libc.Uint8FromInt32(isDeferred) } // C documentation @@ -103106,18 +98557,17 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP return } if memRootPage >= 0 { - tnum = uint32(memRootPage) + tnum = libc.Uint32FromInt32(memRootPage) } else { tnum = (*TIndex)(unsafe.Pointer(pIndex)).Ftnum } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) - _ = libc.Int32FromInt32(0) /* Open the sorter cursor if we are to use one. */ v6 = pParse + 40 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 - _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), iSorter, 0, int32((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol), _sqlite3KeyInfoRef(tls, pKey), -int32(8)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), iSorter, 0, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol), _sqlite3KeyInfoRef(tls, pKey), -int32(8)) /* Open the table. Loop through all rows of the table, inserting index ** records into the sorter. */ _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) @@ -103130,20 +98580,20 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iTab, addr1+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr1) if memRootPage < 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), int32(tnum), iDb) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(tnum), iDb) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenWrite), iIdx, int32(tnum), iDb, pKey, -int32(8)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenWrite), iIdx, libc.Int32FromUint32(tnum), iDb, pKey, -int32(8)) if memRootPage >= 0 { v7 = int32(OPFLAG_P2ISREG) } else { v7 = 0 } - _sqlite3VdbeChangeP5(tls, v, uint16(int32(OPFLAG_BULKCSR)|v7)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(int32(OPFLAG_BULKCSR)|v7)) addr1 = _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), iSorter, 0) - if int32((*TIndex)(unsafe.Pointer(pIndex)).FonError) != OE_None { + if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) != OE_None { j2 = _sqlite3VdbeGoto(tls, v, int32(1)) addr2 = _sqlite3VdbeCurrentAddr(tls, v) - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_SorterCompare), iSorter, j2, regRecord, int32((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_SorterCompare), iSorter, j2, regRecord, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol)) _sqlite3UniqueConstraint(tls, pParse, int32(OE_Abort), pIndex) _sqlite3VdbeJumpHere(tls, v, j2) } else { @@ -103190,20 +98640,20 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { var nByte int32 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = int32((libc.Uint32FromInt64(100)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7)) + (uint32(4)*uint32(nCol)+uint32(7))&uint32(^libc.Int32FromInt32(7)) + (uint32(2)*uint32(int32(nCol)+libc.Int32FromInt32(1))+uint32(2)*uint32(nCol)+uint32(1)*uint32(nCol)+uint32(7))&uint32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, uint64(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int32FromUint32((libc.Uint32FromInt64(100)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(4)*libc.Uint32FromInt16(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(2)*libc.Uint32FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint32(2)*libc.Uint32FromInt16(nCol)+uint32(1)*libc.Uint32FromInt16(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) if p != 0 { - pExtra = p + uintptr((libc.Uint32FromInt64(100)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) + pExtra = p + uintptr((libc.Uint32FromInt64(100)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint32FromInt64(4)*uint32(nCol) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint32FromInt64(4)*libc.Uint32FromInt16(nCol) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint32(2) * uint32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint32(2) * libc.Uint32FromInt32(int32(nCol)+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint32(2) * uint32(nCol)) + pExtra += uintptr(uint32(2) * libc.Uint32FromInt16(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = uint16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = uint16(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -103231,7 +98681,7 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i } if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*20 + 8 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).Ffg.FsortFlags - if int32(sf) == 0 || int32(sf) == int32(3) { + if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { v2 = __ccgo_ts + 14243 } else { v2 = __ccgo_ts + 14249 @@ -103280,12 +98730,10 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u nExtra = 0 /* Number of extra columns needed */ *(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0) /* Extra space after the Index object */ pPk = uintptr(0) /* PRIMARY KEY index for WITHOUT ROWID tables */ - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } - _ = libc.Int32FromInt32(0) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) && int32(idxType) != int32(SQLITE_IDXTYPE_PRIMARYKEY) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) && libc.Int32FromUint8(idxType) != int32(SQLITE_IDXTYPE_PRIMARYKEY) { goto exit_create_index } if SQLITE_OK != _sqlite3ReadSchema(tls, pParse) { @@ -103302,12 +98750,10 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** to search for the table. 'Fix' the table name to this db ** before looking up the table. */ - _ = libc.Int32FromInt32(0) iDb = _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+52) if iDb < 0 { goto exit_create_index } - _ = libc.Int32FromInt32(0) /* If the index name was unqualified, check if the table ** is a temp table. If so, set the database to 1. Do not do this ** if initializing a database schema. @@ -103322,10 +98768,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ - _ = libc.Int32FromInt32(0) } pTab = _sqlite3LocateTableItem(tls, pParse, uint32(0), pTblName+8) - _ = libc.Int32FromInt32(0) if pTab == uintptr(0) { goto exit_create_index } @@ -103337,8 +98781,6 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pPk = _sqlite3PrimaryKeyIndex(tls, pTab) } } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable if !(pTab != 0) { goto exit_create_index @@ -103346,16 +98788,15 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 - _ = libc.Int32FromInt32(0) - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6589, int32(7)) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6589, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14338, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14366, 0) goto exit_create_index } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14391, 0) goto exit_create_index } @@ -103377,11 +98818,10 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - _ = libc.Int32FromInt32(0) if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14282, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } - if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14425, libc.VaList(bp+80, zName)) @@ -103392,7 +98832,6 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(ifNotExist != 0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14459, libc.VaList(bp+80, zName)) } else { - _ = libc.Int32FromInt32(0) _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) } @@ -103421,13 +98860,13 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** The following statement converts "sqlite3_autoindex..." into ** "sqlite3_butoindex..." in order to make the names distinct. ** The "vtab_err.test" test demonstrates the need of this statement. */ - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { *(*int8)(unsafe.Pointer(zName + 7))++ } } /* Check for authorization to create an index. */ - if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { v2 = __ccgo_ts + 6597 @@ -103458,7 +98897,6 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pList == uintptr(0) { goto exit_create_index } - _ = libc.Int32FromInt32(0) _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14282) @@ -103475,9 +98913,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u break } pExpr = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLLATE) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLLATE) { nExtra += int32(1) + _sqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8))) } goto _4 @@ -103490,36 +98926,32 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u */ nName = _sqlite3Strlen30(tls, zName) if pPk != 0 { - v5 = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) + v5 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } else { v5 = int32(1) } nExtraCol = v5 - _ = libc.Int32FromInt32(0) pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+56) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TIndex)(unsafe.Pointer(pIndex)).FzName = *(*uintptr)(unsafe.Pointer(bp + 56)) *(*uintptr)(unsafe.Pointer(bp + 56)) += uintptr(nName + int32(1)) - libc.Xmemcpy(tls, (*TIndex)(unsafe.Pointer(pIndex)).FzName, zName, uint32(nName+int32(1))) + libc.Xmemcpy(tls, (*TIndex)(unsafe.Pointer(pIndex)).FzName, zName, libc.Uint32FromInt32(nName+int32(1))) (*TIndex)(unsafe.Pointer(pIndex)).FpTable = pTab - (*TIndex)(unsafe.Pointer(pIndex)).FonError = uint8(onError) + (*TIndex)(unsafe.Pointer(pIndex)).FonError = libc.Uint8FromInt32(onError) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.BoolUint32(onError != libc.Int32FromInt32(OE_None)), 3, 0x8) libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(idxType), 0, 0x3) (*TIndex)(unsafe.Pointer(pIndex)).FpSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema - (*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol = uint16((*TExprList)(unsafe.Pointer(pList)).FnExpr) + (*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol = libc.Uint16FromInt32((*TExprList)(unsafe.Pointer(pList)).FnExpr) if pPIWhere != 0 { _sqlite3ResolveSelfReference(tls, pParse, pTab, int32(NC_PartIdx), pPIWhere, uintptr(0)) (*TIndex)(unsafe.Pointer(pIndex)).FpPartIdxWhere = pPIWhere pPIWhere = uintptr(0) } - _ = libc.Int32FromInt32(0) /* Check to see if we should honor DESC requests on index columns */ - if int32((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) >= int32(4) { + if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) >= int32(4) { sortOrderMask = -int32(1) /* Honor DESC */ } else { sortOrderMask = 0 /* Ignore DESC */ @@ -103534,13 +98966,13 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** index key. */ pListItem = pList + 8 - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr = pList pList = uintptr(0) } i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol)) { break } /* Collation sequence name */ _sqlite3StringToId(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) @@ -103549,7 +98981,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) - if int32((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14506, 0) goto exit_create_index @@ -103564,14 +98996,13 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 12, 0x1000) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) - _ = libc.Int32FromInt32(0) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12 + 4))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 11, 0x800) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 12, 0x1000) } @@ -103579,12 +99010,10 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) } zColl = uintptr(0) - if int32((*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr)).Fop) == int32(TK_COLLATE) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr)).Fop) == int32(TK_COLLATE) { zColl = *(*uintptr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr + 8)) nColl = _sqlite3Strlen30(tls, zColl) + int32(1) - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 56)), zColl, uint32(nColl)) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 56)), zColl, libc.Uint32FromInt32(nColl)) zColl = *(*uintptr)(unsafe.Pointer(bp + 56)) *(*uintptr)(unsafe.Pointer(bp + 56)) += uintptr(nColl) nExtra -= nColl @@ -103600,8 +99029,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*4)) = zColl - requestedSortOrder = int32((*TExprList_item)(unsafe.Pointer(pListItem)).Ffg.FsortFlags) & sortOrderMask - *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(i))) = uint8(requestedSortOrder) + requestedSortOrder = libc.Int32FromUint8((*TExprList_item)(unsafe.Pointer(pListItem)).Ffg.FsortFlags) & sortOrderMask + *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(i))) = libc.Uint8FromInt32(requestedSortOrder) goto _6 _6: ; @@ -103615,12 +99044,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pPk != 0 { j = 0 for { - if !(j < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { + if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } x = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2))) - _ = libc.Int32FromInt32(0) - if _isDupColumn(tls, pIndex, int32((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol), pPk, j) != 0 { + if _isDupColumn(tls, pIndex, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol), pPk, j) != 0 { (*TIndex)(unsafe.Pointer(pIndex)).FnColumn-- } else { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(x) @@ -103633,7 +99061,6 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ; j++ } - _ = libc.Int32FromInt32(0) } else { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*4)) = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) @@ -103644,9 +99071,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* If this index contains every column of its table, then mark ** it as a covering index */ - _ = libc.Int32FromInt32(0) _recomputeColumnsNotIndexed(tls, pIndex) - if pTblName != uintptr(0) && int32((*TIndex)(unsafe.Pointer(pIndex)).FnColumn) >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if pTblName != uintptr(0) && libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnColumn) >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 5, 0x20) j = 0 for { @@ -103673,18 +99099,14 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(pIdx != 0) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) != int32((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol) { + if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) != libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol) { goto _9 } k = 0 for { - if !(k < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + if !(k < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } - _ = libc.Int32FromInt32(0) if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(k)*2))) != int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(k)*2))) { break } @@ -103698,8 +99120,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ; k++ } - if k == int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { - if int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) != int32((*TIndex)(unsafe.Pointer(pIndex)).FonError) { + if k == libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { + if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) != libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) { /* This constraint creates the same index as a previous ** constraint specified somewhere in the CREATE TABLE statement. ** However the ON CONFLICT clauses are different. If both this @@ -103707,17 +99129,17 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** ON CONFLICT clauses this is an error. Otherwise, use the ** explicitly specified behavior for the index. */ - if !(int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || int32((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { + if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14567, libc.VaList(bp+80, 0)) } - if int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { + if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError } } - if int32(idxType) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { + if libc.Int32FromUint8(idxType) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { libc.SetBitFieldPtr16Uint32(pIdx+56, uint32(idxType), 0, 0x3) } - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*TIndex)(unsafe.Pointer(pIndex)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpNewIndex (*TParse)(unsafe.Pointer(pParse)).FpNewIndex = pIndex pIndex = uintptr(0) @@ -103730,25 +99152,22 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } } - if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { /* Link the new Index structure to its table and to the other ** in-memory database structures. */ - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14609, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(125741)) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(125747)) goto exit_create_index } } p = _sqlite3HashInsert(tls, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema+24, (*TIndex)(unsafe.Pointer(pIndex)).FzName, pIndex) if p != 0 { - _ = libc.Int32FromInt32(0) /* Malloc must have failed */ + /* Malloc must have failed */ _sqlite3OomFault(tls, db) goto exit_create_index } @@ -103770,14 +99189,13 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** PRIMARY KEY and the table is actually a WITHOUT ROWID table. In ** that case the convertToWithoutRowidTable() routine will replace ** the Noop with a Goto to jump over the VDBE code generated below. */ - (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = uint32(_sqlite3VdbeAddOp0(tls, v, int32(OP_Noop))) + (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = libc.Uint32FromInt32(_sqlite3VdbeAddOp0(tls, v, int32(OP_Noop))) _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, iMem, int32(BTREE_BLOBKEY)) /* Gather the complete text of the CREATE INDEX statement into ** the zStmt variable */ - _ = libc.Int32FromInt32(0) if pStart != 0 { - n1 = int32(uint32(int32((*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fz)-int32((*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) + (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fn) + n1 = libc.Int32FromUint32(libc.Uint32FromInt32(int32((*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fz)-int32((*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) + (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fn) if int32(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz + uintptr(n1-int32(1))))) == int32(';') { n1-- } @@ -103806,7 +99224,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14713, libc.VaList(bp+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } - _sqlite3VdbeJumpHere(tls, v, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) + _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) } } } @@ -103815,8 +99233,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u (*TTable)(unsafe.Pointer(pTab)).FpIndex = pIndex pIndex = uintptr(0) } else { - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*TParse)(unsafe.Pointer(pParse)).FpNewIndex = pIndex pIndex = uintptr(0) } @@ -103836,13 +99253,13 @@ exit_create_index: if !(v15 != uintptr(0)) { break } - if int32((*TIndex)(unsafe.Pointer(pThis)).FonError) != int32(OE_Replace) { + if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pThis)).FonError) != int32(OE_Replace) { goto _14 } for { v16 = (*TIndex)(unsafe.Pointer(pThis)).FpNext pNext = v16 - if !(v16 != uintptr(0) && int32((*TIndex)(unsafe.Pointer(pNext)).FonError) != int32(OE_Replace)) { + if !(v16 != uintptr(0) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pNext)).FonError) != int32(OE_Replace)) { break } *(*uintptr)(unsafe.Pointer(ppFrom)) = pNext @@ -103889,14 +99306,13 @@ func _sqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { var x, v2 TLogEst _, _, _, _, _, _ = a, i, nCopy, x, v1, v2 a = (*TIndex)(unsafe.Pointer(pIdx)).FaiRowLogEst - if int32(libc.Uint32FromInt64(10)/libc.Uint32FromInt64(2)) < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { - v1 = int32(libc.Uint32FromInt64(10) / libc.Uint32FromInt64(2)) + if libc.Int32FromUint32(libc.Uint32FromInt64(10)/libc.Uint32FromInt64(2)) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { + v1 = libc.Int32FromUint32(libc.Uint32FromInt64(10) / libc.Uint32FromInt64(2)) } else { - v1 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + v1 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) } nCopy = v1 /* Indexes with default row estimates should not have stat1 data */ - _ = libc.Int32FromInt32(0) /* Set the first entry (number of rows in the index) to the estimated ** number of rows in the table, or half the number of rows in the table ** for a partial index. @@ -103908,7 +99324,6 @@ func _sqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { ** stat1 data to be ignored by the query planner. */ x = (*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FnRowLogEst - _ = libc.Int32FromInt32(0) if int32(x) < int32(99) { v2 = libc.Int16FromInt32(99) x = v2 @@ -103916,26 +99331,23 @@ func _sqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { } if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) { x = TLogEst(int32(x) - libc.Int32FromInt32(10)) - _ = libc.Int32FromInt32(0) } *(*TLogEst)(unsafe.Pointer(a)) = x /* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is ** 6 and each subsequent value (if any) is 5. */ - libc.Xmemcpy(tls, a+1*2, uintptr(unsafe.Pointer(&_aVal)), uint32(nCopy)*uint32(2)) + libc.Xmemcpy(tls, a+1*2, uintptr(unsafe.Pointer(&_aVal)), libc.Uint32FromInt32(nCopy)*uint32(2)) i = nCopy + int32(1) for { - if !(i <= int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + if !(i <= libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } *(*TLogEst)(unsafe.Pointer(a + uintptr(i)*2)) = int16(23) - _ = libc.Int32FromInt32(0) goto _3 _3: ; i++ } - _ = libc.Int32FromInt32(0) - if int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) != OE_None { + if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) != OE_None { *(*TLogEst)(unsafe.Pointer(a + uintptr((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)*2)) = 0 } } @@ -103965,8 +99377,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_drop_index } - _ = libc.Int32FromInt32(0) /* Never called with prior non-OOM errors */ - _ = libc.Int32FromInt32(0) + /* Never called with prior non-OOM errors */ if SQLITE_OK != _sqlite3ReadSchema(tls, pParse) { goto exit_drop_index } @@ -104011,7 +99422,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _sqlite3NestedParse(tls, pParse, __ccgo_ts+14831, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11918, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) - _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) + _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } goto exit_drop_index @@ -104055,7 +99466,7 @@ func _sqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry in v2 = int64(2) * n } sz = v2 - pNew = _sqlite3DbRealloc(tls, db, pArray, uint64(sz*int64(szEntry))) + pNew = _sqlite3DbRealloc(tls, db, pArray, libc.Uint64FromInt64(sz*int64(szEntry))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(pIdx)) = -int32(1) return pArray @@ -104063,7 +99474,7 @@ func _sqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry in pArray = pNew } z = pArray - libc.Xmemset(tls, z+uintptr(n*int64(szEntry)), 0, uint32(szEntry)) + libc.Xmemset(tls, z+uintptr(n*int64(szEntry)), 0, libc.Uint32FromInt32(szEntry)) *(*int32)(unsafe.Pointer(pnEntry))++ return pArray } @@ -104087,7 +99498,7 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(16)+uint32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint32(8))) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(16)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint32(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -104099,7 +99510,7 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u *(*int32)(unsafe.Pointer(v2))++ i = v1 (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*8))).FzName = _sqlite3NameFromToken(tls, db, pToken) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*8))).FzName != 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*8))).FzName != 0 { _sqlite3RenameTokenMap(tls, pParse, (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*8))).FzName, pToken) } return pList @@ -104113,11 +99524,10 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { var i int32 _ = i - _ = libc.Int32FromInt32(0) if pList == uintptr(0) { return } - _ = libc.Int32FromInt32(0) /* EU4_EXPR mode is not currently used */ + /* EU4_EXPR mode is not currently used */ i = 0 for { if !(i < (*TIdList)(unsafe.Pointer(pList)).FnId) { @@ -104141,7 +99551,6 @@ func _sqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { func _sqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) (r int32) { var i int32 _ = i - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TIdList)(unsafe.Pointer(pList)).FnId) { @@ -104197,12 +99606,8 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra var nAlloc Tsqlite3_int64 _, _, _, _ = db, i, nAlloc, pNew /* Sanity checking on calling parameters */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Allocate additional space if needed */ - if uint32((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc)+uint32(nExtra) > (*TSrcList)(unsafe.Pointer(pSrc)).FnAlloc { + if libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc)+libc.Uint32FromInt32(nExtra) > (*TSrcList)(unsafe.Pointer(pSrc)).FnAlloc { nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { @@ -104212,13 +99617,12 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(int64(76)+(nAlloc-int64(1))*int64(68))) + pNew = _sqlite3DbRealloc(tls, db, pSrc, libc.Uint64FromInt64(int64(76)+(nAlloc-int64(1))*int64(68))) if pNew == uintptr(0) { - _ = libc.Int32FromInt32(0) return uintptr(0) } pSrc = pNew - (*TSrcList)(unsafe.Pointer(pSrc)).FnAlloc = uint32(nAlloc) + (*TSrcList)(unsafe.Pointer(pSrc)).FnAlloc = libc.Uint32FromInt64(nAlloc) } /* Move existing slots that come after the newly inserted slots ** out of the way */ @@ -104235,7 +99639,7 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra } *(*int32)(unsafe.Pointer(pSrc)) += nExtra /* Zero the newly allocated slots */ - libc.Xmemset(tls, pSrc+8+uintptr(iStart)*68, 0, uint32(68)*uint32(nExtra)) + libc.Xmemset(tls, pSrc+8+uintptr(iStart)*68, 0, uint32(68)*libc.Uint32FromInt32(nExtra)) i = iStart for { if !(i < iStart+nExtra) { @@ -104291,9 +99695,7 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) (r uintptr) { var db, pItem, pNew uintptr _, _, _ = db, pItem, pNew - _ = libc.Int32FromInt32(0) /* Cannot have C without B */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(76)) @@ -104336,7 +99738,6 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) var i, v2 int32 var pItem, v3 uintptr _, _, _, _ = i, pItem, v2, v3 - _ = libc.Int32FromInt32(0) if pList != 0 { i = 0 pItem = pList + 8 @@ -104372,7 +99773,6 @@ func _sqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { var i int32 var pItem uintptr _, _ = i, pItem - _ = libc.Int32FromInt32(0) if pList == uintptr(0) { return } @@ -104454,11 +99854,8 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa if p == uintptr(0) { goto append_from_error } - _ = libc.Int32FromInt32(0) pItem = p + 8 + uintptr((*TSrcList)(unsafe.Pointer(p)).FnSrc-int32(1))*68 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if pDatabase != 0 && (*TToken)(unsafe.Pointer(pDatabase)).Fz != 0 { v2 = pDatabase } else { @@ -104467,7 +99864,6 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa pToken = v2 _sqlite3RenameTokenMap(tls, pParse, (*TSrcItem)(unsafe.Pointer(pItem)).FzName, pToken) } - _ = libc.Int32FromInt32(0) if (*TToken)(unsafe.Pointer(pAlias)).Fn != 0 { (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias = _sqlite3NameFromToken(tls, db, pAlias) } @@ -104477,8 +99873,6 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa libc.SetBitFieldPtr16Uint32(pItem+36+4, libc.Uint32FromInt32(1), 13, 0x2000) } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pOnUsing == uintptr(0) { *(*uintptr)(unsafe.Pointer(pItem + 48)) = uintptr(0) } else { @@ -104493,7 +99887,6 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa goto append_from_error append_from_error: ; - _ = libc.Int32FromInt32(0) _sqlite3ClearOnOrUsing(tls, db, pOnUsing) _sqlite3SelectDelete(tls, db, pSubquery) return uintptr(0) @@ -104508,13 +99901,8 @@ append_from_error: func _sqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) { var pItem uintptr _ = pItem - _ = libc.Int32FromInt32(0) if p != 0 && (*TToken)(unsafe.Pointer(pIndexedBy)).Fn > uint32(0) { - _ = libc.Int32FromInt32(0) pItem = p + 8 + uintptr((*TSrcList)(unsafe.Pointer(p)).FnSrc-int32(1))*68 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TToken)(unsafe.Pointer(pIndexedBy)).Fn == uint32(1) && !((*TToken)(unsafe.Pointer(pIndexedBy)).Fz != 0) { /* A "NOT INDEXED" clause was supplied. See parse.y ** construct "indexed_opt" for details. */ @@ -104522,7 +99910,7 @@ func _sqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexed } else { *(*uintptr)(unsafe.Pointer(pItem + 60)) = _sqlite3NameFromToken(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIndexedBy) libc.SetBitFieldPtr16Uint32(pItem+36+4, libc.Uint32FromInt32(1), 1, 0x2) - _ = libc.Int32FromInt32(0) /* No collision on union u2 */ + /* No collision on union u2 */ } } } @@ -104537,17 +99925,16 @@ func _sqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexed func _sqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) (r uintptr) { var pNew, p11 uintptr _, _ = pNew, p11 - _ = libc.Int32FromInt32(0) if p2 != 0 { pNew = _sqlite3SrcListEnlarge(tls, pParse, p1, (*TSrcList)(unsafe.Pointer(p2)).FnSrc, int32(1)) if pNew == uintptr(0) { _sqlite3SrcListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, p2) } else { p1 = pNew - libc.Xmemcpy(tls, p1+8+1*68, p2+8, uint32((*TSrcList)(unsafe.Pointer(p2)).FnSrc)*uint32(68)) + libc.Xmemcpy(tls, p1+8+1*68, p2+8, libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p2)).FnSrc)*uint32(68)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, p2) p11 = p1 + 8 + 36 - *(*Tu8)(unsafe.Pointer(p11)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p11))) | libc.Int32FromInt32(JT_LTORJ)&int32((*(*TSrcItem)(unsafe.Pointer(p1 + 8 + 1*68))).Ffg.Fjointype)) + *(*Tu8)(unsafe.Pointer(p11)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p11))) | libc.Int32FromInt32(JT_LTORJ)&libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(p1 + 8 + 1*68))).Ffg.Fjointype)) } } return p1 @@ -104564,9 +99951,6 @@ func _sqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uin _ = pItem if p != 0 { pItem = p + 8 + uintptr((*TSrcList)(unsafe.Pointer(p)).FnSrc-int32(1))*68 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pItem + 60)) = pList libc.SetBitFieldPtr16Uint32(pItem+36+4, libc.Uint32FromInt32(1), 2, 0x4) } else { @@ -104610,7 +99994,7 @@ func _sqlite3SrcListShiftJoinType(tls *libc.TLS, pParse uintptr, p uintptr) { for { v3 = (*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i-int32(1))*68))).Ffg.Fjointype (*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i)*68))).Ffg.Fjointype = v3 - allFlags = Tu8(int32(allFlags) | int32(v3)) + allFlags = Tu8(int32(allFlags) | libc.Int32FromUint8(v3)) goto _2 _2: ; @@ -104623,10 +100007,10 @@ func _sqlite3SrcListShiftJoinType(tls *libc.TLS, pParse uintptr, p uintptr) { (*(*TSrcItem)(unsafe.Pointer(p + 8))).Ffg.Fjointype = uint8(0) /* All terms to the left of a RIGHT JOIN should be tagged with the ** JT_LTORJ flags */ - if int32(allFlags)&int32(JT_RIGHT) != 0 { + if libc.Int32FromUint8(allFlags)&int32(JT_RIGHT) != 0 { i = (*TSrcList)(unsafe.Pointer(p)).FnSrc - int32(1) for { - if !(i > 0 && int32((*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i)*68))).Ffg.Fjointype)&int32(JT_RIGHT) == 0) { + if !(i > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i)*68))).Ffg.Fjointype)&int32(JT_RIGHT) == 0) { break } goto _4 @@ -104635,7 +100019,6 @@ func _sqlite3SrcListShiftJoinType(tls *libc.TLS, pParse uintptr, p uintptr) { i-- } i-- - _ = libc.Int32FromInt32(0) for { p7 = p + 8 + uintptr(i)*68 + 36 *(*Tu8)(unsafe.Pointer(p7)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p7))) | libc.Int32FromInt32(JT_LTORJ)) @@ -104661,9 +100044,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var db, pBt, v uintptr var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v - _ = libc.Int32FromInt32(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+14972, uintptr(0), uintptr(0)) != 0 { return } @@ -104709,9 +100090,6 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { var isRollback int32 var v, v1 uintptr _, _, _ = isRollback, v, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { v1 = __ccgo_ts + 14978 @@ -104739,7 +100117,6 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { zName = _sqlite3NameFromToken(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pName) if zName != 0 { v = _sqlite3GetVdbe(tls, pParse) - _ = libc.Int32FromInt32(0) if !(v != 0) || _sqlite3AuthCheck(tls, pParse, int32(SQLITE_SAVEPOINT), _az[op], zName, uintptr(0)) != 0 { _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zName) return @@ -104776,7 +100153,6 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { return int32(1) } (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt = *(*uintptr)(unsafe.Pointer(bp)) - _ = libc.Int32FromInt32(0) if int32(SQLITE_NOMEM) == _sqlite3BtreeSetPageSize(tls, *(*uintptr)(unsafe.Pointer(bp)), (*Tsqlite3)(unsafe.Pointer(db)).FnextPagesize, 0, 0) { _sqlite3OomFault(tls, db) return int32(1) @@ -104796,10 +100172,6 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // ** later, by sqlite3FinishCoding(). // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<<iDb) != uint32(0)) == 0 { *(*TyDbMask)(unsafe.Pointer(pToplevel + 92)) |= libc.Uint32FromInt32(1) << iDb if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { @@ -104937,9 +100309,7 @@ func _sqlite3MayAbort(tls *libc.TLS, pParse uintptr) { func _sqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type Ti8, p5Errmsg Tu8) { var v uintptr _ = v - _ = libc.Int32FromInt32(0) v = _sqlite3GetVdbe(tls, pParse) - _ = libc.Int32FromInt32(0) if onError == int32(OE_Abort) { _sqlite3MayAbort(tls, pParse) } @@ -104966,10 +100336,9 @@ func _sqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx } else { j = 0 for { - if !(j < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } - _ = libc.Int32FromInt32(0) zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))*12))).FzCnName if j != 0 { Xsqlite3_str_append(tls, bp, __ccgo_ts+15083, int32(2)) @@ -105023,14 +100392,12 @@ func _collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) (r int32) { var i int32 var z uintptr _, _ = i, z - _ = libc.Int32FromInt32(0) i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIndex)).FnColumn)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnColumn)) { break } z = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*4)) - _ = libc.Int32FromInt32(0) if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2))) >= 0 && 0 == _sqlite3StrICmp(tls, z, zColl) { return int32(1) } @@ -105052,7 +100419,7 @@ func _reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { var iDb int32 var pIndex uintptr _, _ = iDb, pIndex - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { /* An index associated with pTab */ + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { /* An index associated with pTab */ pIndex = (*TTable)(unsafe.Pointer(pTab)).FpIndex for { if !(pIndex != 0) { @@ -105083,14 +100450,13 @@ func _reindexDatabases(tls *libc.TLS, pParse uintptr, zColl uintptr) { var iDb int32 _, _, _, _, _ = db, iDb, k, pDb, pTab /* The database index number */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* A table in the database */ - _ = libc.Int32FromInt32(0) /* Needed for schema access */ + /* Needed for schema access */ iDb = 0 pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb for { if !(iDb < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { break } - _ = libc.Int32FromInt32(0) k = (*THash)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema + 8)).Ffirst for { if !(k != 0) { @@ -105144,7 +100510,6 @@ func _sqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp return } else { if pName2 == uintptr(0) || (*TToken)(unsafe.Pointer(pName2)).Fz == uintptr(0) { - _ = libc.Int32FromInt32(0) zColl = _sqlite3NameFromToken(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pName1) if !(zColl != 0) { return @@ -105201,8 +100566,8 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint var i, nCol, nKey int32 var pKey, zColl, v2 uintptr _, _, _, _, _, _ = i, nCol, nKey, pKey, zColl, v2 - nCol = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) - nKey = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + nKey = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return uintptr(0) } @@ -105212,7 +100577,6 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint pKey = _sqlite3KeyInfoAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, nCol, 0) } if pKey != 0 { - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < nCol) { @@ -105226,14 +100590,12 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint } *(*uintptr)(unsafe.Pointer(pKey + 20 + uintptr(i)*4)) = v2 *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKey)).FaSortFlags + uintptr(i))) = *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i))) - _ = libc.Int32FromInt32(0) goto _1 _1: ; i++ } if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x200>>9)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the @@ -105262,7 +100624,6 @@ func _sqlite3CteNew(tls *libc.TLS, pParse uintptr, pName uintptr, pArglist uintp _, _ = db, pNew db = (*TParse)(unsafe.Pointer(pParse)).Fdb pNew = _sqlite3DbMallocZero(tls, db, uint64(24)) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3ExprListDelete(tls, db, pArglist) _sqlite3SelectDelete(tls, db, pQuery) @@ -105282,7 +100643,6 @@ func _sqlite3CteNew(tls *libc.TLS, pParse uintptr, pName uintptr, pArglist uintp // ** for the object itself. // */ func _cteClear(tls *libc.TLS, db uintptr, pCte uintptr) { - _ = libc.Int32FromInt32(0) _sqlite3ExprListDelete(tls, db, (*TCte)(unsafe.Pointer(pCte)).FpCols) _sqlite3SelectDelete(tls, db, (*TCte)(unsafe.Pointer(pCte)).FpSelect) _sqlite3DbFree(tls, db, (*TCte)(unsafe.Pointer(pCte)).FzName) @@ -105294,7 +100654,6 @@ func _cteClear(tls *libc.TLS, db uintptr, pCte uintptr) { // ** Free the contents of the CTE object passed as the second argument. // */ func _sqlite3CteDelete(tls *libc.TLS, db uintptr, pCte uintptr) { - _ = libc.Int32FromInt32(0) _cteClear(tls, db, pCte) _sqlite3DbFree(tls, db, pCte) } @@ -105337,12 +100696,11 @@ func _sqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr) } } if pWith != 0 { - nByte = int64(uint32(36) + uint32(24)*uint32((*TWith)(unsafe.Pointer(pWith)).FnCte)) - pNew = _sqlite3DbRealloc(tls, db, pWith, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(36) + uint32(24)*libc.Uint32FromInt32((*TWith)(unsafe.Pointer(pWith)).FnCte)) + pNew = _sqlite3DbRealloc(tls, db, pWith, libc.Uint64FromInt64(nByte)) } else { pNew = _sqlite3DbMallocZero(tls, db, uint64(36)) } - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3CteDelete(tls, db, pCte) pNew = pWith @@ -105413,7 +100771,6 @@ func _sqlite3WithDeleteGeneric(tls *libc.TLS, db uintptr, pWith uintptr) { func _callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { var pTmp, zExternal, zExternal1 uintptr _, _, _ = pTmp, zExternal, zExternal1 - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded != 0 { zExternal = _sqlite3DbStrDup(tls, db, zName) if !(zExternal != 0) { @@ -105427,7 +100784,7 @@ func _callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { _sqlite3ValueSetStr(tls, pTmp, -int32(1), zName, uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) zExternal1 = _sqlite3ValueText(tls, pTmp, uint8(SQLITE_UTF16LE)) if zExternal1 != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc), zExternal1) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc), zExternal1) } _sqlite3ValueFree(tls, pTmp) } @@ -105495,7 +100852,6 @@ func _sqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) (r int32 if !(p != 0) { return int32(SQLITE_ERROR) } - _ = libc.Int32FromInt32(0) } return SQLITE_OK } @@ -105522,7 +100878,7 @@ func _findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ( pColl = _sqlite3HashFind(tls, db+440, zName) if uintptr(0) == pColl && create != 0 { nName = _sqlite3Strlen30(tls, zName) + int32(1) - pColl = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt32(3)*libc.Uint32FromInt64(20)+uint32(nName))) + pColl = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt32(3)*libc.Uint32FromInt64(20)+libc.Uint32FromInt32(nName))) if pColl != 0 { pDel = uintptr(0) (*(*TCollSeq)(unsafe.Pointer(pColl))).FzName = pColl + 3*20 @@ -105531,13 +100887,12 @@ func _findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ( (*(*TCollSeq)(unsafe.Pointer(pColl + 1*20))).Fenc = uint8(SQLITE_UTF16LE) (*(*TCollSeq)(unsafe.Pointer(pColl + 2*20))).FzName = pColl + 3*20 (*(*TCollSeq)(unsafe.Pointer(pColl + 2*20))).Fenc = uint8(SQLITE_UTF16BE) - libc.Xmemcpy(tls, (*(*TCollSeq)(unsafe.Pointer(pColl))).FzName, zName, uint32(nName)) + libc.Xmemcpy(tls, (*(*TCollSeq)(unsafe.Pointer(pColl))).FzName, zName, libc.Uint32FromInt32(nName)) pDel = _sqlite3HashInsert(tls, db+440, (*(*TCollSeq)(unsafe.Pointer(pColl))).FzName, pColl) /* If a malloc() failure occurred in sqlite3HashInsert(), it will ** return the pColl pointer to be deleted (because it wasn't added ** to the hash table). */ - _ = libc.Int32FromInt32(0) if pDel != uintptr(0) { _sqlite3OomFault(tls, db) _sqlite3DbFree(tls, db, pDel) @@ -105568,12 +100923,10 @@ func _findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ( func _sqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc Tu8, zName uintptr, create int32) (r uintptr) { var pColl uintptr _ = pColl - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if zName != 0 { pColl = _findCollSeqEntry(tls, db, zName, create) if pColl != 0 { - pColl += uintptr(int32(enc)-int32(1)) * 20 + pColl += uintptr(libc.Int32FromUint8(enc)-int32(1)) * 20 } } else { pColl = (*Tsqlite3)(unsafe.Pointer(db)).FpDfltColl @@ -105588,7 +100941,6 @@ func _sqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc Tu8, zName uintptr, crea // ** the pDfltColl must change as well. // */ func _sqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc Tu8) { - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Fenc = enc /* EVIDENCE-OF: R-08308-17224 The default collating function for all ** strings is BINARY. @@ -105627,13 +100979,12 @@ func _sqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc Tu8, pColl uintptr, z /* No collation sequence of this type for this encoding is registered. ** Call the collation factory to see if it can supply us with one. */ - _callCollNeeded(tls, db, int32(enc), zName) + _callCollNeeded(tls, db, libc.Int32FromUint8(enc), zName) p = _sqlite3FindCollSeq(tls, db, enc, zName, 0) } if p != 0 && !((*TCollSeq)(unsafe.Pointer(p)).FxCmp != 0) && _synthCollSeq(tls, db, p) != 0 { p = uintptr(0) } - _ = libc.Int32FromInt32(0) if p == uintptr(0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15171, libc.VaList(bp+8, zName)) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) @@ -105670,7 +101021,7 @@ func _sqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) (r uint db = (*TParse)(unsafe.Pointer(pParse)).Fdb enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc initbusy = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy - pColl = _sqlite3FindCollSeq(tls, db, enc, zName, int32(initbusy)) + pColl = _sqlite3FindCollSeq(tls, db, enc, zName, libc.Int32FromUint8(initbusy)) if !(initbusy != 0) && (!(pColl != 0) || !((*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0)) { pColl = _sqlite3GetCollSeq(tls, pParse, enc, pColl, zName) } @@ -105710,7 +101061,6 @@ func _sqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) (r uint func _matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc Tu8) (r int32) { var match, v1 int32 _, _ = match, v1 - _ = libc.Int32FromInt32(0) /* Wrong number of arguments means "no match" */ if int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) != nArg { if nArg == -int32(2) { @@ -105757,7 +101107,6 @@ func _sqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) (r uintptr) { if !(p != 0) { break } - _ = libc.Int32FromInt32(0) if _sqlite3StrICmp(tls, (*TFuncDef)(unsafe.Pointer(p)).FzName, zFunc) == 0 { return p } @@ -105786,10 +101135,8 @@ func _sqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { zName = (*(*TFuncDef)(unsafe.Pointer(aDef + uintptr(i)*40))).FzName nName = _sqlite3Strlen30(tls, zName) h = (int32(*(*int8)(unsafe.Pointer(zName))) + nName) % int32(SQLITE_FUNC_HASH_SZ) - _ = libc.Int32FromInt32(0) pOther = _sqlite3FunctionSearch(tls, h, zName) if pOther != 0 { - _ = libc.Int32FromInt32(0) (*(*TFuncDef)(unsafe.Pointer(aDef + uintptr(i)*40))).FpNext = (*TFuncDef)(unsafe.Pointer(pOther)).FpNext (*TFuncDef)(unsafe.Pointer(pOther)).FpNext = aDef + uintptr(i)*40 } else { @@ -105832,8 +101179,6 @@ func _sqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, _, _, _, _, _, _, _, _, _, _, _ = bestScore, h, nName, p, pBest, pOther, score, score1, z, v1, v2 /* Iterator variable */ pBest = uintptr(0) /* Best match found so far */ bestScore = 0 /* Length of the name */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) nName = _sqlite3Strlen30(tls, zName) /* First search for a match amongst the application-defined functions. */ @@ -105860,7 +101205,7 @@ func _sqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, */ if !(createFlag != 0) && (pBest == uintptr(0) || (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_PreferBuiltin) != uint32(0)) { bestScore = 0 - h = (int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zName)))]) + nName) % int32(SQLITE_FUNC_HASH_SZ) + h = (libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zName)))]) + nName) % int32(SQLITE_FUNC_HASH_SZ) p = _sqlite3FunctionSearch(tls, h, zName) for p != 0 { score1 = _matchQuality(tls, p, nArg, enc) @@ -105876,14 +101221,14 @@ func _sqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, ** new entry to the hash table and return it. */ if v2 = createFlag != 0 && bestScore < int32(FUNC_PERFECT_MATCH); v2 { - v1 = _sqlite3DbMallocZero(tls, db, uint64(uint32(40)+uint32(nName)+uint32(1))) + v1 = _sqlite3DbMallocZero(tls, db, uint64(uint32(40)+libc.Uint32FromInt32(nName)+uint32(1))) pBest = v1 } if v2 && v1 != uintptr(0) { (*TFuncDef)(unsafe.Pointer(pBest)).FzName = pBest + 1*40 - (*TFuncDef)(unsafe.Pointer(pBest)).FnArg = int8(uint16(nArg)) + (*TFuncDef)(unsafe.Pointer(pBest)).FnArg = libc.Int8FromUint16(libc.Uint16FromInt32(nArg)) (*TFuncDef)(unsafe.Pointer(pBest)).FfuncFlags = uint32(enc) - libc.Xmemcpy(tls, pBest+1*40, zName, uint32(nName+int32(1))) + libc.Xmemcpy(tls, pBest+1*40, zName, libc.Uint32FromInt32(nName+int32(1))) z = (*TFuncDef)(unsafe.Pointer(pBest)).FzName for { if !(*(*Tu8)(unsafe.Pointer(z)) != 0) { @@ -105962,7 +101307,7 @@ func _sqlite3SchemaClear(tls *libc.TLS, p uintptr) { _sqlite3HashClear(tls, bp) _sqlite3HashClear(tls, pSchema+56) (*TSchema)(unsafe.Pointer(pSchema)).FpSeqTab = uintptr(0) - if int32((*TSchema)(unsafe.Pointer(pSchema)).FschemaFlags)&int32(DB_SchemaLoaded) != 0 { + if libc.Int32FromUint16((*TSchema)(unsafe.Pointer(pSchema)).FschemaFlags)&int32(DB_SchemaLoaded) != 0 { (*TSchema)(unsafe.Pointer(pSchema)).FiGeneration++ } p3 = pSchema + 78 @@ -105986,7 +101331,7 @@ func _sqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) (r uintptr) { if !(p != 0) { _sqlite3OomFault(tls, db) } else { - if 0 == int32((*TSchema)(unsafe.Pointer(p)).Ffile_format) { + if 0 == libc.Int32FromUint8((*TSchema)(unsafe.Pointer(p)).Ffile_format) { _sqlite3HashInit(tls, p+8) _sqlite3HashInit(tls, p+24) _sqlite3HashInit(tls, p+40) @@ -106035,7 +101380,6 @@ func _sqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) (r uintp var pItem, pTab uintptr _, _ = pItem, pTab pItem = pSrc + 8 - _ = libc.Int32FromInt32(0) pTab = _sqlite3LocateTableItem(tls, pParse, uint32(0), pItem) if (*TSrcItem)(unsafe.Pointer(pItem)).FpTab != 0 { _sqlite3DeleteTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pItem)).FpTab) @@ -106096,7 +101440,7 @@ func _vtabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { ** * Only allow DELETE, INSERT, or UPDATE of non-SQLITE_VTAB_INNOCUOUS ** virtual tables if PRAGMA trusted_schema=ON. */ - if (*TParse)(unsafe.Pointer(pParse)).FpToplevel != uintptr(0) && int32((*TVTable)(unsafe.Pointer((*(*struct { + if (*TParse)(unsafe.Pointer(pParse)).FpToplevel != uintptr(0) && libc.Int32FromUint8((*TVTable)(unsafe.Pointer((*(*struct { FnArg int32 FazArg uintptr Fp uintptr @@ -106109,17 +101453,16 @@ func _vtabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { var db uintptr _ = db - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { return _vtabIsReadOnly(tls, pParse, pTab) } - if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(libc.Int32FromInt32(TF_Readonly)|libc.Int32FromInt32(TF_Shadow)) == uint32(0) { + if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_Readonly)|libc.Int32FromInt32(TF_Shadow)) == uint32(0) { return 0 } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Readonly) != uint32(0) { - return libc.BoolInt32(_sqlite3WritableSchema(tls, db) == 0 && int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0) + return libc.BoolInt32(_sqlite3WritableSchema(tls, db) == 0 && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0) } - _ = libc.Int32FromInt32(0) return _sqlite3ReadOnlyShadowTables(tls, db) } @@ -106139,7 +101482,7 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15235, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } @@ -106165,11 +101508,8 @@ func _sqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher pWhere = _sqlite3ExprDup(tls, db, pWhere, 0) pFrom = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if pFrom != 0 { - _ = libc.Int32FromInt32(0) (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pView)).FzName) (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzDatabase = _sqlite3DbStrDup(tls, db, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } pSel = _sqlite3SelectNew(tls, pParse, uintptr(0), pFrom, pWhere, uintptr(0), uintptr(0), pOrderBy, uint32(SF_IncludeHidden), pLimit) _sqlite3SelectDestInit(tls, bp, int32(SRT_EphemTab), iCur) @@ -106214,12 +101554,9 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere addrEphOpen = 0 /* List of table triggers, if required */ libc.Xmemset(tls, bp+8, 0, uint32(8)) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto delete_from_cleanup } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Locate the table which we want to delete. This table has to be ** put in an SrcList structure because some of the subroutines we ** will be calling are designed to work with multiple tables and expect @@ -106233,7 +101570,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** deleted from is a view */ pTrigger = _sqlite3TriggersExist(tls, pParse, pTab, int32(TK_DELETE), uintptr(0), uintptr(0)) - isView = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW)) + isView = libc.BoolInt32(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW)) bComplex = libc.BoolInt32(pTrigger != 0 || _sqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0) /* If pTab is really a view, make sure it has been initialized. */ @@ -106244,16 +101581,12 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto delete_from_cleanup } iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _ = libc.Int32FromInt32(0) rcauth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), (*TTable)(unsafe.Pointer(pTab)).FzName, uintptr(0), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) - _ = libc.Int32FromInt32(0) if rcauth == int32(SQLITE_DENY) { goto delete_from_cleanup } - _ = libc.Int32FromInt32(0) /* Assign cursor numbers to the table and all its indices. */ - _ = libc.Int32FromInt32(0) v3 = pParse + 40 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ @@ -106284,7 +101617,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if v == uintptr(0) { goto delete_from_cleanup } - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 { _sqlite3VdbeCountChanges(tls, v) } _sqlite3BeginWriteOperation(tls, pParse, bComplex, iDb) @@ -106310,7 +101643,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere /* Initialize the counter of the number of rows deleted, if ** we are counting rows. */ - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { v7 = pParse + 44 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) @@ -106328,8 +101661,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** the truncate optimization is disabled and all rows are deleted ** individually. */ - if rcauth == SQLITE_OK && pWhere == uintptr(0) && !(bComplex != 0) && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback == uintptr(0) { - _ = libc.Int32FromInt32(0) + if rcauth == SQLITE_OK && pWhere == uintptr(0) && !(bComplex != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback == uintptr(0) { _sqlite3TableLock(tls, pParse, iDb, (*TTable)(unsafe.Pointer(pTab)).Ftnum, uint8(1), (*TTable)(unsafe.Pointer(pTab)).FzName) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { if memCnt != 0 { @@ -106337,23 +101669,22 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } else { v8 = -int32(1) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Clear), int32((*TTable)(unsafe.Pointer(pTab)).Ftnum), iDb, v8, (*TTable)(unsafe.Pointer(pTab)).FzName, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Clear), libc.Int32FromUint32((*TTable)(unsafe.Pointer(pTab)).Ftnum), iDb, v8, (*TTable)(unsafe.Pointer(pTab)).FzName, -int32(1)) } pIdx = (*TTable)(unsafe.Pointer(pTab)).FpIndex for { if !(pIdx != 0) { break } - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) && !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { if memCnt != 0 { v10 = memCnt } else { v10 = -int32(1) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Clear), int32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb, v10) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Clear), libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb, v10) } else { - _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), int32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) } goto _9 _9: @@ -106361,7 +101692,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } } else { - wcf = uint16(libc.Int32FromInt32(WHERE_ONEPASS_DESIRED) | libc.Int32FromInt32(WHERE_DUPLICATES_OK)) + wcf = libc.Uint16FromInt32(libc.Int32FromInt32(WHERE_ONEPASS_DESIRED) | libc.Int32FromInt32(WHERE_DUPLICATES_OK)) if (*(*TNameContext)(unsafe.Pointer(bp + 16))).FncFlags&int32(NC_Subquery) != 0 { bComplex = int32(1) } @@ -106374,7 +101705,6 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { /* For a rowid table, initialize the RowSet to an empty set */ pPk = uintptr(0) - _ = libc.Int32FromInt32(0) v13 = pParse + 44 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) @@ -106384,8 +101714,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere /* For a WITHOUT ROWID table, create an ephemeral table used to ** hold all primary keys for rows to be deleted. */ pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - _ = libc.Int32FromInt32(0) - nPk = int16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) + nPk = libc.Int16FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) *(*int32)(unsafe.Pointer(pParse + 44)) += int32(nPk) v15 = pParse + 40 @@ -106408,8 +101737,6 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto delete_from_cleanup } eOnePass = _sqlite3WhereOkOnePass(tls, pWInfo, bp+56) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if eOnePass != int32(ONEPASS_SINGLE) { _sqlite3MultiWrite(tls, pParse) } @@ -106427,7 +101754,6 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if !(i < int32(nPk)) { break } - _ = libc.Int32FromInt32(0) _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), iPk+i) goto _16 _16: @@ -106447,12 +101773,12 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** one, so just keep it in its register(s) and fall through to the ** delete code. */ nKey = nPk /* OP_Found will use an unpacked key */ - aToOpen = _sqlite3DbMallocRawNN(tls, db, uint64(nIdx+int32(2))) + aToOpen = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nIdx+int32(2))) if aToOpen == uintptr(0) { _sqlite3WhereEnd(tls, pWInfo) goto delete_from_cleanup } - libc.Xmemset(tls, aToOpen, int32(1), uint32(nIdx+int32(1))) + libc.Xmemset(tls, aToOpen, int32(1), libc.Uint32FromInt32(nIdx+int32(1))) *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nIdx+int32(1)))) = uint8(0) if (*(*[2]int32)(unsafe.Pointer(bp + 56)))[0] >= 0 { *(*Tu8)(unsafe.Pointer(aToOpen + uintptr((*(*[2]int32)(unsafe.Pointer(bp + 56)))[0]-iTabCur))) = uint8(0) @@ -106492,8 +101818,6 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iAddrOnce = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) } _sqlite3OpenTableAndIndices(tls, pParse, pTab, int32(OP_OpenWrite), uint8(OPFLAG_FORDELETE), iTabCur, aToOpen, bp, bp+4) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeJumpHereOrPopInst(tls, v, iAddrOnce) } @@ -106502,30 +101826,27 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** where-clause loop above. */ if eOnePass != ONEPASS_OFF { - _ = libc.Int32FromInt32(0) /* OP_Found will use an unpacked key */ - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp))-iTabCur))) != 0 { - _ = libc.Int32FromInt32(0) + /* OP_Found will use an unpacked key */ + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp))-iTabCur))) != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NotFound), *(*int32)(unsafe.Pointer(bp)), addrBypass, iKey, int32(nKey)) } } else { if pPk != 0 { addrLoop = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iEphCur) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEphCur, 0, iKey) } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_RowData), iEphCur, iKey) } - _ = libc.Int32FromInt32(0) /* OP_Found will use a composite key */ + /* OP_Found will use a composite key */ } else { addrLoop = _sqlite3VdbeAddOp3(tls, v, int32(OP_RowSetRead), iRowSet, 0, iKey) - _ = libc.Int32FromInt32(0) } } /* Delete the row */ - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { pVTab = _sqlite3GetVTable(tls, db, pTab) _sqlite3VtabMakeWritable(tls, pParse, pTab) - _ = libc.Int32FromInt32(0) _sqlite3MayAbort(tls, pParse) if eOnePass == int32(ONEPASS_SINGLE) { _sqlite3VdbeAddOp1(tls, v, int32(OP_Close), iTabCur) @@ -106536,8 +101857,8 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), 0, int32(1), iKey, pVTab, -int32(11)) _sqlite3VdbeChangeP5(tls, v, uint16(OE_Abort)) } else { - count = libc.BoolInt32(int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0) /* True to count changes */ - _sqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), iKey, nKey, uint8(count), uint8(OE_Default), uint8(eOnePass), (*(*[2]int32)(unsafe.Pointer(bp + 56)))[int32(1)]) + count = libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0) /* True to count changes */ + _sqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), iKey, nKey, libc.Uint8FromInt32(count), uint8(OE_Default), libc.Uint8FromInt32(eOnePass), (*(*[2]int32)(unsafe.Pointer(bp + 56)))[int32(1)]) } /* End of the loop over all rowids/primary-keys. */ if eOnePass != ONEPASS_OFF { @@ -106557,7 +101878,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** maximum rowid counter values recorded while inserting into ** autoincrement tables. */ - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0) { _sqlite3AutoincrementEnd(tls, pParse) } /* Return the number of rows that were deleted. If this routine is @@ -106635,7 +101956,6 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Vdbe */ iOld = 0 /* Seek opcode */ /* Vdbe is guaranteed to have been allocated by this stage. */ - _ = libc.Int32FromInt32(0) /* Seek cursor iCur to the row to delete. If this row no longer exists ** (this can happen if a trigger program has already deleted it), do ** not attempt to delete it or fire any DELETE triggers. */ @@ -106645,16 +101965,16 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri } else { v1 = int32(OP_NotFound) } - opSeek = uint8(v1) - if int32(eMode) == ONEPASS_OFF { - _sqlite3VdbeAddOp4Int(tls, v, int32(opSeek), iDataCur, iLabel, iPk, int32(nPk)) + opSeek = libc.Uint8FromInt32(v1) + if libc.Int32FromUint8(eMode) == ONEPASS_OFF { + _sqlite3VdbeAddOp4Int(tls, v, libc.Int32FromUint8(opSeek), iDataCur, iLabel, iPk, int32(nPk)) } /* If there are any triggers to fire, allocate a range of registers to ** use for the old.* references in the triggers. */ if _sqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0 || pTrigger != 0 { /* Start of BEFORE trigger programs */ /* TODO: Could use temporary registers here. Also could attempt to ** avoid copying the contents of the rowid register. */ - mask = _sqlite3TriggerColmask(tls, pParse, pTrigger, uintptr(0), 0, libc.Int32FromInt32(TRIGGER_BEFORE)|libc.Int32FromInt32(TRIGGER_AFTER), pTab, int32(onconf)) + mask = _sqlite3TriggerColmask(tls, pParse, pTrigger, uintptr(0), 0, libc.Int32FromInt32(TRIGGER_BEFORE)|libc.Int32FromInt32(TRIGGER_AFTER), pTab, libc.Int32FromUint8(onconf)) mask |= _sqlite3FkOldmask(tls, pParse, pTab) iOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) *(*int32)(unsafe.Pointer(pParse + 44)) += int32(1) + int32((*TTable)(unsafe.Pointer(pTab)).FnCol) @@ -106677,7 +101997,7 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri } /* Invoke BEFORE DELETE trigger programs. */ addrStart = _sqlite3VdbeCurrentAddr(tls, v) - _sqlite3CodeRowTrigger(tls, pParse, pTrigger, int32(TK_DELETE), uintptr(0), int32(TRIGGER_BEFORE), pTab, iOld, int32(onconf), iLabel) + _sqlite3CodeRowTrigger(tls, pParse, pTrigger, int32(TK_DELETE), uintptr(0), int32(TRIGGER_BEFORE), pTab, iOld, libc.Int32FromUint8(onconf), iLabel) /* If any BEFORE triggers were coded, then seek the cursor to the ** row to be deleted again. It may be that the BEFORE triggers moved ** the cursor or already deleted the row that the cursor was @@ -106687,7 +102007,7 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri ** may have moved that cursor. */ if addrStart < _sqlite3VdbeCurrentAddr(tls, v) { - _sqlite3VdbeAddOp4Int(tls, v, int32(opSeek), iDataCur, iLabel, iPk, int32(nPk)) + _sqlite3VdbeAddOp4Int(tls, v, libc.Int32FromUint8(opSeek), iDataCur, iLabel, iPk, int32(nPk)) iIdxNoSeek = -int32(1) } /* Do FK processing. This call checks that any FK constraints that @@ -106705,7 +102025,7 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri ** the update-hook is not invoked for rows removed by REPLACE, but the ** pre-update-hook is. */ - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { p5 = uint8(0) _sqlite3GenerateRowIndexDelete(tls, pParse, pTab, iDataCur, iIdxCur, uintptr(0), iIdxNoSeek) if count != 0 { @@ -106714,16 +102034,16 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri v3 = 0 } _sqlite3VdbeAddOp2(tls, v, int32(OP_Delete), iDataCur, v3) - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 || 0 == Xsqlite3_stricmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11707) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 || 0 == Xsqlite3_stricmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11707) { _sqlite3VdbeAppendP4(tls, v, pTab, -int32(5)) } - if int32(eMode) != ONEPASS_OFF { + if libc.Int32FromUint8(eMode) != ONEPASS_OFF { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_AUXDELETE)) } if iIdxNoSeek >= 0 && iIdxNoSeek != iDataCur { _sqlite3VdbeAddOp1(tls, v, int32(OP_Delete), iIdxNoSeek) } - if int32(eMode) == int32(ONEPASS_MULTI) { + if libc.Int32FromUint8(eMode) == int32(ONEPASS_MULTI) { p5 = Tu8(int32(p5) | libc.Int32FromInt32(OPFLAG_SAVEPOSITION)) } _sqlite3VdbeChangeP5(tls, v, uint16(p5)) @@ -106734,7 +102054,7 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri _sqlite3FkActions(tls, pParse, pTab, uintptr(0), iOld, uintptr(0), 0) /* Invoke AFTER DELETE trigger programs. */ if pTrigger != 0 { - _sqlite3CodeRowTrigger(tls, pParse, pTrigger, int32(TK_DELETE), uintptr(0), int32(TRIGGER_AFTER), pTab, iOld, int32(onconf), iLabel) + _sqlite3CodeRowTrigger(tls, pParse, pTrigger, int32(TK_DELETE), uintptr(0), int32(TRIGGER_AFTER), pTab, iOld, libc.Int32FromUint8(onconf), iLabel) } /* Jump here if the row had already been deleted before any BEFORE ** trigger programs were invoked. Or if a trigger program throws a @@ -106784,7 +102104,6 @@ func _sqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, if !(pIdx != 0) { break } - _ = libc.Int32FromInt32(0) if aRegIdx != uintptr(0) && *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) == 0 { goto _2 } @@ -106796,9 +102115,9 @@ func _sqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, } r1 = _sqlite3GenerateIndexKey(tls, pParse, pIdx, iDataCur, 0, int32(1), bp, pPrior, r1) if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 { - v3 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + v3 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) } else { - v3 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v3 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } _sqlite3VdbeAddOp3(tls, v, int32(OP_IdxDelete), iIdxCur+i, r1, v3) _sqlite3VdbeChangeP5(tls, v, uint16(1)) /* Cause IdxDelete to error if no entry found */ @@ -106863,9 +102182,9 @@ func _sqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData } } if prefixOnly != 0 && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 { - v1 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + v1 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) } else { - v1 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v1 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } nCol = v1 regBase = _sqlite3GetTempRange(tls, pParse, nCol) @@ -106947,10 +102266,7 @@ func _sqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { func _sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) (r uintptr) { var pOp uintptr _ = pOp - _ = libc.Int32FromInt32(0) pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(context)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(context)).FiOp-int32(1))*20 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -106961,7 +102277,6 @@ func _sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) (r uintptr) { // ** iteration of the aggregate loop. // */ func _sqlite3SkipAccumulatorLoad(tls *libc.TLS, context uintptr) { - _ = libc.Int32FromInt32(0) (*Tsqlite3_context)(unsafe.Pointer(context)).FisError = -int32(1) (*Tsqlite3_context)(unsafe.Pointer(context)).FskipFlag = uint8(1) } @@ -106975,7 +102290,6 @@ func _minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var i, iBest, mask, v1 int32 var pColl uintptr _, _, _, _, _ = i, iBest, mask, pColl, v1 - _ = libc.Int32FromInt32(0) if Xsqlite3_user_data(tls, context) == uintptr(0) { v1 = 0 } else { @@ -106983,8 +102297,6 @@ func _minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } mask = v1 pColl = _sqlite3GetFuncCollSeq(tls, context) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iBest = 0 if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == int32(SQLITE_NULL) { return @@ -107018,12 +102330,6 @@ func _typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { _ = i i = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) - int32(1) _ = NotUsed - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* EVIDENCE-OF: R-01470-60482 The sqlite3_value_type(V) interface returns ** the datatype code for the initial datatype of the sqlite3_value object ** V. The returned value is one of SQLITE_INTEGER, SQLITE_FLOAT, @@ -107047,7 +102353,7 @@ var _azType2 = [5]uintptr{ // */ func _subtypeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _ = argc - Xsqlite3_result_int(tls, context, int32(Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(argv))))) + Xsqlite3_result_int(tls, context, libc.Int32FromUint32(Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(argv))))) } // C documentation @@ -107059,7 +102365,6 @@ func _lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var c, v1 uint8 var z, z0 uintptr _, _, _, _ = c, z, z0, v1 - _ = libc.Int32FromInt32(0) _ = argc switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { case int32(SQLITE_BLOB): @@ -107077,12 +102382,12 @@ func _lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { for { v1 = *(*uint8)(unsafe.Pointer(z)) c = v1 - if !(int32(v1) != 0) { + if !(libc.Int32FromUint8(v1) != 0) { break } z++ - if int32(c) >= int32(0xc0) { - for int32(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(c) >= int32(0xc0) { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { z++ z0++ } @@ -107104,7 +102409,6 @@ func _bytelengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var m Ti64 var v1 int32 _, _ = m, v1 - _ = libc.Int32FromInt32(0) _ = argc switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { case int32(SQLITE_BLOB): @@ -107112,7 +102416,7 @@ func _bytelengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { case int32(SQLITE_INTEGER): fallthrough case int32(SQLITE_FLOAT): - if int32((*Tsqlite3)(unsafe.Pointer(Xsqlite3_context_db_handle(tls, context))).Fenc) <= int32(SQLITE_UTF8) { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(Xsqlite3_context_db_handle(tls, context))).Fenc) <= int32(SQLITE_UTF8) { v1 = int32(1) } else { v1 = int32(2) @@ -107143,7 +102447,6 @@ func _absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var iVal Ti64 var rVal float64 _, _ = iVal, rVal - _ = libc.Int32FromInt32(0) _ = argc switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { case int32(SQLITE_INTEGER): @@ -107236,9 +102539,9 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { goto endInstrOOM } firstChar = *(*uint8)(unsafe.Pointer(zNeedle)) - for nNeedle <= nHaystack && (int32(*(*uint8)(unsafe.Pointer(zHaystack))) != int32(firstChar) || libc.Xmemcmp(tls, zHaystack, zNeedle, uint32(nNeedle)) != 0) { + for nNeedle <= nHaystack && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zHaystack))) != libc.Int32FromUint8(firstChar) || libc.Xmemcmp(tls, zHaystack, zNeedle, libc.Uint32FromInt32(nNeedle)) != 0) { N++ - for cond := true; cond; cond = isText != 0 && int32(*(*uint8)(unsafe.Pointer(zHaystack)))&int32(0xc0) == int32(0x80) { + for cond := true; cond; cond = isText != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zHaystack)))&int32(0xc0) == int32(0x80) { nHaystack-- zHaystack++ } @@ -107287,7 +102590,7 @@ func _printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _sqlite3StrAccumInit(tls, bp+12, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 116))) (*(*TStrAccum)(unsafe.Pointer(bp + 12))).FprintfFlags = uint8(SQLITE_PRINTF_SQLFUNC) Xsqlite3_str_appendf(tls, bp+12, zFormat, libc.VaList(bp+48, bp)) - n = int32((*(*TStrAccum)(unsafe.Pointer(bp + 12))).FnChar) + n = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp + 12))).FnChar) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp+12), n, __ccgo_fp(_sqlite3OomClear)) } } @@ -107312,7 +102615,6 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var z, z2, v2, v3, v5 uintptr _, _, _, _, _, _, _, _, _, _ = len1, negP2, p0type, p1, p2, z, z2, v2, v3, v5 negP2 = 0 - _ = libc.Int32FromInt32(0) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == int32(SQLITE_NULL) || argc == int32(3) && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))) == int32(SQLITE_NULL) { return } @@ -107324,7 +102626,6 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if z == uintptr(0) { return } - _ = libc.Int32FromInt32(0) } else { z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if z == uintptr(0) { @@ -107339,8 +102640,8 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } v2 = z2 z2++ - if int32(*(*uint8)(unsafe.Pointer(v2))) >= int32(0xc0) { - for int32(*(*uint8)(unsafe.Pointer(z2)))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2))) >= int32(0xc0) { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z2)))&int32(0xc0) == int32(0x80) { z2++ } } @@ -107385,13 +102686,12 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { p1 = 0 } } - _ = libc.Int32FromInt32(0) if p0type != int32(SQLITE_BLOB) { for *(*uint8)(unsafe.Pointer(z)) != 0 && p1 != 0 { v3 = z z++ - if int32(*(*uint8)(unsafe.Pointer(v3))) >= int32(0xc0) { - for int32(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3))) >= int32(0xc0) { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { z++ } } @@ -107404,8 +102704,8 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } v5 = z2 z2++ - if int32(*(*uint8)(unsafe.Pointer(v5))) >= int32(0xc0) { - for int32(*(*uint8)(unsafe.Pointer(z2)))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v5))) >= int32(0xc0) { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z2)))&int32(0xc0) == int32(0x80) { z2++ } } @@ -107414,7 +102714,7 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ; p2-- } - Xsqlite3_result_text64(tls, context, z, uint64(int32(z2)-int32(z)), uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) + Xsqlite3_result_text64(tls, context, z, libc.Uint64FromInt32(int32(z2)-int32(z)), uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) } else { if p1+p2 > int64(len1) { p2 = int64(len1) - p1 @@ -107422,7 +102722,7 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { p2 = 0 } } - Xsqlite3_result_blob64(tls, context, z+uintptr(p1), uint64(p2), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_blob64(tls, context, z+uintptr(p1), libc.Uint64FromInt64(p2), uintptr(-libc.Int32FromInt32(1))) } } @@ -107440,7 +102740,6 @@ func _roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _ /* r at bp+0 */ float64 _, _, _ = n, zBuf, v1 n = 0 - _ = libc.Int32FromInt32(0) if argc == int32(2) { if int32(SQLITE_NULL) == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) { return @@ -107497,12 +102796,11 @@ func _contextMalloc(tls *libc.TLS, context uintptr, nByte Ti64) (r uintptr) { var db, z uintptr _, _ = db, z db = Xsqlite3_context_db_handle(tls, context) - _ = libc.Int32FromInt32(0) if nByte > int64(*(*int32)(unsafe.Pointer(db + 116))) { Xsqlite3_result_error_toobig(tls, context) z = uintptr(0) } else { - z = _sqlite3Malloc(tls, uint64(nByte)) + z = _sqlite3Malloc(tls, libc.Uint64FromInt64(nByte)) if !(z != 0) { Xsqlite3_result_error_nomem(tls, context) } @@ -107523,7 +102821,6 @@ func _upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { z2 = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) /* Verify that the call to _bytes() does not invalidate the _text() pointer */ - _ = libc.Int32FromInt32(0) if z2 != 0 { z1 = _contextMalloc(tls, context, int64(n)+int64(1)) if z1 != 0 { @@ -107532,7 +102829,7 @@ func _upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i < n) { break } - *(*int8)(unsafe.Pointer(z1 + uintptr(i))) = int8(int32(*(*int8)(unsafe.Pointer(z2 + uintptr(i)))) & ^(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z2 + uintptr(i))))]) & libc.Int32FromInt32(0x20))) + *(*int8)(unsafe.Pointer(z1 + uintptr(i))) = int8(int32(*(*int8)(unsafe.Pointer(z2 + uintptr(i)))) & ^(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z2 + uintptr(i))))]) & libc.Int32FromInt32(0x20))) goto _1 _1: ; @@ -107551,7 +102848,6 @@ func _lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { z2 = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) /* Verify that the call to _bytes() does not invalidate the _text() pointer */ - _ = libc.Int32FromInt32(0) if z2 != 0 { z1 = _contextMalloc(tls, context, int64(n)+int64(1)) if z1 != 0 { @@ -107560,7 +102856,7 @@ func _lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i < n) { break } - *(*int8)(unsafe.Pointer(z1 + uintptr(i))) = int8(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z2 + uintptr(i))))]) + *(*int8)(unsafe.Pointer(z1 + uintptr(i))) = libc.Int8FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z2 + uintptr(i))))]) goto _1 _1: ; @@ -107616,7 +102912,6 @@ func _randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var n Tsqlite3_int64 var p uintptr _, _ = n, p - _ = libc.Int32FromInt32(0) _ = argc n = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) if n < int64(1) { @@ -107787,7 +103082,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u noCase = (*TcompareInfo)(unsafe.Pointer(pInfo)).FnoCase /* True if uppercase==lowercase */ zEscaped = uintptr(0) /* One past the last escaped input char */ for { - if int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < int32(0x80) { v3 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ v2 = uint32(*(*Tu8)(unsafe.Pointer(v3))) @@ -107804,7 +103099,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u ** are also "?" characters, skip those as well, but consume a ** single character of the input string for each "?" skipped */ for { - if int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < int32(0x80) { v6 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ v5 = uint32(*(*Tu8)(unsafe.Pointer(v6))) @@ -107824,7 +103119,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u return SQLITE_MATCH /* "*" at the end of the pattern matches */ } else { if c == matchOther { - if int32((*TcompareInfo)(unsafe.Pointer(pInfo)).FmatchSet) == 0 { + if libc.Int32FromUint8((*TcompareInfo)(unsafe.Pointer(pInfo)).FmatchSet) == 0 { c = _sqlite3Utf8Read(tls, bp) if c == uint32(0) { return int32(SQLITE_NOWILDCARDMATCH) @@ -107832,7 +103127,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u } else { /* "[...]" immediately follows the "*". We have to do a slow ** recursive search in this case, but it is an unusual case. */ - _ = libc.Int32FromInt32(0) /* '[' is a single-byte character */ + /* '[' is a single-byte character */ for *(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))) != 0 { bMatch = _patternCompare(tls, *(*uintptr)(unsafe.Pointer(bp))+uintptr(-libc.Int32FromInt32(1)), *(*uintptr)(unsafe.Pointer(bp + 4)), pInfo, matchOther) if bMatch != int32(SQLITE_NOMATCH) { @@ -107840,8 +103135,8 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u } v7 = *(*uintptr)(unsafe.Pointer(bp + 4)) *(*uintptr)(unsafe.Pointer(bp + 4))++ - if int32(*(*Tu8)(unsafe.Pointer(v7))) >= int32(0xc0) { - for int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v7))) >= int32(0xc0) { + for libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))))&int32(0xc0) == int32(0x80) { *(*uintptr)(unsafe.Pointer(bp + 4))++ } } @@ -107861,16 +103156,16 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u */ if c < uint32(0x80) { if noCase != 0 { - (*(*[3]int8)(unsafe.Pointer(bp + 9)))[0] = int8(c & uint32(^(int32(_sqlite3CtypeMap[uint8(c)]) & libc.Int32FromInt32(0x20)))) - (*(*[3]int8)(unsafe.Pointer(bp + 9)))[int32(1)] = int8(_sqlite3UpperToLower[uint8(c)]) + (*(*[3]int8)(unsafe.Pointer(bp + 9)))[0] = libc.Int8FromUint32(c & libc.Uint32FromInt32(^(libc.Int32FromUint8(_sqlite3CtypeMap[uint8(c)]) & libc.Int32FromInt32(0x20)))) + (*(*[3]int8)(unsafe.Pointer(bp + 9)))[int32(1)] = libc.Int8FromUint8(_sqlite3UpperToLower[uint8(c)]) (*(*[3]int8)(unsafe.Pointer(bp + 9)))[int32(2)] = 0 } else { - (*(*[3]int8)(unsafe.Pointer(bp + 9)))[0] = int8(c) + (*(*[3]int8)(unsafe.Pointer(bp + 9)))[0] = libc.Int8FromUint32(c) (*(*[3]int8)(unsafe.Pointer(bp + 9)))[int32(1)] = 0 } for int32(1) != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) += uintptr(libc.Xstrcspn(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), bp+9)) - if int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) == 0 { break } *(*uintptr)(unsafe.Pointer(bp + 4))++ @@ -107881,7 +103176,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u } } else { for { - if int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) < int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) < int32(0x80) { v10 = *(*uintptr)(unsafe.Pointer(bp + 4)) *(*uintptr)(unsafe.Pointer(bp + 4))++ v9 = uint32(*(*Tu8)(unsafe.Pointer(v10))) @@ -107905,7 +103200,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u return int32(SQLITE_NOWILDCARDMATCH) } if c == matchOther { - if int32((*TcompareInfo)(unsafe.Pointer(pInfo)).FmatchSet) == 0 { + if libc.Int32FromUint8((*TcompareInfo)(unsafe.Pointer(pInfo)).FmatchSet) == 0 { c = _sqlite3Utf8Read(tls, bp) if c == uint32(0) { return int32(SQLITE_NOMATCH) @@ -107931,7 +103226,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u c2 = _sqlite3Utf8Read(tls, bp) } for c2 != 0 && c2 != uint32(']') { - if c2 == uint32('-') && int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != int32(']') && int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != 0 && prior_c > uint32(0) { + if c2 == uint32('-') && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != int32(']') && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != 0 && prior_c > uint32(0) { c2 = _sqlite3Utf8Read(tls, bp) if c >= prior_c && c <= c2 { seen = int32(1) @@ -107951,7 +103246,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u continue } } - if int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) < int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) < int32(0x80) { v12 = *(*uintptr)(unsafe.Pointer(bp + 4)) *(*uintptr)(unsafe.Pointer(bp + 4))++ v11 = uint32(*(*Tu8)(unsafe.Pointer(v12))) @@ -107962,7 +103257,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u if c == c2 { continue } - if noCase != 0 && int32(_sqlite3UpperToLower[uint8(c)]) == int32(_sqlite3UpperToLower[uint8(c2)]) && c < uint32(0x80) && c2 < uint32(0x80) { + if noCase != 0 && libc.Int32FromUint8(_sqlite3UpperToLower[uint8(c)]) == libc.Int32FromUint8(_sqlite3UpperToLower[uint8(c2)]) && c < uint32(0x80) && c2 < uint32(0x80) { continue } if c == matchOne && *(*uintptr)(unsafe.Pointer(bp)) != zEscaped && c2 != uint32(0) { @@ -107970,7 +103265,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u } return int32(SQLITE_NOMATCH) } - if int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) == 0 { v13 = SQLITE_MATCH } else { v13 = int32(SQLITE_NOMATCH) @@ -108163,7 +103458,6 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { func _compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var zOptName, v1 uintptr _, _ = zOptName, v1 - _ = libc.Int32FromInt32(0) _ = argc /* IMP: R-39564-36305 The sqlite_compileoption_used() SQL ** function is a wrapper around the sqlite3_compileoption_used() C/C++ @@ -108186,7 +103480,6 @@ func _compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uin func _compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var n int32 _ = n - _ = libc.Int32FromInt32(0) _ = argc /* IMP: R-04922-24076 The sqlite_compileoption_get() SQL function ** is a wrapper around the sqlite3_compileoption_get() C/C++ function. @@ -108236,14 +103529,13 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ - _ = libc.Int32FromInt32(0) switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15416, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { - _sqlite3AtoF(tls, zVal, bp, int32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) + _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15424, libc.VaList(bp+16, r1)) @@ -108254,9 +103546,9 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) - _ = libc.Int32FromInt32(0) /* No encoding change */ + /* No encoding change */ _sqlite3StrAccumEnlarge(tls, pStr, nBlob*int64(2)+int64(4)) - if int32((*TStrAccum)(unsafe.Pointer(pStr)).FaccError) == 0 { + if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(pStr)).FaccError) == 0 { zText = (*TStrAccum)(unsafe.Pointer(pStr)).FzText i = 0 for { @@ -108274,13 +103566,12 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { *(*int8)(unsafe.Pointer(zText + uintptr(nBlob*int64(2)+int64(3)))) = int8('\000') *(*int8)(unsafe.Pointer(zText)) = int8('X') *(*int8)(unsafe.Pointer(zText + 1)) = int8('\'') - (*TStrAccum)(unsafe.Pointer(pStr)).FnChar = uint32(nBlob*int64(2) + int64(3)) + (*TStrAccum)(unsafe.Pointer(pStr)).FnChar = libc.Uint32FromInt64(nBlob*int64(2) + int64(3)) } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15432, libc.VaList(bp+16, zArg)) default: - _ = libc.Int32FromInt32(0) Xsqlite3_str_append(tls, pStr, __ccgo_ts+1663, int32(4)) break } @@ -108305,14 +103596,13 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _ /* str at bp+0 */ Tsqlite3_str _ = db db = Xsqlite3_context_db_handle(tls, context) - _ = libc.Int32FromInt32(0) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 116))) _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) - Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), int32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) - if int32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { + Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) + if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) - Xsqlite3_result_error_code(tls, context, int32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError)) + Xsqlite3_result_error_code(tls, context, libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError)) } } @@ -108329,7 +103619,7 @@ func _unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) _ = argc if *(*uintptr)(unsafe.Pointer(bp)) != 0 && *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) != 0 { - Xsqlite3_result_int(tls, context, int32(_sqlite3Utf8Read(tls, bp))) + Xsqlite3_result_int(tls, context, libc.Int32FromUint32(_sqlite3Utf8Read(tls, bp))) } } @@ -108346,7 +103636,7 @@ func _charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var x Tsqlite3_int64 var z, zOut, v1, v10, v11, v12, v3, v4, v5, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, i, x, z, zOut, v1, v10, v11, v12, v3, v4, v5, v6, v7, v8, v9 - v1 = Xsqlite3_malloc64(tls, uint64(argc*int32(4)+int32(1))) + v1 = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(argc*int32(4)+int32(1))) z = v1 zOut = v1 if z == uintptr(0) { @@ -108362,7 +103652,7 @@ func _charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if x < 0 || x > int64(0x10ffff) { x = int64(0xfffd) } - c = uint32(x & libc.Int64FromInt32(0x1fffff)) + c = libc.Uint32FromInt64(x & libc.Int64FromInt32(0x1fffff)) if c < uint32(0x00080) { v3 = zOut zOut++ @@ -108371,34 +103661,34 @@ func _charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if c < uint32(0x00800) { v4 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v4)) = uint8(int32(0xC0) + int32(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) + *(*uint8)(unsafe.Pointer(v4)) = libc.Uint8FromInt32(int32(0xC0) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) v5 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v5)) = uint8(int32(0x80) + int32(uint8(c&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c&libc.Uint32FromInt32(0x3F)))) } else { if c < uint32(0x10000) { v6 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v6)) = uint8(int32(0xE0) + int32(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) + *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(0xE0) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v7 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v7)) = uint8(int32(0x80) + int32(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v8 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v8)) = uint8(int32(0x80) + int32(uint8(c&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c&libc.Uint32FromInt32(0x3F)))) } else { v9 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v9)) = uint8(int32(0xF0) + int32(uint8(c>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(int32(0xF0) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) v10 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v10)) = uint8(int32(0x80) + int32(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v10)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) v11 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v11)) = uint8(int32(0x80) + int32(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v12 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v12)) = uint8(int32(0x80) + int32(uint8(c&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(c&libc.Uint32FromInt32(0x3F)))) } } } @@ -108408,7 +103698,7 @@ func _charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { i++ } *(*uint8)(unsafe.Pointer(zOut)) = uint8(0) - Xsqlite3_result_text64(tls, context, z, uint64(int32(zOut)-int32(z)), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + Xsqlite3_result_text64(tls, context, z, libc.Uint64FromInt32(int32(zOut)-int32(z)), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) } // C documentation @@ -108422,11 +103712,10 @@ func _hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var i, n int32 var pBlob, z, zHex, v1, v3, v4 uintptr _, _, _, _, _, _, _, _, _ = c, i, n, pBlob, z, zHex, v1, v3, v4 - _ = libc.Int32FromInt32(0) _ = argc pBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) - _ = libc.Int32FromInt32(0) /* No encoding change */ + /* No encoding change */ v1 = _contextMalloc(tls, context, int64(n)*int64(2)+int64(1)) zHex = v1 z = v1 @@ -108439,10 +103728,10 @@ func _hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { c = *(*uint8)(unsafe.Pointer(pBlob)) v3 = z z++ - *(*int8)(unsafe.Pointer(v3)) = _hexdigits[int32(c)>>int32(4)&int32(0xf)] + *(*int8)(unsafe.Pointer(v3)) = _hexdigits[libc.Int32FromUint8(c)>>int32(4)&int32(0xf)] v4 = z z++ - *(*int8)(unsafe.Pointer(v4)) = _hexdigits[int32(c)&int32(0xf)] + *(*int8)(unsafe.Pointer(v4)) = _hexdigits[libc.Int32FromUint8(c)&int32(0xf)] goto _2 _2: ; @@ -108450,7 +103739,7 @@ func _hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { pBlob++ } *(*int8)(unsafe.Pointer(z)) = 0 - Xsqlite3_result_text64(tls, context, zHex, uint64(int32(z)-int32(zHex)), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + Xsqlite3_result_text64(tls, context, zHex, libc.Uint64FromInt32(int32(z)-int32(zHex)), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) } } @@ -108471,7 +103760,7 @@ func _strContainsChar(tls *libc.TLS, zStr uintptr, nStr int32, ch Tu32) (r int32 zEnd = zStr + uintptr(nStr) *(*uintptr)(unsafe.Pointer(bp)) = zStr for *(*uintptr)(unsafe.Pointer(bp)) < zEnd { - if int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < int32(0x80) { v2 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ v1 = uint32(*(*Tu8)(unsafe.Pointer(v2))) @@ -108526,7 +103815,6 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) pBlob = uintptr(0) p = uintptr(0) - _ = libc.Int32FromInt32(0) if argc == int32(2) { zPass = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) nPass = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) @@ -108541,11 +103829,11 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { for { v2 = *(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) c = v2 - if !(int32(v2) != 0x00) { + if !(libc.Int32FromUint8(v2) != 0x00) { break } - for !(int32(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x08) != 0) { - if int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < int32(0x80) { + for !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x08) != 0) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < int32(0x80) { v4 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ v3 = uint32(*(*Tu8)(unsafe.Pointer(v4))) @@ -108553,27 +103841,24 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { v3 = _sqlite3Utf8Read(tls, bp) } ch = v3 - _ = libc.Int32FromInt32(0) if !(_strContainsChar(tls, zPass, nPass, ch) != 0) { goto unhex_null } c = *(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) - if int32(c) == 0x00 { + if libc.Int32FromUint8(c) == 0x00 { goto unhex_done } } *(*uintptr)(unsafe.Pointer(bp))++ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v5 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ d = *(*Tu8)(unsafe.Pointer(v5)) - if !(int32(_sqlite3CtypeMap[d])&libc.Int32FromInt32(0x08) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[d])&libc.Int32FromInt32(0x08) != 0) { goto unhex_null } v6 = p p++ - *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<<int32(4) | int32(_sqlite3HexToInt(tls, int32(d)))) + *(*Tu8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(libc.Int32FromUint8(_sqlite3HexToInt(tls, libc.Int32FromUint8(c)))<<int32(4) | libc.Int32FromUint8(_sqlite3HexToInt(tls, libc.Int32FromUint8(d)))) } } goto unhex_done @@ -108597,13 +103882,12 @@ func _zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var n Ti64 var rc int32 _, _ = n, rc - _ = libc.Int32FromInt32(0) _ = argc n = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) if n < 0 { n = 0 } - rc = Xsqlite3_result_zeroblob64(tls, context, uint64(n)) /* IMP: R-00293-64994 */ + rc = Xsqlite3_result_zeroblob64(tls, context, libc.Uint64FromInt64(n)) /* IMP: R-00293-64994 */ if rc != 0 { Xsqlite3_result_error_code(tls, context, rc) } @@ -108624,34 +103908,29 @@ func _replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var nOut Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cntExpand, db, i, j, loopLimit, nOut, nPattern, nRep, nStr, zOld, zOut, zPattern, zRep, zStr, v2, v3 /* Number zOut expansions */ db = Xsqlite3_context_db_handle(tls, context) - _ = libc.Int32FromInt32(0) _ = argc zStr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zStr == uintptr(0) { return } nStr = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) - _ = libc.Int32FromInt32(0) /* No encoding change */ + /* No encoding change */ zPattern = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) if zPattern == uintptr(0) { - _ = libc.Int32FromInt32(0) return } - if int32(*(*uint8)(unsafe.Pointer(zPattern))) == 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPattern))) == 0 { Xsqlite3_result_text(tls, context, zStr, nStr, uintptr(-libc.Int32FromInt32(1))) return } nPattern = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) - _ = libc.Int32FromInt32(0) /* No encoding change */ + /* No encoding change */ zRep = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))) if zRep == uintptr(0) { return } nRep = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))) - _ = libc.Int32FromInt32(0) nOut = int64(nStr + int32(1)) - _ = libc.Int32FromInt32(0) zOut = _contextMalloc(tls, context, nOut) if zOut == uintptr(0) { return @@ -108665,7 +103944,7 @@ func _replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i <= loopLimit) { break } - if int32(*(*uint8)(unsafe.Pointer(zStr + uintptr(i)))) != int32(*(*uint8)(unsafe.Pointer(zPattern))) || libc.Xmemcmp(tls, zStr+uintptr(i), zPattern, uint32(nPattern)) != 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zStr + uintptr(i)))) != libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPattern))) || libc.Xmemcmp(tls, zStr+uintptr(i), zPattern, libc.Uint32FromInt32(nPattern)) != 0 { v3 = j j++ *(*uint8)(unsafe.Pointer(zOut + uintptr(v3))) = *(*uint8)(unsafe.Pointer(zStr + uintptr(i))) @@ -108680,7 +103959,7 @@ func _replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { cntExpand++ if cntExpand&(cntExpand-uint32(1)) == uint32(0) { zOld = zOut - zOut = _sqlite3Realloc(tls, zOut, uint64(int64(int32(nOut))+(nOut-int64(nStr)-int64(1)))) + zOut = _sqlite3Realloc(tls, zOut, libc.Uint64FromInt64(int64(int32(nOut))+(nOut-int64(nStr)-int64(1)))) if zOut == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) Xsqlite3_free(tls, zOld) @@ -108688,7 +103967,7 @@ func _replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } } - libc.Xmemcpy(tls, zOut+uintptr(j), zRep, uint32(nRep)) + libc.Xmemcpy(tls, zOut+uintptr(j), zRep, libc.Uint32FromInt32(nRep)) j += nRep i += nPattern - int32(1) } @@ -108697,10 +103976,8 @@ func _replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ; i++ } - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, zOut+uintptr(j), zStr+uintptr(i), uint32(nStr-i)) + libc.Xmemcpy(tls, zOut+uintptr(j), zStr+uintptr(i), libc.Uint32FromInt32(nStr-i)) j += nStr - i - _ = libc.Int32FromInt32(0) *(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0) Xsqlite3_result_text(tls, context, zOut, j, __ccgo_fp(Xsqlite3_free)) } @@ -108725,8 +104002,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if zIn == uintptr(0) { return } - nIn = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - _ = libc.Int32FromInt32(0) + nIn = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) if argc == int32(1) { nChar = int32(1) aLen = uintptr(unsafe.Pointer(&_lenOne)) @@ -108746,8 +104022,8 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } v3 = z z++ - if int32(*(*uint8)(unsafe.Pointer(v3))) >= int32(0xc0) { - for int32(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3))) >= int32(0xc0) { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { z++ } } @@ -108757,7 +104033,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, int64(nChar)*int64(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(4))) + azChar = _contextMalloc(tls, context, int64(nChar)*libc.Int64FromUint32(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(4))) if azChar == uintptr(0) { return } @@ -108771,12 +104047,12 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*4)) = z v5 = z z++ - if int32(*(*uint8)(unsafe.Pointer(v5))) >= int32(0xc0) { - for int32(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v5))) >= int32(0xc0) { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { z++ } } - *(*uint32)(unsafe.Pointer(aLen + uintptr(nChar)*4)) = uint32(int32(z) - int32(*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*4)))) + *(*uint32)(unsafe.Pointer(aLen + uintptr(nChar)*4)) = libc.Uint32FromInt32(int32(z) - int32(*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*4)))) goto _4 _4: ; @@ -108838,7 +104114,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { Xsqlite3_free(tls, azChar) } } - Xsqlite3_result_text(tls, context, zIn, int32(nIn), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, context, zIn, libc.Int32FromUint32(nIn), uintptr(-libc.Int32FromInt32(1))) } var _lenOne = [1]uint32{ @@ -108875,7 +104151,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n i++ } n += int64((argc - int32(1)) * nSep) - z = Xsqlite3_malloc64(tls, uint64(n+int64(1))) + z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -108891,10 +104167,10 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if v != uintptr(0) { if j > 0 && nSep > 0 { - libc.Xmemcpy(tls, z+uintptr(j), zSep, uint32(nSep)) + libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint32FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, uint32(k)) + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint32FromInt64(k)) j += k } } @@ -108904,8 +104180,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n i++ } *(*int8)(unsafe.Pointer(z + uintptr(j))) = 0 - _ = libc.Int32FromInt32(0) - Xsqlite3_result_text64(tls, context, z, uint64(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + Xsqlite3_result_text64(tls, context, z, libc.Uint64FromInt64(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) } // C documentation @@ -108959,14 +104234,13 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var zIn uintptr var _ /* zResult at bp+0 */ [8]int8 _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 - _ = libc.Int32FromInt32(0) zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { zIn = __ccgo_ts + 1662 } i = 0 for { - if !(*(*Tu8)(unsafe.Pointer(zIn + uintptr(i))) != 0 && !(int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(zIn + uintptr(i)))])&libc.Int32FromInt32(0x02) != 0)) { + if !(*(*Tu8)(unsafe.Pointer(zIn + uintptr(i))) != 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(zIn + uintptr(i)))])&libc.Int32FromInt32(0x02) != 0)) { break } goto _1 @@ -108975,17 +104249,17 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { i++ } if *(*Tu8)(unsafe.Pointer(zIn + uintptr(i))) != 0 { - prevcode = _iCode[int32(*(*Tu8)(unsafe.Pointer(zIn + uintptr(i))))&int32(0x7f)] - (*(*[8]int8)(unsafe.Pointer(bp)))[0] = int8(int32(*(*Tu8)(unsafe.Pointer(zIn + uintptr(i)))) & ^(int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(zIn + uintptr(i)))]) & libc.Int32FromInt32(0x20))) + prevcode = _iCode[libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zIn + uintptr(i))))&int32(0x7f)] + (*(*[8]int8)(unsafe.Pointer(bp)))[0] = int8(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zIn + uintptr(i)))) & ^(libc.Int32FromUint8(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(zIn + uintptr(i)))]) & libc.Int32FromInt32(0x20))) j = int32(1) for { if !(j < int32(4) && *(*Tu8)(unsafe.Pointer(zIn + uintptr(i))) != 0) { break } - code = int32(_iCode[int32(*(*Tu8)(unsafe.Pointer(zIn + uintptr(i))))&int32(0x7f)]) + code = libc.Int32FromUint8(_iCode[libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zIn + uintptr(i))))&int32(0x7f)]) if code > 0 { - if code != int32(prevcode) { - prevcode = uint8(code) + if code != libc.Int32FromUint8(prevcode) { + prevcode = libc.Uint8FromInt32(code) v3 = j j++ (*(*[8]int8)(unsafe.Pointer(bp)))[v3] = int8(code + int32('0')) @@ -109189,13 +104463,12 @@ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var type1 int32 var _ /* x at bp+0 */ Ti64 _, _ = p, type1 - _ = libc.Int32FromInt32(0) _ = argc p = Xsqlite3_aggregate_context(tls, context, int32(36)) type1 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) if p != 0 && type1 != int32(SQLITE_NULL) { (*TSumCtx)(unsafe.Pointer(p)).Fcnt++ - if int32((*TSumCtx)(unsafe.Pointer(p)).Fapprox) == 0 { + if libc.Int32FromUint8((*TSumCtx)(unsafe.Pointer(p)).Fapprox) == 0 { if type1 != int32(SQLITE_INTEGER) { _kahanBabuskaNeumaierInit(tls, p, (*TSumCtx)(unsafe.Pointer(p)).FiSum) (*TSumCtx)(unsafe.Pointer(p)).Fapprox = uint8(1) @@ -109227,14 +104500,12 @@ func _sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var p uintptr var type1 int32 _, _, _ = iVal, p, type1 - _ = libc.Int32FromInt32(0) _ = argc p = Xsqlite3_aggregate_context(tls, context, int32(36)) type1 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) /* p is always non-NULL because sumStep() will have been called first ** to initialize it */ if p != 0 && type1 != int32(SQLITE_NULL) { - _ = libc.Int32FromInt32(0) (*TSumCtx)(unsafe.Pointer(p)).Fcnt-- if !((*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0) { *(*Ti64)(unsafe.Pointer(p + 16)) -= Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -109346,7 +104617,6 @@ func _countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** sure it still operates correctly, verify that its count agrees with our ** internal count when using count(*) and when the total count can be ** expressed as a 32-bit integer. */ - _ = libc.Int32FromInt32(0) } func _countFinalize(tls *libc.TLS, context uintptr) { @@ -109463,7 +104733,6 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) var db, pGCC, pnsl, zSep, zVal uintptr var firstTerm, i, nA, nSep, nVal, v1 int32 _, _, _, _, _, _, _, _, _, _, _ = db, firstTerm, i, nA, nSep, nVal, pGCC, pnsl, zSep, zVal, v1 - _ = libc.Int32FromInt32(0) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == int32(SQLITE_NULL) { return } @@ -109471,7 +104740,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pGCC != 0 { db = Xsqlite3_context_db_handle(tls, context) firstTerm = libc.BoolInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FmxAlloc == uint32(0)) - (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FmxAlloc = uint32(*(*int32)(unsafe.Pointer(db + 116))) + (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FmxAlloc = libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(db + 116))) if argc == int32(1) { if !(firstTerm != 0) { Xsqlite3_str_appendchar(tls, pGCC, int32(1), int8(',')) @@ -109491,7 +104760,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, uint64(uint32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint32(4))) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint32FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint32(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -109502,7 +104771,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(uint32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint32(4))) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint32FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint32(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -109530,7 +104799,6 @@ func _groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintpt var nVS int32 var pGCC uintptr _, _ = nVS, pGCC - _ = libc.Int32FromInt32(0) _ = argc /* Suppress unused parameter warning */ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == int32(SQLITE_NULL) { return @@ -109545,19 +104813,18 @@ func _groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintpt nVS = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) *(*int32)(unsafe.Pointer(pGCC + 24)) -= int32(1) if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths != uintptr(0) { - _ = libc.Int32FromInt32(0) if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { nVS += *(*int32)(unsafe.Pointer((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths)) - libc.Xmemmove(tls, (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths, (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths+uintptr(1)*4, uint32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum-libc.Int32FromInt32(1))*uint32(4)) + libc.Xmemmove(tls, (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths, (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths+uintptr(1)*4, libc.Uint32FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum-libc.Int32FromInt32(1))*uint32(4)) } } else { /* If removing single accumulated string, harmlessly over-do. */ nVS += (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength } - if nVS >= int32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar) { + if nVS >= libc.Int32FromUint32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar) { (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar = uint32(0) } else { - (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar -= uint32(nVS) + (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar -= libc.Uint32FromInt32(nVS) libc.Xmemmove(tls, (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FzText, (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FzText+uintptr(nVS), (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar) } if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar == uint32(0) { @@ -109584,14 +104851,18 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { pGCC = Xsqlite3_aggregate_context(tls, context, 0) if pGCC != 0 { pAccum = pGCC - if int32((*TStrAccum)(unsafe.Pointer(pAccum)).FaccError) == int32(SQLITE_TOOBIG) { + if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(pAccum)).FaccError) == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, context) } else { - if int32((*TStrAccum)(unsafe.Pointer(pAccum)).FaccError) == int32(SQLITE_NOMEM) { + if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(pAccum)).FaccError) == int32(SQLITE_NOMEM) { Xsqlite3_result_error_nomem(tls, context) } else { - zText = Xsqlite3_str_value(tls, pAccum) - Xsqlite3_result_text(tls, context, zText, int32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) + if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { + Xsqlite3_result_text(tls, context, __ccgo_ts+1662, int32(1), libc.UintptrFromInt32(0)) + } else { + zText = Xsqlite3_str_value(tls, pAccum) + Xsqlite3_result_text(tls, context, zText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) + } } } } @@ -109608,7 +104879,6 @@ func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15440, int32(2)) - _ = libc.Int32FromInt32(0) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -109639,8 +104909,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 } _sqlite3CreateFunc(tls, db, __ccgo_ts+15446, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15446, nArg, uint8(SQLITE_UTF8), uint8(0)) - *(*Tu32)(unsafe.Pointer(pDef + 4)) |= uint32(flags) - *(*Tu32)(unsafe.Pointer(pDef + 4)) &= uint32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) + *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) + *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 _1: ; @@ -109671,14 +104941,10 @@ func _sqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase var nExpr int32 var pDef, pEscape, zEscape uintptr _, _, _, _ = nExpr, pDef, pEscape, zEscape - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if !(*(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0) { return 0 } nExpr = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr - _ = libc.Int32FromInt32(0) pDef = _sqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nExpr, uint8(SQLITE_UTF8), uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_LIKE) == uint32(0) { return 0 @@ -109688,17 +104954,13 @@ func _sqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase ** asserts() that follow verify that assumption */ libc.Xmemcpy(tls, aWc, (*TFuncDef)(unsafe.Pointer(pDef)).FpUserData, uint32(3)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if nExpr < int32(3) { *(*int8)(unsafe.Pointer(aWc + 3)) = 0 } else { pEscape = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 2*20))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pEscape)).Fop) != int32(TK_STRING) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pEscape)).Fop) != int32(TK_STRING) { return 0 } - _ = libc.Int32FromInt32(0) zEscape = *(*uintptr)(unsafe.Pointer(pEscape + 8)) if int32(*(*int8)(unsafe.Pointer(zEscape))) == 0 || int32(*(*int8)(unsafe.Pointer(zEscape + 1))) != 0 { return 0 @@ -109734,7 +104996,6 @@ func _sqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase func _ceilingFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var x uintptr _ = x - _ = libc.Int32FromInt32(0) switch Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { case int32(SQLITE_INTEGER): Xsqlite3_result_int64(tls, context, Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))) @@ -109779,7 +105040,6 @@ func _xFloor(tls *libc.TLS, x float64) (r float64) { func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var ans, b, x float64 _, _, _ = ans, b, x - _ = libc.Int32FromInt32(0) switch Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { case int32(SQLITE_INTEGER): fallthrough @@ -109847,7 +105107,6 @@ func _math1Func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var type0 int32 var x uintptr _, _, _, _ = ans, type0, v0, x - _ = libc.Int32FromInt32(0) type0 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) if type0 != int32(SQLITE_INTEGER) && type0 != int32(SQLITE_FLOAT) { return @@ -109870,7 +105129,6 @@ func _math2Func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var type0, type1 int32 var x uintptr _, _, _, _, _, _ = ans, type0, type1, v0, v1, x - _ = libc.Int32FromInt32(0) type0 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) if type0 != int32(SQLITE_INTEGER) && type0 != int32(SQLITE_FLOAT) { return @@ -109892,7 +105150,6 @@ func _math2Func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Implementation of 0-argument pi() function. // */ func _piFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _ = libc.Int32FromInt32(0) _ = argv Xsqlite3_result_double(tls, context, float64(3.141592653589793)) } @@ -109907,7 +105164,6 @@ func _signFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var x float64 _, _, _, _ = type0, x, v1, v2 _ = argc - _ = libc.Int32FromInt32(0) type0 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) if type0 != int32(SQLITE_INTEGER) && type0 != int32(SQLITE_FLOAT) { return @@ -109940,7 +105196,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), int32(libc.Uint32FromInt64(4400)/libc.Uint32FromInt64(40))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint32(libc.Uint32FromInt64(4400)/libc.Uint32FromInt64(40))) } /* @@ -109956,562 +105212,562 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { var _aBuiltinFunc = [110]TFuncDef{ 0: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row)), FzName: __ccgo_ts + 15451, }, 1: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_expr_compare)), FzName: __ccgo_ts + 15471, }, 2: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr)), FzName: __ccgo_ts + 15484, }, 3: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_affinity)), FzName: __ccgo_ts + 15502, }, 4: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15511, }, 5: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), FzName: __ccgo_ts + 15519, }, 6: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), FzName: __ccgo_ts + 15519, }, 7: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 15534, }, 8: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 15560, }, 9: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), FzName: __ccgo_ts + 15585, }, 10: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), FzName: __ccgo_ts + 15594, }, 11: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), FzName: __ccgo_ts + 15605, }, 12: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_sqlite_offset)), FzName: __ccgo_ts + 15612, }, 13: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), FzName: __ccgo_ts + 15626, }, 14: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), FzName: __ccgo_ts + 15626, }, 15: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(2)), FzName: __ccgo_ts + 15632, }, 16: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(2)), FzName: __ccgo_ts + 15632, }, 17: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(3)), FzName: __ccgo_ts + 15638, }, 18: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(3)), FzName: __ccgo_ts + 15638, }, 19: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15643, }, 20: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15643, }, 21: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FzName: __ccgo_ts + 15643, }, 22: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), FzName: __ccgo_ts + 15647, }, 23: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), FzName: __ccgo_ts + 15647, }, 24: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(libc.Int32FromInt32(1)), FzName: __ccgo_ts + 15647, }, 25: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), FzName: __ccgo_ts + 15651, }, 26: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), FzName: __ccgo_ts + 15658, }, 27: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), FzName: __ccgo_ts + 15666, }, 28: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), FzName: __ccgo_ts + 15673, }, 29: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15686, }, 30: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15692, }, 31: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15699, }, 32: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15706, }, 33: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15714, }, 34: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15719, }, 35: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15723, }, 36: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15723, }, 37: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15729, }, 38: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15735, }, 39: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15741, }, 40: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15745, }, 41: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15745, }, 42: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15751, }, 43: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15751, }, 44: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15758, }, 45: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15758, }, 46: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15758, }, 47: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FzName: __ccgo_ts + 15768, }, 48: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15775, }, 49: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15782, }, 50: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15793, }, 51: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 15800, }, 52: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 15815, }, 53: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15832, }, 54: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15843, }, 55: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15849, }, 56: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15867, }, 57: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15875, }, 58: { FnArg: int8(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15889, }, 59: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15897, }, 60: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15906, }, 61: { FnArg: int8(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15906, }, 62: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15913, }, 63: { FnArg: int8(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15913, }, 64: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), FzName: __ccgo_ts + 15923, }, 65: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), FzName: __ccgo_ts + 15927, }, 66: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), FzName: __ccgo_ts + 15933, }, 67: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FzName: __ccgo_ts + 15937, }, 68: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FzName: __ccgo_ts + 15937, }, 69: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), FzName: __ccgo_ts + 15943, }, 70: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), FzName: __ccgo_ts + 15943, }, 71: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), FzName: __ccgo_ts + 15956, }, 72: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), FzName: __ccgo_ts + 15967, }, 73: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), FzName: __ccgo_ts + 15446, }, 74: { FnArg: int8(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), FzName: __ccgo_ts + 15446, }, 75: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 6794, }, 76: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 6794, }, 77: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 15972, }, 78: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1235, }, 79: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1243, }, 80: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 15977, }, 81: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15983, }, 82: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), FzName: __ccgo_ts + 15986, }, 83: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), FzName: __ccgo_ts + 15990, }, 84: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(2)), FzName: __ccgo_ts + 15996, }, 85: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 15986, }, 86: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16001, }, 87: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16005, }, 88: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16009, }, 89: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16015, }, 90: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16019, }, 91: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16024, }, 92: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16029, }, 93: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16034, }, 94: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16040, }, 95: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16044, }, 96: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16048, }, 97: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16052, }, 98: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16057, }, 99: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16062, }, 100: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16067, }, 101: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16073, }, 102: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16079, }, 103: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16085, }, 104: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16090, }, 105: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16098, }, 106: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 16106, }, 107: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FzName: __ccgo_ts + 16109, }, 108: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FzName: __ccgo_ts + 6794, }, 109: { FnArg: int8(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_iif)), FzName: __ccgo_ts + 16114, }, @@ -110871,9 +106127,6 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey nCol = (*TFKey)(unsafe.Pointer(pFKey)).FnCol /* Number of columns in parent key */ zKey = (*(*TsColMap)(unsafe.Pointer(pFKey + 36))).FzCol /* Name of left-most parent key column */ /* The caller is responsible for zeroing output parameters. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If this is a non-composite (single column) foreign key, check if it ** maps to the INTEGER PRIMARY KEY of table pParent. If so, leave *ppIdx ** and *paiCol set to zero and return early. @@ -110900,8 +106153,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - _ = libc.Int32FromInt32(0) - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(nCol)*uint32(4))) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint32FromInt32(nCol)*uint32(4))) if !(aiCol != 0) { return int32(1) } @@ -110913,7 +106165,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey if !(pIdx != 0) { break } - if int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) == nCol && int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) != OE_None && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) { + if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) == nCol && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) != OE_None && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) { /* pIdx is a UNIQUE index (or a PRIMARY KEY) and has the right number ** of columns. If each indexed column corresponds to a foreign key ** column of pFKey, then this index is a winner. */ @@ -111046,7 +106298,7 @@ func _fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pId ** any are, then the constraint is considered satisfied. No need to ** search for a matching row in the parent table. */ if nIncr < 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_FkIfZero), int32((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), iOk) + _sqlite3VdbeAddOp2(tls, v, int32(OP_FkIfZero), libc.Int32FromUint8((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), iOk) } i = 0 for { @@ -111087,7 +106339,7 @@ func _fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pId } else { nCol = (*TFKey)(unsafe.Pointer(pFKey)).FnCol regTemp1 = _sqlite3GetTempRange(tls, pParse, nCol) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), iCur, int32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), iCur, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) i = 0 for { @@ -111120,8 +106372,6 @@ func _fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pId iChild = int32(_sqlite3TableColumnToStorage(tls, (*TFKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4))))) + int32(1) + regData iParent = int32(1) + regData iParent += int32(_sqlite3TableColumnToStorage(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpTable, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { /* The parent key is a composite key that includes the IPK column */ iParent = regData @@ -111145,13 +106395,12 @@ func _fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pId ** one row into the table, raise a constraint immediately instead of ** incrementing a counter. This is necessary as the VM code is being ** generated for will not open a statement transaction. */ - _ = libc.Int32FromInt32(0) _sqlite3HaltConstraint(tls, pParse, libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(3)<<libc.Int32FromInt32(8), int32(OE_Abort), uintptr(0), int8(-libc.Int32FromInt32(1)), uint8(P5_ConstraintFK)) } else { - if nIncr > 0 && int32((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred) == 0 { + if nIncr > 0 && libc.Int32FromUint8((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred) == 0 { _sqlite3MayAbort(tls, pParse) } - _sqlite3VdbeAddOp2(tls, v, int32(OP_FkCounter), int32((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), nIncr) + _sqlite3VdbeAddOp2(tls, v, int32(OP_FkCounter), libc.Int32FromUint8((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), nIncr) } _sqlite3VdbeResolveLabel(tls, v, iOk) _sqlite3VdbeAddOp1(tls, v, int32(OP_Close), iCur) @@ -111201,7 +106450,6 @@ func _exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iC _ = pExpr pExpr = _sqlite3Expr(tls, db, int32(TK_COLUMN), uintptr(0)) if pExpr != 0 { - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = pTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = iCursor (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = iCol @@ -111251,12 +106499,8 @@ func _fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pWhere = uintptr(0) /* Context used by sqlite3WhereXXX() */ iFkIfZero = 0 /* Address of OP_FkIfZero */ v = _sqlite3GetVdbe(tls, pParse) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if nIncr < 0 { - iFkIfZero = _sqlite3VdbeAddOp2(tls, v, int32(OP_FkIfZero), int32((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), 0) + iFkIfZero = _sqlite3VdbeAddOp2(tls, v, int32(OP_FkIfZero), libc.Int32FromUint8((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), 0) } /* Create an Expr object representing an SQL expression like: ** @@ -111284,7 +106528,6 @@ func _fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, v3 = (*(*TsColMap)(unsafe.Pointer(pFKey + 36))).FiFrom } iCol = int16(v3) - _ = libc.Int32FromInt32(0) zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol + uintptr(iCol)*12))).FzCnName pRight = _sqlite3Expr(tls, db, int32(TK_ID), zCol) pEq = _sqlite3PExpr(tls, pParse, int32(TK_EQ), pLeft, pRight) @@ -111315,14 +106558,12 @@ func _fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pNe = _sqlite3PExpr(tls, pParse, int32(TK_NE), pLeft1, pRight1) } else { pAll = uintptr(0) - _ = libc.Int32FromInt32(0) i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } iCol1 = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)) - _ = libc.Int32FromInt32(0) pLeft1 = _exprTableRegister(tls, pParse, pTab, regData, iCol1) pRight1 = _sqlite3Expr(tls, db, int32(TK_ID), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol1)*12))).FzCnName) pEq1 = _sqlite3PExpr(tls, pParse, int32(TK_IS), pLeft1, pRight1) @@ -111346,7 +106587,7 @@ func _fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, ** foreign key constraint counter. */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { pWInfo = _sqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), uintptr(0), uint16(0), 0) - _sqlite3VdbeAddOp2(tls, v, int32(OP_FkCounter), int32((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), nIncr) + _sqlite3VdbeAddOp2(tls, v, int32(OP_FkCounter), libc.Int32FromUint8((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), nIncr) if pWInfo != 0 { _sqlite3WhereEnd(tls, pWInfo) } @@ -111418,7 +106659,7 @@ func _sqlite3FkClearTriggerCache(tls *libc.TLS, db uintptr, iDb int32) { break } pTab = (*THashElem)(unsafe.Pointer(k)).Fdata - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { goto _1 } pFKey = (*(*struct { @@ -111470,11 +106711,10 @@ func _sqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint var iSkip int32 _, _, _, _ = db, iSkip, p, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM { + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM { iSkip = 0 v = _sqlite3GetVdbe(tls, pParse) - _ = libc.Int32FromInt32(0) /* VDBE has already been allocated */ - _ = libc.Int32FromInt32(0) + /* VDBE has already been allocated */ if _sqlite3FkReferences(tls, pTab) == uintptr(0) { p = (*(*struct { FaddColOffset int32 @@ -111594,7 +106834,7 @@ func _fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr return int32(1) } } else { - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { return int32(1) } } @@ -111630,8 +106870,7 @@ func _isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) (r int32) { pTop = v1 if (*TParse)(unsafe.Pointer(pTop)).FpTriggerPrg != 0 { p = (*TTriggerPrg)(unsafe.Pointer((*TParse)(unsafe.Pointer(pTop)).FpTriggerPrg)).FpTrigger - if p == *(*uintptr)(unsafe.Pointer(pFKey + 28)) && int32(*(*Tu8)(unsafe.Pointer(pFKey + 25))) == int32(OE_SetNull) || p == *(*uintptr)(unsafe.Pointer(pFKey + 28 + 1*4)) && int32(*(*Tu8)(unsafe.Pointer(pFKey + 25 + 1))) == int32(OE_SetNull) { - _ = libc.Int32FromInt32(0) + if p == *(*uintptr)(unsafe.Pointer(pFKey + 28)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pFKey + 25))) == int32(OE_SetNull) || p == *(*uintptr)(unsafe.Pointer(pFKey + 28 + 1*4)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pFKey + 25 + 1))) == int32(OE_SetNull) { return int32(1) } } @@ -111672,14 +106911,13 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, var _ /* pIdx at bp+12 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiCol, bIgnore, db, eAction, i, iDb, iFromCol, iJump, iReg, isIgnoreErrors, pFKey, pItem, pSrc, pTo, rcauth, v, zCol, zDb, v4, v6, v7 db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Name of database containing pTab */ - isIgnoreErrors = int32((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers) + isIgnoreErrors = libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers) /* Exactly one of regOld and regNew should be non-zero. */ - _ = libc.Int32FromInt32(0) /* If foreign-keys are disabled, this function is a no-op. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) == uint64(0) { return } - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { return } iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) @@ -111711,7 +106949,6 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, pTo = _sqlite3LocateTable(tls, pParse, uint32(0), (*TFKey)(unsafe.Pointer(pFKey)).FzTo, zDb) } if !(pTo != 0) || _sqlite3FkLocateIndex(tls, pParse, pTo, pFKey, bp, bp+4) != 0 { - _ = libc.Int32FromInt32(0) if !(isIgnoreErrors != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } @@ -111738,11 +106975,10 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, ; i++ } - _sqlite3VdbeAddOp2(tls, v, int32(OP_FkCounter), int32((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), -int32(1)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_FkCounter), libc.Int32FromUint8((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred), -int32(1)) } goto _1 } - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { aiCol = *(*uintptr)(unsafe.Pointer(bp + 4)) } else { @@ -111757,7 +106993,6 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, if *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = -int32(1) } - _ = libc.Int32FromInt32(0) /* Request permission to read the parent key columns. If the ** authorization callback returns SQLITE_IGNORE, behave as if any ** values read from the parent table are NULL. */ @@ -111817,7 +107052,6 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, goto _5 } if !((*TFKey)(unsafe.Pointer(pFKey)).FisDeferred != 0) && !((*Tsqlite3)(unsafe.Pointer(db)).Fflags&libc.Uint64FromInt32(SQLITE_DeferFKs) != 0) && !((*TParse)(unsafe.Pointer(pParse)).FpToplevel != 0) && !((*TParse)(unsafe.Pointer(pParse)).FisMultiWrite != 0) { - _ = libc.Int32FromInt32(0) /* Inserting a single row into a parent table cannot cause (or fix) ** an immediate foreign key violation. So do nothing in this case. */ goto _5 @@ -111828,7 +107062,6 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, } goto _5 } - _ = libc.Int32FromInt32(0) /* Create a SrcList structure containing the child table. We need the ** child table as a SrcList for sqlite3WhereBegin() */ pSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -111845,8 +107078,8 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, _fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 12)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 16)), regNew, -int32(1)) } if regOld != 0 { - eAction = int32(*(*Tu8)(unsafe.Pointer(pFKey + 25 + libc.BoolUintptr(aChange != uintptr(0))))) - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00008))<<libc.Int32FromInt32(32)) != 0 { + eAction = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pFKey + 25 + libc.BoolUintptr(aChange != uintptr(0))))) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00008))<<libc.Int32FromInt32(32)) != 0 { eAction = OE_None } _fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 12)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 16)), regOld, int32(1)) @@ -111898,7 +107131,7 @@ func _sqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) (r Tu32) { var _ /* pIdx at bp+0 */ uintptr _, _, _, _, _ = i, mask, p, v3, v6 mask = uint32(0) - if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM { + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM { p = (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -111939,10 +107172,9 @@ func _sqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) (r Tu32) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnKeyCol)) { break } - _ = libc.Int32FromInt32(0) if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaiColumn + uintptr(i)*2))) > int32(31) { v6 = uint32(0xffffffff) } else { @@ -111996,7 +107228,7 @@ func _sqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin _, _, _, _ = bHaveFK, eRet, p, v3 eRet = int32(1) /* Value to return if bHaveFK is true */ bHaveFK = 0 /* If FK processing is required */ - if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM { + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM { if !(aChange != 0) { /* A DELETE operation. Foreign key processing is required if the ** table in question is either the child or parent table for any @@ -112035,7 +107267,7 @@ func _sqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin break } if _fkParentIsModified(tls, pTab, p, aChange, chngRowid) != 0 { - if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&(uint64(libc.Int32FromInt32(0x00008))<<libc.Int32FromInt32(32)) == uint64(0) && int32(*(*Tu8)(unsafe.Pointer(p + 25 + 1))) != OE_None { + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00008))<<libc.Int32FromInt32(32)) == uint64(0) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p + 25 + 1))) != OE_None { return int32(2) } bHaveFK = int32(1) @@ -112100,8 +107332,8 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = action, db, i, iAction, iDb, iFromCol, nFrom, pCol, pDflt, pEq, pList, pNew, pRaise, pSelect, pSrc, pStep, pTrigger, pWhen, pWhere, zFrom, v2, v3, v4, v5, v6 db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Trigger definition to return */ iAction = libc.BoolInt32(pChanges != uintptr(0)) /* 1 for UPDATE, 0 for DELETE */ - action = int32(*(*Tu8)(unsafe.Pointer(pFKey + 25 + uintptr(iAction)))) - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00008))<<libc.Int32FromInt32(32)) != 0 { + action = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pFKey + 25 + uintptr(iAction)))) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00008))<<libc.Int32FromInt32(32)) != 0 { action = OE_None } if action == int32(OE_Restrict) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { @@ -112119,7 +107351,6 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr if _sqlite3FkLocateIndex(tls, pParse, pTab, pFKey, bp, bp+4) != 0 { return uintptr(0) } - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TFKey)(unsafe.Pointer(pFKey)).FnCol) { @@ -112139,9 +107370,6 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr v2 = (*(*TsColMap)(unsafe.Pointer(pFKey + 36))).FiFrom } iFromCol = v2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v3 = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaiColumn + uintptr(i)*2))) } else { @@ -112170,7 +107398,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr } else { if action == int32(OE_SetDflt) { pCol = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol + uintptr(iFromCol)*12 - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { pDflt = uintptr(0) } else { pDflt = _sqlite3ColumnExpr(tls, (*TFKey)(unsafe.Pointer(pFKey)).FpFrom, pCol) @@ -112203,7 +107431,6 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr } pSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if pSrc != 0 { - _ = libc.Int32FromInt32(0) (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = _sqlite3DbStrDup(tls, db, zFrom) (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzDatabase = _sqlite3DbStrDup(tls, db, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) } @@ -112213,13 +107440,13 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt64(36)+libc.Uint32FromInt64(48)+uint32(nFrom)+uint32(1))) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt64(36)+libc.Uint32FromInt64(48)+libc.Uint32FromInt32(nFrom)+uint32(1))) if pTrigger != 0 { v4 = pTrigger + 1*36 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 pStep = v4 (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget = pStep + 1*48 - libc.Xmemcpy(tls, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget, zFrom, uint32(nFrom)) + libc.Xmemcpy(tls, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget, zFrom, libc.Uint32FromInt32(nFrom)) (*TTriggerStep)(unsafe.Pointer(pStep)).FpWhere = _sqlite3ExprDup(tls, db, pWhere, int32(EXPRDUP_REDUCE)) (*TTriggerStep)(unsafe.Pointer(pStep)).FpExprList = _sqlite3ExprListDup(tls, db, pList, int32(EXPRDUP_REDUCE)) (*TTriggerStep)(unsafe.Pointer(pStep)).FpSelect = _sqlite3SelectDup(tls, db, pSelect, int32(EXPRDUP_REDUCE)) @@ -112233,19 +107460,17 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr if (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 { v5 = 0 } else { - v5 = int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) + v5 = libc.Int32FromUint16((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(v5) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = libc.Uint16FromInt32(v5) _sqlite3ExprDelete(tls, db, pWhere) _sqlite3ExprDelete(tls, db, pWhen) _sqlite3ExprListDelete(tls, db, pList) _sqlite3SelectDelete(tls, db, pSelect) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == int32(1) { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == int32(1) { _fkTriggerDelete(tls, db, pTrigger) return uintptr(0) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) switch action { case int32(OE_Restrict): (*TTriggerStep)(unsafe.Pointer(pStep)).Fop = uint8(TK_SELECT) @@ -112267,7 +107492,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr } else { v6 = int32(TK_DELETE) } - (*TTrigger)(unsafe.Pointer(pTrigger)).Fop = uint8(v6) + (*TTrigger)(unsafe.Pointer(pTrigger)).Fop = libc.Uint8FromInt32(v6) } return pTrigger } @@ -112315,8 +107540,6 @@ func _sqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uin func _sqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { var pFKey, pNext, z, v2 uintptr _, _, _, _ = pFKey, pNext, z, v2 /* Copy of pFKey->pNextFrom */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pFKey = (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -112326,7 +107549,6 @@ func _sqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { if !(pFKey != 0) { break } - _ = libc.Int32FromInt32(0) /* Remove the FK from the fkeyHash hash table. */ if (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) { if (*TFKey)(unsafe.Pointer(pFKey)).FpPrevTo != 0 { @@ -112347,7 +107569,6 @@ func _sqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* EV: R-30323-21917 Each foreign key constraint in SQLite is ** classified as either immediate or deferred. */ - _ = libc.Int32FromInt32(0) /* Delete any triggers created to implement actions for this FK. */ _fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer(pFKey + 28))) _fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer(pFKey + 28 + 1*4))) @@ -112393,25 +107614,20 @@ func _sqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTa var pPk, v uintptr var v1 int32 _, _, _ = pPk, v, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FnoSharedCache != 0) { if opcode == int32(OP_OpenWrite) { v1 = int32(1) } else { v1 = 0 } - _sqlite3TableLock(tls, pParse, iDb, (*TTable)(unsafe.Pointer(pTab)).Ftnum, uint8(v1), (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3TableLock(tls, pParse, iDb, (*TTable)(unsafe.Pointer(pTab)).Ftnum, libc.Uint8FromInt32(v1), (*TTable)(unsafe.Pointer(pTab)).FzName) } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - _sqlite3VdbeAddOp4Int(tls, v, opcode, iCur, int32((*TTable)(unsafe.Pointer(pTab)).Ftnum), iDb, int32((*TTable)(unsafe.Pointer(pTab)).FnNVCol)) + _sqlite3VdbeAddOp4Int(tls, v, opcode, iCur, libc.Int32FromUint32((*TTable)(unsafe.Pointer(pTab)).Ftnum), iDb, int32((*TTable)(unsafe.Pointer(pTab)).FnNVCol)) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _sqlite3VdbeAddOp3(tls, v, opcode, iCur, int32((*TIndex)(unsafe.Pointer(pPk)).Ftnum), iDb) + _sqlite3VdbeAddOp3(tls, v, opcode, iCur, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pPk)).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk) } } @@ -112445,14 +107661,14 @@ func _computeIndexAffStr(tls *libc.TLS, db uintptr, pIdx uintptr) (r uintptr) { var x Ti16 _, _, _, _ = aff, n, pTab, x pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - (*TIndex)(unsafe.Pointer(pIdx)).FzColAff = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)+int32(1))) + (*TIndex)(unsafe.Pointer(pIdx)).FzColAff = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)+int32(1))) if !((*TIndex)(unsafe.Pointer(pIdx)).FzColAff != 0) { _sqlite3OomFault(tls, db) return uintptr(0) } n = 0 for { - if !(n < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { + if !(n < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } x = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) @@ -112462,9 +107678,6 @@ func _computeIndexAffStr(tls *libc.TLS, db uintptr, pIdx uintptr) (r uintptr) { if int32(x) == -int32(1) { aff = int8(SQLITE_AFF_INTEGER) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) aff = _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(n)*20))).FpExpr) } } @@ -112502,7 +107715,7 @@ func _sqlite3TableAffinityStr(tls *libc.TLS, db uintptr, pTab uintptr) (r uintpt var i, j, v2, v3, v4 int32 var zColAff uintptr _, _, _, _, _, _ = i, j, zColAff, v2, v3, v4 - zColAff = _sqlite3DbMallocRaw(tls, db, uint64(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(1))) + zColAff = _sqlite3DbMallocRaw(tls, db, libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(1))) if zColAff != 0 { v2 = libc.Int32FromInt32(0) j = v2 @@ -112511,7 +107724,7 @@ func _sqlite3TableAffinityStr(tls *libc.TLS, db uintptr, pTab uintptr) (r uintpt if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { v3 = j j++ *(*int8)(unsafe.Pointer(zColAff + uintptr(v3))) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).Faffinity @@ -112580,8 +107793,6 @@ func _sqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { if iReg == 0 { _sqlite3VdbeAppendP4(tls, v, pTab, -int32(5)) pPrev = _sqlite3VdbeGetLastOp(tls, v) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TVdbeOp)(unsafe.Pointer(pPrev)).Fopcode = uint8(OP_TypeCheck) _sqlite3VdbeAddOp3(tls, v, int32(OP_MakeRecord), (*TVdbeOp)(unsafe.Pointer(pPrev)).Fp1, (*TVdbeOp)(unsafe.Pointer(pPrev)).Fp2, (*TVdbeOp)(unsafe.Pointer(pPrev)).Fp3) } else { @@ -112600,13 +107811,11 @@ func _sqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { } (*TTable)(unsafe.Pointer(pTab)).FzColAff = zColAff } - _ = libc.Int32FromInt32(0) - i = int32(libc.Xstrlen(tls, zColAff) & libc.Uint32FromInt32(0x3fffffff)) + i = libc.Int32FromUint32(libc.Xstrlen(tls, zColAff) & libc.Uint32FromInt32(0x3fffffff)) if i != 0 { if iReg != 0 { _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), iReg, i, 0, zColAff, i) } else { - _ = libc.Int32FromInt32(0) _sqlite3VdbeChangeP4(tls, v, -int32(1), zColAff, i) } } @@ -112627,7 +107836,7 @@ func _readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) (r int32) { _, _, _, _, _, _, _, _ = i, iEnd, pIndex, pOp, pVTab, tnum, v, v1 v = _sqlite3GetVdbe(tls, p) iEnd = _sqlite3VdbeCurrentAddr(tls, v) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { v1 = _sqlite3GetVTable(tls, (*TParse)(unsafe.Pointer(p)).Fdb, pTab) } else { v1 = uintptr(0) @@ -112639,9 +107848,8 @@ func _readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) (r int32) { break } pOp = _sqlite3VdbeGetOp(tls, v, i) - _ = libc.Int32FromInt32(0) - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_OpenRead) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 == iDb { - tnum = uint32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp2) + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_OpenRead) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 == iDb { + tnum = libc.Uint32FromInt32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp2) if tnum == (*TTable)(unsafe.Pointer(pTab)).Ftnum { return int32(1) } @@ -112659,9 +107867,7 @@ func _readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) (r int32) { pIndex = (*TIndex)(unsafe.Pointer(pIndex)).FpNext } } - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_VOpen) && *(*uintptr)(unsafe.Pointer(pOp + 16)) == pVTab { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_VOpen) && *(*uintptr)(unsafe.Pointer(pOp + 16)) == pVTab { return int32(1) } goto _2 @@ -112680,10 +107886,9 @@ func _readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) (r int32) { func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { var p1 uintptr _ = p1 - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 20 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | int32((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*12))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*12))).FcolFlags)) } return WRC_Continue } @@ -112704,17 +107909,14 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in var pCol, pOp, pRedo, zP4, p4, p6, p7, p8 uintptr var _ /* w at bp+0 */ TWalker _, _, _, _, _, _, _, _, _, _, _, _, _, _ = eProgress, i, ii, jj, pCol, pOp, pRedo, x, zP4, v2, p4, p6, p7, p8 - _ = libc.Int32FromInt32(0) /* Before computing generated columns, first go through and make sure ** that appropriate affinity has been applied to the regular columns */ _sqlite3TableAffinity(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iRegStore) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasStored) != uint32(0) { pOp = _sqlite3VdbeGetLastOp(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe) - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Affinity) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Affinity) { zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v2 = libc.Int32FromInt32(0) jj = v2 ii = v2 @@ -112722,10 +107924,10 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in if !(*(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) != 0) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(ii)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(ii)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { goto _1 } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(ii)*12))).FcolFlags)&int32(COLFLAG_STORED) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(ii)*12))).FcolFlags)&int32(COLFLAG_STORED) != 0 { *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = int8(SQLITE_AFF_NONE) } jj++ @@ -112735,7 +107937,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in ii++ } } else { - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_TypeCheck) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_TypeCheck) { /* If an OP_TypeCheck was generated because the table is STRICT, ** then set the P3 operand to indicate that generated columns should ** not be checked */ @@ -112752,7 +107954,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { p4 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12 + 10 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_NOTAVAIL)) } @@ -112780,19 +107982,18 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in break } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12 - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_NOTAVAIL) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_NOTAVAIL) != 0 { p6 = pCol + 10 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(COLFLAG_BUSY)) (*(*TWalker)(unsafe.Pointer(bp))).FeCode = uint16(0) _sqlite3WalkExpr(tls, bp, _sqlite3ColumnExpr(tls, pTab, pCol)) p7 = pCol + 10 *(*Tu16)(unsafe.Pointer(p7)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p7))) & ^libc.Int32FromInt32(COLFLAG_BUSY)) - if int32((*(*TWalker)(unsafe.Pointer(bp))).FeCode)&int32(COLFLAG_NOTAVAIL) != 0 { + if libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode)&int32(COLFLAG_NOTAVAIL) != 0 { pRedo = pCol goto _5 } eProgress = int32(1) - _ = libc.Int32FromInt32(0) x = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(i))) + iRegStore _sqlite3ExprCodeGeneratedColumn(tls, pParse, pTab, pCol, x) p8 = pCol + 10 @@ -112840,7 +108041,6 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in var pInfo, pSeqTab, pToplevel, v1, v3 uintptr _, _, _, _, _, _, _ = memId, pInfo, pSeqTab, pToplevel, v1, v2, v3 memId = 0 /* Register holding maximum rowid */ - _ = libc.Int32FromInt32(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) { if (*TParse)(unsafe.Pointer(pParse)).FpToplevel != 0 { v1 = (*TParse)(unsafe.Pointer(pParse)).FpToplevel @@ -112852,7 +108052,7 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in /* Verify that the sqlite_sequence table exists and is an ordinary ** rowid table with exactly two columns. ** Ticket d8dc2b3a58cd5dc2918a1d4acb 2018-05-23 */ - if pSeqTab == uintptr(0) || !((*TTable)(unsafe.Pointer(pSeqTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) || int32((*TTable)(unsafe.Pointer(pSeqTab)).FeTabType) == int32(TABTYP_VTAB) || int32((*TTable)(unsafe.Pointer(pSeqTab)).FnCol) != int32(2) { + if pSeqTab == uintptr(0) || !((*TTable)(unsafe.Pointer(pSeqTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) || libc.Int32FromUint8((*TTable)(unsafe.Pointer(pSeqTab)).FeTabType) == int32(TABTYP_VTAB) || int32((*TTable)(unsafe.Pointer(pSeqTab)).FnCol) != int32(2) { (*TParse)(unsafe.Pointer(pParse)).FnErr++ (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) return 0 @@ -112897,9 +108097,7 @@ func _sqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* VDBE under construction */ /* This routine is never called during trigger-generation. It is ** only called from the top-level */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* We failed long ago if this is not so */ + /* We failed long ago if this is not so */ p = (*TParse)(unsafe.Pointer(pParse)).FpAinc for { if !(p != 0) { @@ -112907,10 +108105,9 @@ func _sqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TAutoincInfo)(unsafe.Pointer(p)).FiDb)*16 memId = (*TAutoincInfo)(unsafe.Pointer(p)).FregCtr - _ = libc.Int32FromInt32(0) _sqlite3OpenTable(tls, pParse, 0, (*TAutoincInfo)(unsafe.Pointer(p)).FiDb, (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab, int32(OP_OpenRead)) _sqlite3VdbeLoadString(tls, v, memId-int32(1), (*TTable)(unsafe.Pointer((*TAutoincInfo)(unsafe.Pointer(p)).FpTab)).FzName) - aOp = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint32FromInt64(48)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_autoInc)), _iLn1) + aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(48)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_autoInc)), _iLn1) if aOp == uintptr(0) { break } @@ -113013,7 +108210,6 @@ func _autoIncrementEnd(tls *libc.TLS, pParse uintptr) { _, _, _, _, _, _, _ = aOp, db, iRec, memId, p, pDb, v v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) p = (*TParse)(unsafe.Pointer(pParse)).FpAinc for { if !(p != 0) { @@ -113022,10 +108218,9 @@ func _autoIncrementEnd(tls *libc.TLS, pParse uintptr) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*TAutoincInfo)(unsafe.Pointer(p)).FiDb)*16 memId = (*TAutoincInfo)(unsafe.Pointer(p)).FregCtr iRec = _sqlite3GetTempReg(tls, pParse) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_Le), memId+int32(2), _sqlite3VdbeCurrentAddr(tls, v)+int32(7), memId) _sqlite3OpenTable(tls, pParse, 0, (*TAutoincInfo)(unsafe.Pointer(p)).FiDb, (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab, int32(OP_OpenWrite)) - aOp = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint32FromInt64(20)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_autoIncEnd)), _iLn2) + aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(20)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_autoIncEnd)), _iLn2) if aOp == uintptr(0) { break } @@ -113133,8 +108328,6 @@ func _exprListIsNoAffinity(tls *libc.TLS, pParse uintptr, pRow uintptr) (r int32 break } pExpr = (*(*TExprList_item)(unsafe.Pointer(pRow + 8 + uintptr(ii)*20))).FpExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if 0 != int32(_sqlite3ExprAffinity(tls, pExpr)) { return 0 } @@ -113206,7 +108399,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _ = f, p, pRet, pSelect, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -113216,11 +108409,11 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } else { if (*TSelect)(unsafe.Pointer(pLeft)).FpPrior != 0 { /* In this case set the SF_MultiValue flag only if it was set on pLeft */ - f = int32(uint32(f) & (*TSelect)(unsafe.Pointer(pLeft)).FselFlags) + f = libc.Int32FromUint32(libc.Uint32FromInt32(f) & (*TSelect)(unsafe.Pointer(pLeft)).FselFlags) } } - pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= uint32(^libc.Int32FromInt32(SF_MultiValue)) + pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -113243,10 +108436,11 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pRet)).FpSrc)).FnSrc = int32(1) (*TSelect)(unsafe.Pointer(pRet)).FpPrior = (*TSelect)(unsafe.Pointer(pLeft)).FpPrior (*TSelect)(unsafe.Pointer(pRet)).Fop = (*TSelect)(unsafe.Pointer(pLeft)).Fop + if (*TSelect)(unsafe.Pointer(pRet)).FpPrior != 0 { + *(*Tu32)(unsafe.Pointer(pRet + 4)) |= uint32(SF_Values) + } (*TSelect)(unsafe.Pointer(pLeft)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pLeft)).Fop = uint8(TK_SELECT) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p = (*TSelect)(unsafe.Pointer(pRet)).FpSrc + 8 (*TSrcItem)(unsafe.Pointer(p)).FpSelect = pLeft libc.SetBitFieldPtr16Uint32(p+36+4, libc.Uint32FromInt32(1), 5, 0x20) @@ -113270,16 +108464,13 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSrcItem)(unsafe.Pointer(p)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst - _ = libc.Int32FromInt32(0) pLeft = pRet } } else { p = (*TSelect)(unsafe.Pointer(pLeft)).FpSrc + 8 - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(p + 60))++ } if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - _ = libc.Int32FromInt32(0) if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p)).FpSelect)).FpEList)).FnExpr != (*TExprList)(unsafe.Pointer(pRow)).FnExpr { _sqlite3SelectWrongNumTermsError(tls, pParse, (*TSrcItem)(unsafe.Pointer(p)).FpSelect) } else { @@ -113421,11 +108612,9 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin regRowCount = 0 /* register holding first column to insert */ aRegIdx = uintptr(0) /* Mask of trigger times */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto insert_cleanup } - _ = libc.Int32FromInt32(0) (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = 0 /* Suppress a harmless compiler warning */ /* If the Select object is really just a simple VALUES() list with a ** single row (the common case) then keep that one row of values @@ -113439,13 +108628,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin } /* Locate the table into which we will be inserting new information. */ - _ = libc.Int32FromInt32(0) pTab = _sqlite3SrcListLookup(tls, pParse, pTabList) if pTab == uintptr(0) { goto insert_cleanup } iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _ = libc.Int32FromInt32(0) if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), (*TTable)(unsafe.Pointer(pTab)).FzName, uintptr(0), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) != 0 { goto insert_cleanup } @@ -113454,8 +108641,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** inserted into is a view */ pTrigger = _sqlite3TriggersExist(tls, pParse, pTab, int32(TK_INSERT), uintptr(0), bp+36) - isView = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW)) - _ = libc.Int32FromInt32(0) + isView = libc.BoolInt32(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW)) /* If pTab is really a view, make sure it has been initialized. ** ViewGetColumnNames() is a no-op if pTab is not a view. */ @@ -113473,7 +108659,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if v == uintptr(0) { goto insert_cleanup } - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 { _sqlite3VdbeCountChanges(tls, v) } _sqlite3BeginWriteOperation(tls, pParse, libc.BoolInt32(pSelect != 0 || pTrigger != 0), iDb) @@ -113487,8 +108673,6 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** This is the 2nd template. */ if pColumn == uintptr(0) && pSelect != uintptr(0) && pTrigger == uintptr(0) && _xferOptimization(tls, pParse, pTab, pSelect, onError, iDb) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto insert_end } /* If this is an AUTOINCREMENT table, look up the sequence number in the @@ -113502,7 +108686,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin regIns = v1 regRowid = v1 *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ } @@ -113526,9 +108710,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** columns into storage order. False negatives are harmless, ** but false positives will cause database corruption. */ - bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) + bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - _ = libc.Int32FromInt32(0) (*TIdList)(unsafe.Pointer(pColumn)).FeU4 = uint8(EU4_IDX) i = 0 for { @@ -113558,9 +108741,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin } if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { ipkColumn = i - _ = libc.Int32FromInt32(0) } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16163, libc.VaList(bp+88, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) goto insert_cleanup } @@ -113602,7 +108784,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { v5 = int32(1) } else { v5 = 0 @@ -113626,14 +108808,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst - _ = libc.Int32FromInt32(0) if rc != 0 || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto insert_cleanup } - _ = libc.Int32FromInt32(0) _sqlite3VdbeEndCoroutine(tls, v, regYield) _sqlite3VdbeJumpHere(tls, v, addrTop-int32(1)) /* label B: */ - _ = libc.Int32FromInt32(0) nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpEList)).FnExpr } /* Set useTempTable to TRUE if the result of the SELECT statement @@ -113669,7 +108848,6 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin libc.Xmemset(tls, bp+40, 0, uint32(36)) (*(*TNameContext)(unsafe.Pointer(bp + 40))).FpParse = pParse srcTab = -int32(1) - _ = libc.Int32FromInt32(0) if pList != 0 { nColumn = (*TExprList)(unsafe.Pointer(pList)).FnExpr if _sqlite3ResolveExprListNames(tls, bp+40, pList) != 0 { @@ -113691,7 +108869,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i >= 0) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } goto _11 @@ -113703,16 +108881,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* Make sure the number of columns in the source data matches the number ** of columns to be inserted into the table. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(libc.Int32FromInt32(TF_HasGenerated)|libc.Int32FromInt32(TF_HasHidden)) != uint32(0) { + if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_HasGenerated)|libc.Int32FromInt32(TF_HasHidden)) != uint32(0) { i = 0 for { if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } goto _12 @@ -113732,7 +108907,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin } /* Initialize the count of rows to be inserted */ - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { v14 = pParse + 44 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) @@ -113742,7 +108917,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* If this is not a view, open the table and and all indices */ if !(isView != 0) { nIdx = _sqlite3OpenTableAndIndices(tls, pParse, pTab, int32(OP_OpenWrite), uint8(0), -int32(1), uintptr(0), bp, bp+4) - aRegIdx = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*uint32(nIdx+libc.Int32FromInt32(2)))) + aRegIdx = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*libc.Uint32FromInt32(nIdx+libc.Int32FromInt32(2)))) if aRegIdx == uintptr(0) { goto insert_cleanup } @@ -113752,12 +108927,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < nIdx) { break } - _ = libc.Int32FromInt32(0) v17 = pParse + 44 *(*int32)(unsafe.Pointer(v17))++ v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = v16 - *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 44)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) goto _15 _15: ; @@ -113770,11 +108944,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = v18 /* Register to store the table record */ } if pUpsert != 0 { - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16321, libc.VaList(bp+88, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto insert_cleanup } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16367, 0) goto insert_cleanup } @@ -113839,13 +109013,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ nHidden = 0 iRegStore = regData - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - _ = libc.Int32FromInt32(0) if i == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { /* tag-20191021-002: References to the INTEGER PRIMARY KEY are filled ** using the rowid. So put a NULL in the IPK slot of the record to avoid @@ -113885,7 +109057,6 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin } } if pColumn != 0 { - _ = libc.Int32FromInt32(0) j = 0 for { if !(j < (*TIdList)(unsafe.Pointer(pColumn)).FnId && *(*int32)(unsafe.Pointer(pColumn + 8 + uintptr(j)*8 + 4)) != i) { @@ -113923,7 +109094,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin pX = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(k)*20))).FpExpr y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { - if (*TExpr)(unsafe.Pointer(pX)).Fflags&uint32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { v24 = int32(OP_Copy) } else { v24 = int32(OP_SCopy) @@ -113952,11 +109123,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if ipkColumn < 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), -int32(1), regCols) } else { - _ = libc.Int32FromInt32(0) if useTempTable != 0 { _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), srcTab, ipkColumn, regCols) } else { - _ = libc.Int32FromInt32(0) /* Otherwise useTempTable is true */ + /* Otherwise useTempTable is true */ _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ipkColumn)*20))).FpExpr, regCols) } addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_NotNull), regCols) @@ -113965,7 +109135,6 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VdbeAddOp1(tls, v, int32(OP_MustBeInt), regCols) } /* Copy the new data already generated. */ - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_Copy), regRowid+int32(1), regCols+int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnNVCol)-int32(1)) /* Compute the new value for generated columns after all other ** columns have already been computed. This must be done after @@ -113987,7 +109156,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3ReleaseTempRange(tls, pParse, regCols, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(1)) } if !(isView != 0) { - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { /* The row that the VUpdate opcode will delete: none */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIns) } @@ -114000,7 +109169,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* Rowid already initialized at tag-20191021-001 */ } else { pIpk = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ipkColumn)*20))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pIpk)).Fop) == int32(TK_NULL) && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pIpk)).Fop) == int32(TK_NULL) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _sqlite3VdbeAddOp3(tls, v, int32(OP_NewRowid), *(*int32)(unsafe.Pointer(bp)), regRowid, regAutoinc) appendFlag = uint8(1) } else { @@ -114012,7 +109181,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** to generate a unique primary key value. */ if !(appendFlag != 0) { - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { addr11 = _sqlite3VdbeAddOp1(tls, v, int32(OP_NotNull), regRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_NewRowid), *(*int32)(unsafe.Pointer(bp)), regRowid, regAutoinc) _sqlite3VdbeJumpHere(tls, v, addr11) @@ -114023,7 +109192,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VdbeAddOp1(tls, v, int32(OP_MustBeInt), regRowid) } } else { - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) || withoutRowid != 0 { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) || withoutRowid != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowid) } else { _sqlite3VdbeAddOp3(tls, v, int32(OP_NewRowid), *(*int32)(unsafe.Pointer(bp)), regRowid, regAutoinc) @@ -114041,7 +109210,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* Generate code to check constraints and generate index keys and ** do the insertion. */ - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { pVTab = _sqlite3GetVTable(tls, db, pTab) _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) @@ -114050,11 +109219,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin } else { v25 = onError } - _sqlite3VdbeChangeP5(tls, v, uint16(v25)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v25)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 76)) = 0 /* True to use OPFLAG_SEEKRESULT */ - _sqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), regIns, 0, libc.BoolUint8(ipkColumn >= 0), uint8(onError), endOfLoop, bp+76, uintptr(0), pUpsert) + _sqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), regIns, 0, libc.BoolUint8(ipkColumn >= 0), libc.Uint8FromInt32(onError), endOfLoop, bp+76, uintptr(0), pUpsert) if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 { _sqlite3FkCheck(tls, pParse, pTab, 0, regIns, uintptr(0), 0) } @@ -114067,7 +109236,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** VdbeCursor.seekResult variable, disabling the OPFLAG_USESEEKRESULT ** functionality. */ bUseSeek = libc.BoolInt32(*(*int32)(unsafe.Pointer(bp + 76)) == 0 || !(_sqlite3VdbeHasSubProgram(tls, v) != 0)) - _sqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), regIns, aRegIdx, 0, int32(appendFlag), bUseSeek) + _sqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), regIns, aRegIdx, 0, libc.Int32FromUint8(appendFlag), bUseSeek) } } /* Update the count of rows that are inserted @@ -114100,7 +109269,7 @@ insert_end: ** maximum rowid counter values recorded while inserting into ** autoincrement tables. */ - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0) { _sqlite3AutoincrementEnd(tls, pParse) } /* @@ -114143,8 +109312,7 @@ insert_cleanup: func _checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { var p1, p2 uintptr _, _ = p1, p2 - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) { if int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { if *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)) + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*4)) >= 0 { p1 = pWalker + 20 @@ -114190,7 +109358,7 @@ func _sqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng ui p1 = bp + 20 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(CKCNSTRNT_ROWID)) } - return libc.BoolInt32(int32((*(*TWalker)(unsafe.Pointer(bp))).FeCode) != 0) + return libc.BoolInt32(libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode) != 0) } // C documentation @@ -114261,7 +109429,6 @@ type IndexListTerm1 = TIndexListTerm1 // // /* Return the first index on the list */ func _indexIteratorFirst(tls *libc.TLS, pIter uintptr, pIx uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) if (*TIndexIterator)(unsafe.Pointer(pIter)).FeType != 0 { *(*int32)(unsafe.Pointer(pIx)) = (*(*TIndexListTerm)(unsafe.Pointer((*(*struct { FnIdx int32 @@ -114431,8 +109598,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt isUpdate = libc.BoolUint8(regOldData != 0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* This table is not a VIEW */ + /* This table is not a VIEW */ nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) /* pPk is the PRIMARY KEY index for WITHOUT ROWID tables and NULL for ** normal rowid tables. nPkField is the number of key fields in the @@ -114443,7 +109609,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt nPkField = int32(1) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - nPkField = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) + nPkField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } /* Record that this module has started */ /* Test all NOT NULL constraints. @@ -114466,7 +109632,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if i == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _1 /* ROWID is never NULL */ } - isGenerated = int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags) & int32(COLFLAG_GENERATED) + isGenerated = libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags) & int32(COLFLAG_GENERATED) if isGenerated != 0 && !(b2ndPass != 0) { nGenerated++ goto _1 /* Generated columns processed on 2nd pass */ @@ -114475,30 +109641,27 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt /* Do not check NOT NULL on columns that do not change */ goto _1 } - if int32(overrideError) != int32(OE_Default) { - onError = int32(overrideError) + if libc.Int32FromUint8(overrideError) != int32(OE_Default) { + onError = libc.Int32FromUint8(overrideError) } else { if onError == int32(OE_Default) { onError = int32(OE_Abort) } } if onError == int32(OE_Replace) { - if b2ndPass != 0 || int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt) == 0 { + if b2ndPass != 0 || libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) == 0 { onError = int32(OE_Abort) } else { - _ = libc.Int32FromInt32(0) } } else { if b2ndPass != 0 && !(isGenerated != 0) { goto _1 } } - _ = libc.Int32FromInt32(0) iReg = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(i))) + regNewData + int32(1) switch onError { case int32(OE_Replace): addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_NotNull), iReg) - _ = libc.Int32FromInt32(0) nSeenReplace++ _sqlite3ExprCodeCopy(tls, pParse, _sqlite3ColumnExpr(tls, pTab, pCol), iReg) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -114513,7 +109676,6 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt _sqlite3VdbeAppendP4(tls, v, zMsg, -int32(6)) _sqlite3VdbeChangeP5(tls, v, uint16(P5_ConstraintNotNull)) default: - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), iReg, ignoreDest) break } /* end switch(onError) */ @@ -114546,8 +109708,8 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if (*TTable)(unsafe.Pointer(pTab)).FpCheck != 0 && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_IgnoreChecks) == uint64(0) { pCheck = (*TTable)(unsafe.Pointer(pTab)).FpCheck (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + int32(1)) - if int32(overrideError) != int32(OE_Default) { - v2 = int32(overrideError) + if libc.Int32FromUint8(overrideError) != int32(OE_Default) { + v2 = libc.Int32FromUint8(overrideError) } else { v2 = int32(OE_Abort) } @@ -114558,12 +109720,12 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt break } pExpr = (*(*TExprList_item)(unsafe.Pointer(pCheck + 8 + uintptr(i)*20))).FpExpr - if aiChng != 0 && !(_sqlite3ExprReferencesUpdatedColumn(tls, pExpr, aiChng, int32(pkChng)) != 0) { + if aiChng != 0 && !(_sqlite3ExprReferencesUpdatedColumn(tls, pExpr, aiChng, libc.Int32FromUint8(pkChng)) != 0) { /* The check constraints do not reference any of the columns being ** updated so there is no point it verifying the check constraint */ goto _3 } - if int32(bAffinityDone) == 0 { + if libc.Int32FromUint8(bAffinityDone) == 0 { _sqlite3TableAffinity(tls, v, pTab, regNewData+int32(1)) bAffinityDone = uint8(1) } @@ -114577,7 +109739,6 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt _sqlite3VdbeGoto(tls, v, ignoreDest) } else { zName = (*(*TExprList_item)(unsafe.Pointer(pCheck + 8 + uintptr(i)*20))).FzEName - _ = libc.Int32FromInt32(0) if onError == int32(OE_Replace) { onError = int32(OE_Abort) } /* IMP: R-26383-51744 */ @@ -114626,8 +109787,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if pUpsert != 0 { if (*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget == uintptr(0) { /* There is just on ON CONFLICT clause and it has no constraint-target */ - _ = libc.Int32FromInt32(0) - if int32((*TUpsert)(unsafe.Pointer(pUpsert)).FisDoUpdate) == 0 { + if libc.Int32FromUint8((*TUpsert)(unsafe.Pointer(pUpsert)).FisDoUpdate) == 0 { /* A single ON CONFLICT DO NOTHING clause, without a constraint-target. ** Make all unique constraint resolution be OE_Ignore */ overrideError = uint8(OE_Ignore) @@ -114644,7 +109804,6 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if !(pIdx != 0) { break } - _ = libc.Int32FromInt32(0) goto _4 _4: ; @@ -114653,7 +109812,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } (*(*TIndexIterator)(unsafe.Pointer(bp + 4))).FeType = int32(1) *(*int32)(unsafe.Pointer(bp + 4 + 8)) = nIdx - nByte = uint64((libc.Uint32FromInt64(8)+libc.Uint32FromInt32(1))*uint32(nIdx) + uint32(nIdx)) + nByte = uint64((libc.Uint32FromInt64(8)+libc.Uint32FromInt32(1))*libc.Uint32FromInt32(nIdx) + libc.Uint32FromInt32(nIdx)) *(*uintptr)(unsafe.Pointer(bp + 4 + 8 + 4)) = _sqlite3DbMallocZero(tls, db, nByte) if *(*uintptr)(unsafe.Pointer(bp + 4 + 8 + 4)) == uintptr(0) { return @@ -114708,7 +109867,6 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext jj++ } - _ = libc.Int32FromInt32(0) } } } @@ -114732,7 +109890,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt ** used to link together these tests which are separated from each other ** in the generate bytecode. */ - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(libc.Int32FromInt32(SQLITE_RecTriggers)|libc.Int32FromInt32(SQLITE_ForeignKeys)) == uint64(0) { + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_RecTriggers)|libc.Int32FromInt32(SQLITE_ForeignKeys)) == uint64(0) { /* There are not DELETE triggers nor FK constraints. No constraint ** rechecks are needed. */ pTrigger = uintptr(0) @@ -114763,9 +109921,9 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if pkChng != 0 && pPk == uintptr(0) { addrRowidOk = _sqlite3VdbeMakeLabel(tls, pParse) /* Figure out what action to take in case of a rowid collision */ - onError = int32((*TTable)(unsafe.Pointer(pTab)).FkeyConf) - if int32(overrideError) != int32(OE_Default) { - onError = int32(overrideError) + onError = libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FkeyConf) + if libc.Int32FromUint8(overrideError) != int32(OE_Default) { + onError = libc.Int32FromUint8(overrideError) } else { if onError == int32(OE_Default) { onError = int32(OE_Abort) @@ -114775,7 +109933,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if pUpsert != 0 { pUpsertClause = _sqlite3UpsertOfIndex(tls, pUpsert, uintptr(0)) if pUpsertClause != uintptr(0) { - if int32((*TUpsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 { + if libc.Int32FromUint8((*TUpsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 { onError = int32(OE_Ignore) /* DO NOTHING is the same as INSERT OR IGNORE */ } else { onError = int32(OE_Update) /* DO UPDATE */ @@ -114793,7 +109951,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt ** to defer the running of the rowid conflict checking until after ** the UNIQUE constraints have run. */ - if onError == int32(OE_Replace) && onError != int32(overrideError) && (*TTable)(unsafe.Pointer(pTab)).FpIndex != 0 && !(upsertIpkDelay != 0) { + if onError == int32(OE_Replace) && onError != libc.Int32FromUint8(overrideError) && (*TTable)(unsafe.Pointer(pTab)).FpIndex != 0 && !(upsertIpkDelay != 0) { ipkTop = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) + int32(1) } if isUpdate != 0 { @@ -114845,7 +110003,6 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), regTrigCnt, int32(1)) /* incr trigger cnt */ nReplaceTrig++ } else { - _ = libc.Int32FromInt32(0) /* This OP_Delete opcode fires the pre-update-hook only. It does ** not modify the b-tree. It is more efficient to let the coming ** OP_Insert replace the existing entry than it is to delete the @@ -114897,7 +110054,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } } addrUniqueOk = _sqlite3VdbeMakeLabel(tls, pParse) - if int32(bAffinityDone) == 0 { + if libc.Int32FromUint8(bAffinityDone) == 0 { _sqlite3TableAffinity(tls, v, pTab, regNewData+int32(1)) bAffinityDone = uint8(1) } @@ -114915,7 +110072,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt regIdx = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp)))*4)) + int32(1) i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } iField = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) @@ -114937,23 +110094,23 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt ; i++ } - _sqlite3VdbeAddOp3(tls, v, int32(OP_MakeRecord), regIdx, int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp)))*4))) + _sqlite3VdbeAddOp3(tls, v, int32(OP_MakeRecord), regIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp)))*4))) /* In an UPDATE operation, if this index is the PRIMARY KEY index ** of a WITHOUT ROWID table and there has been no change the ** primary key, then no collision is possible. The collision detection ** logic below can all be skipped. */ - if isUpdate != 0 && pPk == pIdx && int32(pkChng) == 0 { + if isUpdate != 0 && pPk == pIdx && libc.Int32FromUint8(pkChng) == 0 { _sqlite3VdbeResolveLabel(tls, v, addrUniqueOk) goto _9 } /* Find out what action to take in case there is a uniqueness conflict */ - onError = int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) + onError = libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) if onError == OE_None { _sqlite3VdbeResolveLabel(tls, v, addrUniqueOk) goto _9 /* pIdx is not a UNIQUE index */ } - if int32(overrideError) != int32(OE_Default) { - onError = int32(overrideError) + if libc.Int32FromUint8(overrideError) != int32(OE_Default) { + onError = libc.Int32FromUint8(overrideError) } else { if onError == int32(OE_Default) { onError = int32(OE_Abort) @@ -114961,7 +110118,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } /* Figure out if the upsert clause applies to this index */ if pUpsertClause != 0 { - if int32((*TUpsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 { + if libc.Int32FromUint8((*TUpsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 { onError = int32(OE_Ignore) /* DO NOTHING is the same as INSERT OR IGNORE */ } else { onError = int32(OE_Update) /* DO UPDATE */ @@ -114977,9 +110134,8 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt ** This is not possible for ENABLE_PREUPDATE_HOOK builds, as the row ** must be explicitly deleted in order to ensure any pre-update hook ** is invoked. */ - _ = libc.Int32FromInt32(0) /* Check to see if the new index entry will be unique */ - addrConflictCk = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NoConflict), iThisCur, addrUniqueOk, regIdx, int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) + addrConflictCk = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NoConflict), iThisCur, addrUniqueOk, regIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) /* Generate code to handle collisions */ if pIdx == pPk { v11 = regIdx @@ -115002,10 +110158,9 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if pIdx != pPk { i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - _ = libc.Int32FromInt32(0) x1 = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iThisCur, x1, regR+i) goto _12 @@ -115022,7 +110177,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt ** For a UNIQUE index, only conflict if the PRIMARY KEY values ** of the matched index row are different from the original PRIMARY ** KEY values of this row before the update. */ - addrJump = _sqlite3VdbeCurrentAddr(tls, v) + int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) + addrJump = _sqlite3VdbeCurrentAddr(tls, v) + libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) op = int32(OP_Ne) if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { v13 = regIdx @@ -115032,13 +110187,12 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt regCmp = v13 i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } p4 = _sqlite3LocateCollSeq(tls, pParse, *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*4))) x1 = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))) - _ = libc.Int32FromInt32(0) - if i == int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)-int32(1) { + if i == libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)-int32(1) { addrJump = addrUniqueOk op = int32(OP_Eq) } @@ -115054,7 +110208,6 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } } /* Generate code that executes if the new index entry is not unique */ - _ = libc.Int32FromInt32(0) switch onError { case int32(OE_Rollback): fallthrough @@ -115068,9 +110221,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Ignore): _sqlite3VdbeGoto(tls, v, ignoreDest) default: /* Number of opcodes in conflict check logic */ - _ = libc.Int32FromInt32(0) nConflictCk = _sqlite3VdbeCurrentAddr(tls, v) - addrConflictCk - _ = libc.Int32FromInt32(0) if regTrigCnt != 0 { _sqlite3MultiWrite(tls, pParse) nReplaceTrig++ @@ -115083,7 +110234,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } else { v15 = ONEPASS_OFF } - _sqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, regR, int16(nPkField), uint8(0), uint8(OE_Replace), uint8(v15), iThisCur) + _sqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, regR, int16(nPkField), uint8(0), uint8(OE_Replace), libc.Uint8FromInt32(v15), iThisCur) if pTrigger != 0 && isUpdate != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_CursorUnlock), iDataCur) } @@ -115108,8 +110259,8 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt ** Hence, make a complete copy of the opcode, rather than using ** a pointer to the opcode. */ *(*TVdbeOp)(unsafe.Pointer(bp + 20)) = *(*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetOp(tls, v, addrConflictCk))) - if int32((*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fopcode) != int32(OP_IdxRowid) { - if int32(_sqlite3OpcodeProperty[(*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fopcode])&int32(OPFLG_JUMP) != 0 { + if libc.Int32FromUint8((*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fopcode) != int32(OP_IdxRowid) { + if libc.Int32FromUint8(_sqlite3OpcodeProperty[(*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fopcode])&int32(OPFLG_JUMP) != 0 { p2 = lblRecheckOk } else { p2 = (*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fp2 @@ -115120,7 +110271,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt v16 = *(*uintptr)(unsafe.Pointer(bp + 20 + 16)) } zP4 = v16 - _sqlite3VdbeAddOp4(tls, v, int32((*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fopcode), (*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fp1, p2, (*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fp3, zP4, int32((*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fp4type)) + _sqlite3VdbeAddOp4(tls, v, libc.Int32FromUint8((*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fopcode), (*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fp1, p2, (*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fp3, zP4, int32((*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fp4type)) _sqlite3VdbeChangeP5(tls, v, (*(*TVdbeOp)(unsafe.Pointer(bp + 20))).Fp5) } nConflictCk-- @@ -115150,11 +110301,9 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt /* If the IPK constraint is a REPLACE, run it last */ if ipkTop != 0 { _sqlite3VdbeGoto(tls, v, ipkTop) - _ = libc.Int32FromInt32(0) _sqlite3VdbeJumpHere(tls, v, ipkBottom) } /* Recheck all uniqueness constraints after replace triggers have run */ - _ = libc.Int32FromInt32(0) if nReplaceTrig != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), regTrigCnt, lblRecheckOk) if !(pPk != 0) { @@ -115194,8 +110343,6 @@ func _codeWithoutRowidPreupdate(tls *libc.TLS, pParse uintptr, pTab uintptr, iCu _, _ = r, v v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe r = _sqlite3GetTempReg(tls, pParse) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, r) _sqlite3VdbeAddOp4(tls, v, int32(OP_Insert), iCur, regData, r, pTab, -int32(5)) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_ISNOOP)) @@ -115218,10 +110365,8 @@ func _sqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDat var pIdx, v uintptr var pik_flags Tu8 _, _, _, _, _, _, _ = i, pIdx, pik_flags, v, v2, v3, v4 /* Loop counter */ - _ = libc.Int32FromInt32(0) v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* This table is not a VIEW */ + /* This table is not a VIEW */ i = 0 pIdx = (*TTable)(unsafe.Pointer(pTab)).FpIndex for { @@ -115229,7 +110374,6 @@ func _sqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDat break } /* All REPLACE indexes are at the end of the list */ - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) == 0 { goto _1 } @@ -115241,7 +110385,7 @@ func _sqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDat } else { v2 = 0 } - pik_flags = uint8(v2) + pik_flags = libc.Uint8FromInt32(v2) if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) && !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { pik_flags = Tu8(int32(pik_flags) | libc.Int32FromInt32(OPFLAG_NCHANGE)) pik_flags = Tu8(int32(pik_flags) | update_flags&libc.Int32FromInt32(OPFLAG_SAVEPOSITION)) @@ -115250,9 +110394,9 @@ func _sqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDat } } if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 { - v3 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + v3 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) } else { - v3 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v3 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iIdxCur+i, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4))+int32(1), v3) _sqlite3VdbeChangeP5(tls, v, uint16(pik_flags)) @@ -115316,11 +110460,7 @@ func _sqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op var i, iDataCur, iDb, iIdxCur, v1, v2, v4 int32 var pIdx, v uintptr _, _, _, _, _, _, _, _, _ = i, iDataCur, iDb, iIdxCur, pIdx, v, v1, v2, v4 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { /* This routine is a no-op for virtual tables. Leave the output ** variables *piDataCur and *piIdxCur set to illegal cursor numbers ** for improved error detection. */ @@ -115331,7 +110471,6 @@ func _sqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op } iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) if iBase < 0 { iBase = (*TParse)(unsafe.Pointer(pParse)).FnTab } @@ -115342,7 +110481,7 @@ func _sqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && (aToOpen == uintptr(0) || *(*Tu8)(unsafe.Pointer(aToOpen)) != 0) { _sqlite3OpenTable(tls, pParse, iDataCur, iDb, pTab, op) } else { - if int32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FnoSharedCache) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FnoSharedCache) == 0 { _sqlite3TableLock(tls, pParse, iDb, (*TTable)(unsafe.Pointer(pTab)).Ftnum, libc.BoolUint8(op == int32(OP_OpenWrite)), (*TTable)(unsafe.Pointer(pTab)).FzName) } } @@ -115356,13 +110495,12 @@ func _sqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op v4 = iBase iBase++ iIdxCur = v4 - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) && !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { *(*int32)(unsafe.Pointer(piDataCur)) = iIdxCur p5 = uint8(0) } if aToOpen == uintptr(0) || *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(i+int32(1)))) != 0 { - _sqlite3VdbeAddOp3(tls, v, op, iIdxCur, int32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) + _sqlite3VdbeAddOp3(tls, v, op, iIdxCur, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) _sqlite3VdbeChangeP5(tls, v, uint16(p5)) } @@ -115394,29 +110532,26 @@ func _sqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op func _xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) (r int32) { var i int32 _ = i - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TIndex)(unsafe.Pointer(pDest)).FnKeyCol) != int32((*TIndex)(unsafe.Pointer(pSrc)).FnKeyCol) || int32((*TIndex)(unsafe.Pointer(pDest)).FnColumn) != int32((*TIndex)(unsafe.Pointer(pSrc)).FnColumn) { + if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pDest)).FnKeyCol) != libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pSrc)).FnKeyCol) || libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pDest)).FnColumn) != libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pSrc)).FnColumn) { return 0 /* Different number of columns */ } - if int32((*TIndex)(unsafe.Pointer(pDest)).FonError) != int32((*TIndex)(unsafe.Pointer(pSrc)).FonError) { + if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pDest)).FonError) != libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pSrc)).FonError) { return 0 /* Different conflict resolution strategies */ } i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pSrc)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pSrc)).FnKeyCol)) { break } if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pSrc)).FaiColumn + uintptr(i)*2))) != int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pDest)).FaiColumn + uintptr(i)*2))) { return 0 /* Different columns indexed */ } if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pSrc)).FaiColumn + uintptr(i)*2))) == -int32(2) { - _ = libc.Int32FromInt32(0) if _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pSrc)).FaColExpr + 8 + uintptr(i)*20))).FpExpr, (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pDest)).FaColExpr + 8 + uintptr(i)*20))).FpExpr, -int32(1)) != 0 { return 0 /* Different expressions in the index */ } } - if int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pSrc)).FaSortOrder + uintptr(i)))) != int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pDest)).FaSortOrder + uintptr(i)))) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pSrc)).FaSortOrder + uintptr(i)))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pDest)).FaSortOrder + uintptr(i)))) { return 0 /* Different sort orders */ } if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pSrc)).FazColl + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pDest)).FazColl + uintptr(i)*4))) != 0 { @@ -115470,25 +110605,24 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin emptyDestTest = 0 /* Address of test for empty pDest */ emptySrcTest = 0 /* Memory register used by AUTOINC */ destHasUniqueIdx = 0 /* Registers holding data and rowid */ - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 || (*TSelect)(unsafe.Pointer(pSelect)).FpWith != 0 { /* Do not attempt to process this query if there are an WITH clauses ** attached to it. Proceeding may generate a false "no such table: xxx" ** error if pSelect reads from a CTE named "xxx". */ return 0 } - if int32((*TTable)(unsafe.Pointer(pDest)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pDest)).FeTabType) == int32(TABTYP_VTAB) { return 0 /* tab1 must not be a virtual table */ } if onError == int32(OE_Default) { if int32((*TTable)(unsafe.Pointer(pDest)).FiPKey) >= 0 { - onError = int32((*TTable)(unsafe.Pointer(pDest)).FkeyConf) + onError = libc.Int32FromUint8((*TTable)(unsafe.Pointer(pDest)).FkeyConf) } if onError == int32(OE_Default) { onError = int32(OE_Abort) } } - _ = libc.Int32FromInt32(0) /* allocated even if there is no FROM clause */ + /* allocated even if there is no FROM clause */ if (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc)).FnSrc != int32(1) { return 0 /* FROM clause must have exactly one term */ } @@ -115516,12 +110650,10 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin return 0 /* SELECT may not be DISTINCT */ } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - _ = libc.Int32FromInt32(0) if (*TExprList)(unsafe.Pointer(pEList)).FnExpr != int32(1) { return 0 /* The result set must have exactly one column */ } - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr)).Fop) != int32(TK_ASTERISK) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr)).Fop) != int32(TK_ASTERISK) { return 0 /* The result set must be the special operator "*" */ } /* At this point we have established that the statement is of the @@ -115540,7 +110672,7 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin if libc.BoolInt32((*TTable)(unsafe.Pointer(pDest)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0)) != libc.BoolInt32((*TTable)(unsafe.Pointer(pSrc)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0)) { return 0 /* source and destination must both be WITHOUT ROWID or not */ } - if !(int32((*TTable)(unsafe.Pointer(pSrc)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pSrc)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { return 0 /* tab2 may not be a view or virtual table */ } if int32((*TTable)(unsafe.Pointer(pDest)).FnCol) != int32((*TTable)(unsafe.Pointer(pSrc)).FnCol) { @@ -115575,14 +110707,14 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin ** VACUUM command where it is actually needed). But why do that? It ** seems harmless enough, and provides a useful service. */ - if int32((*TColumn)(unsafe.Pointer(pDestCol)).FcolFlags)&int32(COLFLAG_GENERATED) != int32((*TColumn)(unsafe.Pointer(pSrcCol)).FcolFlags)&int32(COLFLAG_GENERATED) { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pDestCol)).FcolFlags)&int32(COLFLAG_GENERATED) != libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pSrcCol)).FcolFlags)&int32(COLFLAG_GENERATED) { return 0 /* Both columns have the same generated-column type */ } /* But the transfer is only allowed if both the source and destination ** tables have the exact same expressions for generated columns. ** This requirement could be relaxed for VIRTUAL columns, I suppose. */ - if int32((*TColumn)(unsafe.Pointer(pDestCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pDestCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { if _sqlite3ExprCompare(tls, uintptr(0), _sqlite3ColumnExpr(tls, pSrc, pSrcCol), _sqlite3ColumnExpr(tls, pDest, pDestCol), -int32(1)) != 0 { return 0 /* Different generator expressions */ } @@ -115597,13 +110729,9 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin return 0 /* tab2 must be NOT NULL if tab1 is */ } /* Default values for second and subsequent columns need to match. */ - if int32((*TColumn)(unsafe.Pointer(pDestCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 && i > 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pDestCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 && i > 0 { pDestExpr = _sqlite3ColumnExpr(tls, pDest, pDestCol) pSrcExpr = _sqlite3ColumnExpr(tls, pSrc, pSrcCol) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if libc.BoolInt32(pDestExpr == uintptr(0)) != libc.BoolInt32(pSrcExpr == uintptr(0)) || pDestExpr != uintptr(0) && libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pDestExpr + 8)), *(*uintptr)(unsafe.Pointer(pSrcExpr + 8))) != 0 { return 0 /* Default values must be the same for all columns */ } @@ -115618,7 +110746,7 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin if !(pDestIdx != 0) { break } - if int32((*TIndex)(unsafe.Pointer(pDestIdx)).FonError) != OE_None { + if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pDestIdx)).FonError) != OE_None { destHasUniqueIdx = int32(1) } pSrcIdx = (*TTable)(unsafe.Pointer(pSrc)).FpIndex @@ -115658,7 +110786,6 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin ** the extra complication to make this rule less restrictive is probably ** not worth the effort. Ticket [6284df89debdfa61db8073e062908af0c9b6118e] */ - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != uint64(0) && (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -115666,7 +110793,7 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin })(unsafe.Pointer(pDest + 44))).FpFKey != uintptr(0) { return 0 } - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) { + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) { return 0 /* xfer opt does not play well with PRAGMA count_changes */ } /* If we get this far, it means that the xfer optimization is at @@ -115689,7 +110816,6 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regData) regRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3OpenTable(tls, pParse, iDest, iDbDest, pDest, int32(OP_OpenWrite)) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) && (int32((*TTable)(unsafe.Pointer(pDest)).FiPKey) < 0 && (*TTable)(unsafe.Pointer(pDest)).FpIndex != uintptr(0) || destHasUniqueIdx != 0 || onError != int32(OE_Abort) && onError != int32(OE_Rollback)) { /* In some circumstances, we are able to run the xfer optimization ** only if the destination table is initially empty. Unless the @@ -115728,14 +110854,13 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin addr1 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iDest, regRowid) } else { addr1 = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iSrc, regRowid) - _ = libc.Int32FromInt32(0) } } if (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iDest) - insFlags = uint8(libc.Int32FromInt32(OPFLAG_APPEND) | libc.Int32FromInt32(OPFLAG_USESEEKRESULT) | libc.Int32FromInt32(OPFLAG_PREFORMAT)) + insFlags = libc.Uint8FromInt32(libc.Int32FromInt32(OPFLAG_APPEND) | libc.Int32FromInt32(OPFLAG_USESEEKRESULT) | libc.Int32FromInt32(OPFLAG_PREFORMAT)) } else { - insFlags = uint8(libc.Int32FromInt32(OPFLAG_NCHANGE) | libc.Int32FromInt32(OPFLAG_LASTROWID) | libc.Int32FromInt32(OPFLAG_APPEND) | libc.Int32FromInt32(OPFLAG_PREFORMAT)) + insFlags = libc.Uint8FromInt32(libc.Int32FromInt32(OPFLAG_NCHANGE) | libc.Int32FromInt32(OPFLAG_LASTROWID) | libc.Int32FromInt32(OPFLAG_APPEND) | libc.Int32FromInt32(OPFLAG_PREFORMAT)) } if (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) { _sqlite3VdbeAddOp3(tls, v, int32(OP_RowData), iSrc, regData, int32(1)) @@ -115774,10 +110899,9 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin ; pSrcIdx = (*TIndex)(unsafe.Pointer(pSrcIdx)).FpNext } - _ = libc.Int32FromInt32(0) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), iSrc, int32((*TIndex)(unsafe.Pointer(pSrcIdx)).Ftnum), iDbSrc) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), iSrc, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pSrcIdx)).Ftnum), iDbSrc) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pSrcIdx) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iDest, int32((*TIndex)(unsafe.Pointer(pDestIdx)).Ftnum), iDbDest) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iDest, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pDestIdx)).Ftnum), iDbDest) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pDestIdx) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_BULKCSR)) addr1 = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iSrc, 0) @@ -115798,7 +110922,7 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin ** sorted order. */ i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pSrcIdx)).FnColumn)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pSrcIdx)).FnColumn)) { break } zColl = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pSrcIdx)).FazColl + uintptr(i)*4)) @@ -115810,8 +110934,8 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin ; i++ } - if i == int32((*TIndex)(unsafe.Pointer(pSrcIdx)).FnColumn) { - idxInsFlags = uint8(libc.Int32FromInt32(OPFLAG_USESEEKRESULT) | libc.Int32FromInt32(OPFLAG_PREFORMAT)) + if i == libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pSrcIdx)).FnColumn) { + idxInsFlags = libc.Uint8FromInt32(libc.Int32FromInt32(OPFLAG_USESEEKRESULT) | libc.Int32FromInt32(OPFLAG_PREFORMAT)) _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iDest) _sqlite3VdbeAddOp2(tls, v, int32(OP_RowCell), iDest, iSrc) } @@ -115820,14 +110944,14 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin idxInsFlags = Tu8(int32(idxInsFlags) | libc.Int32FromInt32(OPFLAG_NCHANGE)) } } - if int32(idxInsFlags) != libc.Int32FromInt32(OPFLAG_USESEEKRESULT)|libc.Int32FromInt32(OPFLAG_PREFORMAT) { + if libc.Int32FromUint8(idxInsFlags) != libc.Int32FromInt32(OPFLAG_USESEEKRESULT)|libc.Int32FromInt32(OPFLAG_PREFORMAT) { _sqlite3VdbeAddOp3(tls, v, int32(OP_RowData), iSrc, regData, int32(1)) if (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) && !((*TTable)(unsafe.Pointer(pDest)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pDestIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { _codeWithoutRowidPreupdate(tls, pParse, pDest, iDest, regData) } } _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxInsert), iDest, regData) - _sqlite3VdbeChangeP5(tls, v, uint16(int32(idxInsFlags)|int32(OPFLAG_APPEND))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromUint8(idxInsFlags)|int32(OPFLAG_APPEND))) _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iSrc, addr1+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Close), iSrc, 0) @@ -115899,7 +111023,7 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Tsqlite3_c *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* The current SQL statement */ azCols = uintptr(0) /* True if callback data is initialized */ if !(_sqlite3SafetyCheckOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(136304)) + return _sqlite3MisuseError(tls, int32(136313)) } if zSql == uintptr(0) { zSql = __ccgo_ts + 1662 @@ -115911,7 +111035,6 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Tsqlite3_c azVals = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), bp+4, bp) - _ = libc.Int32FromInt32(0) if rc != SQLITE_OK { continue } @@ -115927,7 +111050,7 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Tsqlite3_c if xCallback != 0 && (int32(SQLITE_ROW) == rc || int32(SQLITE_DONE) == rc && !(callbackIsInit != 0) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_NullCallback) != 0) { if !(callbackIsInit != 0) { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) - azCols = _sqlite3DbMallocRaw(tls, db, uint64(uint32(libc.Int32FromInt32(2)*nCol+libc.Int32FromInt32(1))*uint32(4))) + azCols = _sqlite3DbMallocRaw(tls, db, uint64(libc.Uint32FromInt32(libc.Int32FromInt32(2)*nCol+libc.Int32FromInt32(1))*uint32(4))) if azCols == uintptr(0) { goto exec_out } @@ -115939,7 +111062,6 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Tsqlite3_c *(*uintptr)(unsafe.Pointer(azCols + uintptr(i)*4)) = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), i) /* sqlite3VdbeSetColName() installs column names as UTF8 ** strings so there is no way for sqlite3_column_name() to fail. */ - _ = libc.Int32FromInt32(0) goto _1 _1: ; @@ -115981,7 +111103,7 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Tsqlite3_c rc = _sqlite3VdbeFinalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) zSql = *(*uintptr)(unsafe.Pointer(bp)) - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zSql)))])&int32(0x01) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zSql)))])&int32(0x01) != 0 { zSql++ } break @@ -116009,7 +111131,6 @@ exec_out: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = uintptr(0) } } - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } @@ -116734,7 +111855,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp handle = _sqlite3OsDlOpen(tls, pVfs, zFile) ii = 0 for { - if !(ii < int32(libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4)) && handle == uintptr(0)) { + if !(ii < libc.Int32FromUint32(libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4)) && handle == uintptr(0)) { break } zAltFile = Xsqlite3_mprintf(tls, __ccgo_ts+12506, libc.VaList(bp+16, zFile, _azEndings[ii])) @@ -116767,7 +111888,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp */ if xInit == uintptr(0) && zProc == uintptr(0) { ncFile = _sqlite3Strlen30(tls, zFile) - zAltEntry = Xsqlite3_malloc64(tls, uint64(ncFile+int32(30))) + zAltEntry = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(ncFile+int32(30))) if zAltEntry == uintptr(0) { _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_NOMEM) @@ -116794,10 +111915,10 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp if !(v5 != 0 && c != int32('.')) { break } - if int32(_sqlite3CtypeMap[uint8(c)])&int32(0x02) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt32(c)])&int32(0x02) != 0 { v6 = iEntry iEntry++ - *(*int8)(unsafe.Pointer(zAltEntry + uintptr(v6))) = int8(_sqlite3UpperToLower[uint32(c)]) + *(*int8)(unsafe.Pointer(zAltEntry + uintptr(v6))) = libc.Int8FromUint8(_sqlite3UpperToLower[libc.Uint32FromInt32(c)]) } goto _4 _4: @@ -116815,9 +111936,9 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - _ = libc.Int32FromInt32(0) /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16447, libc.VaList(bp+16, zEntry, zFile)) - _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) + /* zErrmsg would be NULL if not so */ + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16447, libc.VaList(bp+16, zEntry, zFile)) + _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } _sqlite3OsDlClose(tls, pVfs, handle) @@ -116838,12 +111959,12 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint32(4)*uint32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint32(4)*libc.Uint32FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } if (*Tsqlite3)(unsafe.Pointer(db)).FnExtension > 0 { - libc.Xmemcpy(tls, aHandle, (*Tsqlite3)(unsafe.Pointer(db)).FaExtension, uint32(4)*uint32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension)) + libc.Xmemcpy(tls, aHandle, (*Tsqlite3)(unsafe.Pointer(db)).FaExtension, uint32(4)*libc.Uint32FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension)) } _sqlite3DbFree(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaExtension) (*Tsqlite3)(unsafe.Pointer(db)).FaExtension = aHandle @@ -116861,9 +111982,9 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(bp)) = v10 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - _ = libc.Int32FromInt32(0) /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16522, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) - _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) + /* zErrmsg would be NULL if not so */ + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16522, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } return int32(SQLITE_ERROR) @@ -116893,7 +112014,6 @@ func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uin func _sqlite3CloseExtensions(tls *libc.TLS, db uintptr) { var i int32 _ = i - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnExtension) { @@ -116917,9 +112037,9 @@ func _sqlite3CloseExtensions(tls *libc.TLS, db uintptr) { func Xsqlite3_enable_load_extension(tls *libc.TLS, db uintptr, onoff int32) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if onoff != 0 { - *(*Tu64)(unsafe.Pointer(db + 28)) |= uint64(libc.Int32FromInt32(SQLITE_LoadExtension) | libc.Int32FromInt32(SQLITE_LoadExtFunc)) + *(*Tu64)(unsafe.Pointer(db + 28)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_LoadExtension) | libc.Int32FromInt32(SQLITE_LoadExtFunc)) } else { - *(*Tu64)(unsafe.Pointer(db + 28)) &= ^uint64(libc.Int32FromInt32(SQLITE_LoadExtension) | libc.Int32FromInt32(SQLITE_LoadExtFunc)) + *(*Tu64)(unsafe.Pointer(db + 28)) &= ^libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_LoadExtension) | libc.Int32FromInt32(SQLITE_LoadExtFunc)) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -117001,7 +112121,6 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { } } Xsqlite3_mutex_leave(tls, mutex) - _ = libc.Int32FromInt32(0) return rc } return r @@ -117025,7 +112144,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { mutex = _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN)) n = 0 Xsqlite3_mutex_enter(tls, mutex) - i = int32(_sqlite3Autoext.FnExt) - int32(1) + i = libc.Int32FromUint32(_sqlite3Autoext.FnExt) - int32(1) for { if !(i >= 0) { break @@ -117242,18 +112361,18 @@ var _aPragmaName = [66]TPragmaName{ 1: { FzName: __ccgo_ts + 16865, FePragTyp: uint8(PragTyp_HEADER_VALUE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { FzName: __ccgo_ts + 16880, FePragTyp: uint8(PragTyp_AUTO_VACUUM), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { FzName: __ccgo_ts + 16892, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { @@ -117266,12 +112385,12 @@ var _aPragmaName = [66]TPragmaName{ 5: { FzName: __ccgo_ts + 16831, FePragTyp: uint8(PragTyp_CACHE_SIZE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { FzName: __ccgo_ts + 16921, FePragTyp: uint8(PragTyp_CACHE_SPILL), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { FzName: __ccgo_ts + 16933, @@ -117281,13 +112400,13 @@ var _aPragmaName = [66]TPragmaName{ 8: { FzName: __ccgo_ts + 16953, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { FzName: __ccgo_ts + 16969, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { @@ -117305,13 +112424,13 @@ var _aPragmaName = [66]TPragmaName{ 12: { FzName: __ccgo_ts + 17021, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), - FiArg: uint64(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { FzName: __ccgo_ts + 17035, FePragTyp: uint8(PragTyp_HEADER_VALUE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { @@ -117324,61 +112443,61 @@ var _aPragmaName = [66]TPragmaName{ 15: { FzName: __ccgo_ts + 17062, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { FzName: __ccgo_ts + 17081, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { FzName: __ccgo_ts + 17100, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { FzName: __ccgo_ts + 17123, FePragTyp: uint8(PragTyp_ENCODING), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { FzName: __ccgo_ts + 17132, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { FzName: __ccgo_ts + 17150, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { FzName: __ccgo_ts + 17167, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { FzName: __ccgo_ts + 17180, FePragTyp: uint8(PragTyp_HEADER_VALUE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { FzName: __ccgo_ts + 17195, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { FzName: __ccgo_ts + 17213, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { @@ -117396,32 +112515,32 @@ var _aPragmaName = [66]TPragmaName{ 27: { FzName: __ccgo_ts + 17253, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { FzName: __ccgo_ts + 17278, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { FzName: __ccgo_ts + 17297, FePragTyp: uint8(PragTyp_INDEX_INFO), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(21), FnPragCName: uint8(3), }, 30: { FzName: __ccgo_ts + 17308, FePragTyp: uint8(PragTyp_INDEX_LIST), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(38), FnPragCName: uint8(5), }, 31: { FzName: __ccgo_ts + 17319, FePragTyp: uint8(PragTyp_INDEX_INFO), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(21), FnPragCName: uint8(6), FiArg: uint64(1), @@ -117429,33 +112548,33 @@ var _aPragmaName = [66]TPragmaName{ 32: { FzName: __ccgo_ts + 17331, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { FzName: __ccgo_ts + 17347, FePragTyp: uint8(PragTyp_JOURNAL_MODE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { FzName: __ccgo_ts + 17360, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { FzName: __ccgo_ts + 17379, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { FzName: __ccgo_ts + 17398, FePragTyp: uint8(PragTyp_LOCKING_MODE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { FzName: __ccgo_ts + 17411, FePragTyp: uint8(PragTyp_PAGE_COUNT), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { FzName: __ccgo_ts + 17426, @@ -117471,17 +112590,17 @@ var _aPragmaName = [66]TPragmaName{ 40: { FzName: __ccgo_ts + 17448, FePragTyp: uint8(PragTyp_OPTIMIZE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { FzName: __ccgo_ts + 17457, FePragTyp: uint8(PragTyp_PAGE_COUNT), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { FzName: __ccgo_ts + 17468, FePragTyp: uint8(PragTyp_PAGE_SIZE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { FzName: __ccgo_ts + 17478, @@ -117493,36 +112612,36 @@ var _aPragmaName = [66]TPragmaName{ 44: { FzName: __ccgo_ts + 17490, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { FzName: __ccgo_ts + 17501, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { FzName: __ccgo_ts + 17513, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), - FiArg: uint64(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { FzName: __ccgo_ts + 17530, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { FzName: __ccgo_ts + 17549, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { FzName: __ccgo_ts + 17575, FePragTyp: uint8(PragTyp_HEADER_VALUE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { @@ -117533,7 +112652,7 @@ var _aPragmaName = [66]TPragmaName{ 51: { FzName: __ccgo_ts + 17604, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { @@ -117549,26 +112668,26 @@ var _aPragmaName = [66]TPragmaName{ 54: { FzName: __ccgo_ts + 17653, FePragTyp: uint8(PragTyp_SYNCHRONOUS), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { FzName: __ccgo_ts + 17665, FePragTyp: uint8(PragTyp_TABLE_INFO), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { FzName: __ccgo_ts + 17676, FePragTyp: uint8(PragTyp_TABLE_LIST), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), FiPragCName: uint8(15), FnPragCName: uint8(6), }, 57: { FzName: __ccgo_ts + 17687, FePragTyp: uint8(PragTyp_TABLE_INFO), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(7), FiArg: uint64(1), @@ -117576,7 +112695,7 @@ var _aPragmaName = [66]TPragmaName{ 58: { FzName: __ccgo_ts + 17699, FePragTyp: uint8(PragTyp_TEMP_STORE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { FzName: __ccgo_ts + 17710, @@ -117591,13 +112710,13 @@ var _aPragmaName = [66]TPragmaName{ 61: { FzName: __ccgo_ts + 17739, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { FzName: __ccgo_ts + 17754, FePragTyp: uint8(PragTyp_HEADER_VALUE), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { @@ -117614,8 +112733,8 @@ var _aPragmaName = [66]TPragmaName{ 65: { FzName: __ccgo_ts + 17801, FePragTyp: uint8(PragTyp_FLAG), - FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), - FiArg: uint64(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), + FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), + FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), }, } @@ -117665,16 +112784,16 @@ var _aPragmaName = [66]TPragmaName{ func _getSafetyLevel(tls *libc.TLS, z uintptr, omitFull int32, dflt Tu8) (r Tu8) { var i, n int32 _, _ = i, n - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { - return uint8(_sqlite3Atoi(tls, z)) + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&int32(0x04) != 0 { + return libc.Uint8FromInt32(_sqlite3Atoi(tls, z)) } n = _sqlite3Strlen30(tls, z) i = 0 for { - if !(i < int32(libc.Uint32FromInt64(8)/libc.Uint32FromInt64(1))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(8)/libc.Uint32FromInt64(1))) { break } - if int32(_iLength[i]) == n && Xsqlite3_strnicmp(tls, uintptr(unsafe.Pointer(&_zText))+uintptr(_iOffset[i]), z, n) == 0 && (!(omitFull != 0) || int32(_iValue[i]) <= int32(1)) { + if libc.Int32FromUint8(_iLength[i]) == n && Xsqlite3_strnicmp(tls, uintptr(unsafe.Pointer(&_zText))+uintptr(_iOffset[i]), z, n) == 0 && (!(omitFull != 0) || libc.Int32FromUint8(_iValue[i]) <= int32(1)) { return _iValue[i] } goto _1 @@ -117723,7 +112842,7 @@ var _iValue = [8]Tu8{ // ** Interpret the given string as a boolean value. // */ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { - return libc.BoolUint8(int32(_getSafetyLevel(tls, z, int32(1), dflt)) != 0) + return libc.BoolUint8(libc.Int32FromUint8(_getSafetyLevel(tls, z, int32(1), dflt)) != 0) } /* The sqlite3GetBoolean() function is used by other modules but the @@ -117774,7 +112893,7 @@ func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { } else { v1 = 0 } - return int32(uint8(v1)) + return libc.Int32FromUint8(libc.Uint8FromInt32(v1)) } // C documentation @@ -117836,13 +112955,13 @@ func _changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) (r _, _ = db, ts ts = _getTempStore(tls, zStorageType) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if int32((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store) == ts { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store) == ts { return SQLITE_OK } if _invalidateTempStorage(tls, pParse) != SQLITE_OK { return int32(SQLITE_ERROR) } - (*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store = uint8(ts) + (*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store = libc.Uint8FromInt32(ts) return SQLITE_OK } @@ -117856,19 +112975,19 @@ func _setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { var n Tu8 _, _, _, _ = i, j, n, v1 n = (*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName - if int32(n) == 0 { + if libc.Int32FromUint8(n) == 0 { v1 = int32(1) } else { - v1 = int32(n) + v1 = libc.Int32FromUint8(n) } _sqlite3VdbeSetNumCols(tls, v, v1) - if int32(n) == 0 { + if libc.Int32FromUint8(n) == 0 { _sqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName, libc.UintptrFromInt32(0)) } else { i = 0 - j = int32((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) + j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { - if !(i < int32(n)) { + if !(i < libc.Int32FromUint8(n)) { break } _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, _pragCName[j], libc.UintptrFromInt32(0)) @@ -117919,11 +113038,6 @@ func _setAllPagerFlags(tls *libc.TLS, db uintptr) { if (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0 { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb n = (*Tsqlite3)(unsafe.Pointer(db)).FnDb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for { v1 = n n-- @@ -117946,7 +113060,7 @@ func _setAllPagerFlags(tls *libc.TLS, db uintptr) { func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { var zName uintptr _ = zName - switch int32(action) { + switch libc.Int32FromUint8(action) { case int32(OE_SetNull): zName = __ccgo_ts + 17920 case int32(OE_SetDflt): @@ -117957,7 +113071,6 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { zName = __ccgo_ts + 17949 default: zName = __ccgo_ts + 17958 - _ = libc.Int32FromInt32(0) break } return zName @@ -117971,14 +113084,7 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { // ** journal-mode name. // */ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if eMode == int32(libc.Uint32FromInt64(24)/libc.Uint32FromInt64(4)) { + if eMode == libc.Int32FromUint32(libc.Uint32FromInt64(24)/libc.Uint32FromInt64(4)) { return uintptr(0) } return _azModeName[eMode] @@ -118004,7 +113110,7 @@ func _pragmaLocate(tls *libc.TLS, zName uintptr) (r uintptr) { _, _, _, _, _ = lwr, mid, rc, upr, v1 mid = 0 lwr = 0 - upr = int32(libc.Uint32FromInt64(1056)/libc.Uint32FromInt64(16)) - libc.Int32FromInt32(1) + upr = libc.Int32FromUint32(libc.Uint32FromInt64(1056)/libc.Uint32FromInt64(16)) - libc.Int32FromInt32(1) for lwr <= upr { mid = (lwr + upr) / int32(2) rc = Xsqlite3_stricmp(tls, zName, _aPragmaName[mid].FzName) @@ -118037,7 +113143,7 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s var mask Tu32 var zType uintptr _, _ = mask, zType - mask = uint32(libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL)) + mask = libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL)) if showInternFuncs != 0 { mask = uint32(0xffffffff) } @@ -118045,10 +113151,6 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s if !(p != 0) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFuncDef)(unsafe.Pointer(p)).FxSFunc == uintptr(0) { goto _1 } @@ -118178,7 +113280,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } - _ = libc.Int32FromInt32(0) if (*TToken)(unsafe.Pointer(pId2)).Fn > uint32(0) { v1 = (*TDb)(unsafe.Pointer(pDb)).FzDbSName } else { @@ -118233,17 +113334,17 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto pragma_out } /* Make sure the database schema is loaded if the pragma requires that */ - if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_NeedSchema) != 0 { + if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_NeedSchema) != 0 { if _sqlite3ReadSchema(tls, pParse) != 0 { goto pragma_out } } /* Register the result column names for pragmas that return results */ - if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_NoColumns) == 0 && (int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_NoColumns1) == 0 || zRight == uintptr(0)) { + if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_NoColumns) == 0 && (libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_NoColumns1) == 0 || zRight == uintptr(0)) { _setPragmaResultColumnNames(tls, v, pPragma) } /* Jump to the appropriate pragma handler */ - switch int32((*TPragmaName)(unsafe.Pointer(pPragma)).FePragTyp) { + switch libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FePragTyp) { /* ** PRAGMA [schema.]default_cache_size ** PRAGMA [schema.]default_cache_size=N @@ -118264,7 +113365,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { *(*int32)(unsafe.Pointer(pParse + 44)) += int32(2) - aOp = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint32FromInt64(36)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) + aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(36)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break } @@ -118275,7 +113376,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p size = _sqlite3AbsInt32(tls, _sqlite3Atoi(tls, zRight)) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) _sqlite3VdbeAddOp3(tls, v, int32(OP_SetCookie), iDb, int32(BTREE_DEFAULT_CACHE_SIZE), size) - _ = libc.Int32FromInt32(0) (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size = size _sqlite3BtreeSetCacheSize(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt, (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size) } @@ -118292,7 +113392,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p fallthrough case int32(PragTyp_PAGE_SIZE): pBt = (*TDb)(unsafe.Pointer(pDb)).FpBt - _ = libc.Int32FromInt32(0) if !(zRight != 0) { if pBt != 0 { v2 = _sqlite3BtreeGetPageSize(tls, pBt) @@ -118323,12 +113422,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_SECURE_DELETE): pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) - _ = libc.Int32FromInt32(0) if zRight != 0 { if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18036) == 0 { b = int32(2) } else { - b = int32(_sqlite3GetBoolean(tls, zRight, uint8(0))) + b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) } } if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && b >= 0 { @@ -118372,7 +113470,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 - if int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zLeft)))]) == int32('p') { + if libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zLeft)))]) == int32('p') { _sqlite3VdbeAddOp2(tls, v, int32(OP_Pagecount), iDb, iReg) } else { if zRight != 0 && _sqlite3DecOrHexToI64(tls, zRight, bp+24) == 0 { @@ -118403,10 +113501,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** the current default locking mode (which may be different to ** the locking-mode of the main database). */ - eMode = int32((*Tsqlite3)(unsafe.Pointer(db)).FdfltLockMode) + eMode = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FdfltLockMode) } else { if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) { - _ = libc.Int32FromInt32(0) ii1 = int32(2) for { if !(ii1 < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -118419,12 +113516,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ; ii1++ } - (*Tsqlite3)(unsafe.Pointer(db)).FdfltLockMode = uint8(eMode) + (*Tsqlite3)(unsafe.Pointer(db)).FdfltLockMode = libc.Uint8FromInt32(eMode) } pPager = _sqlite3BtreePager(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } - _ = libc.Int32FromInt32(0) if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { zRet = __ccgo_ts + 17817 } @@ -118519,13 +113615,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p fallthrough case int32(PragTyp_AUTO_VACUUM): pBt2 = (*TDb)(unsafe.Pointer(pDb)).FpBt - _ = libc.Int32FromInt32(0) if !(zRight != 0) { _returnSingleInt(tls, v, int64(_sqlite3BtreeGetAutoVacuum(tls, pBt2))) } else { eAuto = _getAutoVacuum(tls, zRight) - _ = libc.Int32FromInt32(0) - (*Tsqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(uint8(eAuto)) + (*Tsqlite3)(unsafe.Pointer(db)).FnextAutovac = libc.Int8FromUint8(libc.Uint8FromInt32(eAuto)) /* Call SetAutoVacuum() to set initialize the internal auto and ** incr-vacuum flags. This is required in case this connection ** creates the database file. It is important that it is created @@ -118534,7 +113628,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p rc = _sqlite3BtreeSetAutoVacuum(tls, pBt2, eAuto) if rc == SQLITE_OK && (eAuto == int32(1) || eAuto == int32(2)) { iAddr = _sqlite3VdbeCurrentAddr(tls, v) - aOp1 = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint32FromInt64(20)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_setMeta6)), _iLn11) + aOp1 = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(20)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_setMeta6)), _iLn11) if 0 != 0 { break } @@ -118579,7 +113673,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_CACHE_SIZE): - _ = libc.Int32FromInt32(0) if !(zRight != 0) { _returnSingleInt(tls, v, int64((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size)) } else { @@ -118612,7 +113705,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_CACHE_SPILL): - _ = libc.Int32FromInt32(0) if !(zRight != 0) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_CacheSpill) == uint64(0) { v10 = 0 @@ -118649,7 +113741,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_MMAP_SIZE): - _ = libc.Int32FromInt32(0) if zRight != 0 { _sqlite3DecOrHexToI64(tls, zRight, bp+48) if *(*Tsqlite3_int64)(unsafe.Pointer(bp + 48)) < 0 { @@ -118697,7 +113788,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p fallthrough case int32(PragTyp_TEMP_STORE): if !(zRight != 0) { - _returnSingleInt(tls, v, int64((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store)) + _returnSingleInt(tls, v, libc.Int64FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store)) } else { _changeTempStorage(tls, pParse, zRight) } @@ -118726,7 +113817,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto pragma_out } } - if libc.Bool(false) || libc.Bool(true) && int32((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store) <= int32(1) || libc.Bool(libc.Bool(false) && int32((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store) == int32(1)) { + if libc.Bool(false) || libc.Bool(true) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store) <= int32(1) || libc.Bool(libc.Bool(false) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store) == int32(1)) { _invalidateTempStorage(tls, pParse) } Xsqlite3_free(tls, Xsqlite3_temp_directory) @@ -118750,17 +113841,17 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p fallthrough case int32(PragTyp_SYNCHRONOUS): if !(zRight != 0) { - _returnSingleInt(tls, v, int64(int32((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) + _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18066, 0) } else { if iDb != int32(1) { - iLevel = (int32(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) + iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) if iLevel == 0 { iLevel = int32(1) } - (*TDb)(unsafe.Pointer(pDb)).Fsafety_level = uint8(iLevel) + (*TDb)(unsafe.Pointer(pDb)).Fsafety_level = libc.Uint8FromInt32(iLevel) (*TDb)(unsafe.Pointer(pDb)).FbSyncSet = uint8(1) _setAllPagerFlags(tls, db) } @@ -118772,10 +113863,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, libc.BoolInt64((*Tsqlite3)(unsafe.Pointer(db)).Fflags&(*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != uint64(0))) } else { mask = (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg /* Mask of bits to set or clear. */ - if int32((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 { /* Foreign key support may not be enabled or disabled while not ** in auto-commit mode. */ - mask &= uint64(^libc.Int32FromInt32(SQLITE_ForeignKeys)) + mask &= libc.Uint64FromInt32(^libc.Int32FromInt32(SQLITE_ForeignKeys)) } if _sqlite3GetBoolean(tls, zRight, uint8(0)) != 0 { if mask&uint64(SQLITE_WriteSchema) == uint64(0) || (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_Defensive) == uint64(0) { @@ -118831,23 +113922,22 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } isHidden = 0 - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg == uint64(0) { nHidden++ goto _12 } - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { isHidden = int32(2) /* GENERATED ALWAYS AS ... VIRTUAL */ } else { - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { isHidden = int32(3) /* GENERATED ALWAYS AS ... STORED */ } else { - _ = libc.Int32FromInt32(0) isHidden = int32(1) /* HIDDEN */ } } } - if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) == 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) == 0 { k = 0 } else { if pPk == uintptr(0) { @@ -118866,8 +113956,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { v14 = __ccgo_ts + 18125 } else { @@ -118924,7 +114012,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** the initialization scan. */ pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FpSchema + 8 - initNCol = int32((*THash)(unsafe.Pointer(pHash)).Fcount) + initNCol = libc.Int32FromUint32((*THash)(unsafe.Pointer(pHash)).Fcount) for { v18 = initNCol initNCol-- @@ -118971,10 +114059,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if zRight != 0 && Xsqlite3_stricmp(tls, zRight, (*TTable)(unsafe.Pointer(pTab2)).FzName) != 0 { goto _20 } - if int32((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { zType = __ccgo_ts + 10921 } else { - if int32((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { zType = __ccgo_ts + 13169 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { @@ -119011,16 +114099,15 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iIdxDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIdx)).FpSchema) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { /* PRAGMA index_xinfo (newer version with more rows and columns) */ - mx = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + mx = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) (*TParse)(unsafe.Pointer(pParse)).FnMem = int32(6) } else { /* PRAGMA index_info (legacy version) */ - mx = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + mx = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) (*TParse)(unsafe.Pointer(pParse)).FnMem = int32(3) } pTab3 = (*TIndex)(unsafe.Pointer(pIdx)).FpTable _sqlite3CodeVerifySchema(tls, pParse, iIdxDb) - _ = libc.Int32FromInt32(0) i1 = 0 for { if !(i1 < mx) { @@ -119034,7 +114121,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18170, libc.VaList(bp+136, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18175, libc.VaList(bp+136, int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*4)), libc.BoolInt32(i1 < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18175, libc.VaList(bp+136, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*4)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -119062,7 +114149,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p 1: __ccgo_ts + 18182, 2: __ccgo_ts + 16669, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18184, libc.VaList(bp+136, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(int32((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18184, libc.VaList(bp+136, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -119081,7 +114168,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt == uintptr(0) { goto _24 } - _ = libc.Int32FromInt32(0) _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18190, libc.VaList(bp+136, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt))) goto _24 _24: @@ -119118,7 +114204,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(p1 != 0) { break } - _ = libc.Int32FromInt32(0) _pragmaFunclistLine(tls, v, p1, int32(1), showInternFunc) goto _28 _28: @@ -119136,7 +114221,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } p1 = (*THashElem)(unsafe.Pointer(j)).Fdata - _ = libc.Int32FromInt32(0) _pragmaFunclistLine(tls, v, p1, 0, showInternFunc) goto _29 _29: @@ -119160,7 +114244,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PRAGMA_LIST): i6 = 0 for { - if !(i6 < int32(libc.Uint32FromInt64(1056)/libc.Uint32FromInt64(16))) { + if !(i6 < libc.Int32FromUint32(libc.Uint32FromInt64(1056)/libc.Uint32FromInt64(16))) { break } _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7742, libc.VaList(bp+136, _aPragmaName[i6].FzName)) @@ -119172,7 +114256,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_FOREIGN_KEY_LIST): if zRight != 0 { pTab5 = _sqlite3FindTable(tls, db, zRight, zDb) - if pTab5 != 0 && int32((*TTable)(unsafe.Pointer(pTab5)).FeTabType) == TABTYP_NORM { + if pTab5 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab5)).FeTabType) == TABTYP_NORM { pFK = (*(*struct { FaddColOffset int32 FpFKey uintptr @@ -119217,7 +114301,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pTab6 = (*THashElem)(unsafe.Pointer(k2)).Fdata k2 = (*THashElem)(unsafe.Pointer(k2)).Fnext } - if pTab6 == uintptr(0) || !(int32((*TTable)(unsafe.Pointer(pTab6)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) || (*(*struct { + if pTab6 == uintptr(0) || !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab6)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) || (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -119231,7 +114315,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3TouchRegister(tls, pParse, int32((*TTable)(unsafe.Pointer(pTab6)).FnCol)+regRow) _sqlite3OpenTable(tls, pParse, 0, iDb, pTab6, int32(OP_OpenRead)) _sqlite3VdbeLoadString(tls, v, regResult, (*TTable)(unsafe.Pointer(pTab6)).FzName) - _ = libc.Int32FromInt32(0) i8 = int32(1) pFK1 = (*(*struct { FaddColOffset int32 @@ -119253,7 +114336,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*uintptr)(unsafe.Pointer(bp + 64)) == uintptr(0) { _sqlite3OpenTable(tls, pParse, i8, iDb, pParent, int32(OP_OpenRead)) } else { - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), i8, int32((*TIndex)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Ftnum), iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), i8, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 64))) } } else { @@ -119266,7 +114349,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p i8++ pFK1 = (*TFKey)(unsafe.Pointer(pFK1)).FpNextFrom } - _ = libc.Int32FromInt32(0) if pFK1 != 0 { break } @@ -119274,7 +114356,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p (*TParse)(unsafe.Pointer(pParse)).FnTab = i8 } addrTop = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), 0) - _ = libc.Int32FromInt32(0) i8 = int32(1) pFK1 = (*(*struct { FaddColOffset int32 @@ -119290,7 +114371,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*uintptr)(unsafe.Pointer(bp + 68)) = uintptr(0) if pParent != 0 { x1 = _sqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+64, bp+68) - _ = libc.Int32FromInt32(0) } addrOk = _sqlite3VdbeMakeLabel(tls, pParse) /* Generate code to read the child key values into registers @@ -119326,7 +114406,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p jmp = _sqlite3VdbeCurrentAddr(tls, v) + int32(2) _sqlite3VdbeAddOp3(tls, v, int32(OP_SeekRowid), i8, jmp, regRow) _sqlite3VdbeGoto(tls, v, addrOk) - _ = libc.Int32FromInt32(0) } } /* Generate code to report an FK violation to the caller. */ @@ -119355,7 +114434,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p fallthrough case int32(PragTyp_CASE_SENSITIVE_LIKE): if zRight != 0 { - _sqlite3RegisterLikeFunctions(tls, db, int32(_sqlite3GetBoolean(tls, zRight, uint8(0)))) + _sqlite3RegisterLikeFunctions(tls, db, libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0)))) } break /* PRAGMA integrity_check @@ -119385,7 +114464,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p fallthrough case int32(PragTyp_INTEGRITY_CHECK): pObjTab = uintptr(0) /* Check only this one table, if not NULL */ - isQuick = libc.BoolInt32(int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zLeft)))]) == int32('q')) + isQuick = libc.BoolInt32(libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zLeft)))]) == int32('q')) /* If the PRAGMA command was of the form "PRAGMA <db>.integrity_check", ** then iDb is set to the index of the database identified by <db>. ** In this case, the integrity of database iDb only is verified by @@ -119395,8 +114474,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** "PRAGMA quick_check"), then iDb is set to 0. In this case, set iDb ** to -1 here, to indicate that the VDBE should verify the integrity ** of all attached databases. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TToken)(unsafe.Pointer(pId2)).Fz == uintptr(0) { iDb = -int32(1) } @@ -119439,7 +114516,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** Begin by finding the root pages numbers ** for all tables and indices in the database. */ - _ = libc.Int32FromInt32(0) pTbls = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*16))).FpSchema + 8 cnt = 0 x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst @@ -119478,7 +114554,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*uint32(cnt+libc.Int32FromInt32(1)))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*libc.Uint32FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -119500,7 +114576,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab8)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { cnt++ v45 = cnt - *(*int32)(unsafe.Pointer(aRoot + uintptr(v45)*4)) = int32((*TTable)(unsafe.Pointer(pTab8)).Ftnum) + *(*int32)(unsafe.Pointer(aRoot + uintptr(v45)*4)) = libc.Int32FromUint32((*TTable)(unsafe.Pointer(pTab8)).Ftnum) } pIdx4 = (*TTable)(unsafe.Pointer(pTab8)).FpIndex for { @@ -119509,7 +114585,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } cnt++ v47 = cnt - *(*int32)(unsafe.Pointer(aRoot + uintptr(v47)*4)) = int32((*TIndex)(unsafe.Pointer(pIdx4)).Ftnum) + *(*int32)(unsafe.Pointer(aRoot + uintptr(v47)*4)) = libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIdx4)).Ftnum) goto _46 _46: ; @@ -119526,7 +114602,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ClearTempRegCache(tls, pParse) /* Do the b-tree integrity checks */ _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(i9))) + _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(i9))) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18215, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*16))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) @@ -119607,7 +114683,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 && pObjTab != pTab10 { goto _53 } - if !(int32((*TTable)(unsafe.Pointer(pTab10)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab10)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { goto _53 } if isQuick != 0 || (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -119615,8 +114691,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p r2 = 0 } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab10) - r2 = _sqlite3GetTempRange(tls, pParse, int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) - _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), int32(1), r2, r2+int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)-int32(1)) + r2 = _sqlite3GetTempRange(tls, pParse, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), int32(1), r2, r2+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)-int32(1)) } _sqlite3OpenTableAndIndices(tls, pParse, pTab10, int32(OP_OpenRead), uint8(0), int32(1), uintptr(0), bp+76, bp+80) /* reg[7] counts the number of entries in the table. @@ -119636,8 +114712,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pIdx6 = (*TIndex)(unsafe.Pointer(pIdx6)).FpNext j4++ } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), *(*int32)(unsafe.Pointer(bp + 76)), 0) loopTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(7), int32(1)) /* Fetch the right-most column from the table. This will cause @@ -119645,7 +114719,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** will also prepopulate the cursor column cache that is used ** by the OP_IsType code, so it is a required step. */ - _ = libc.Int32FromInt32(0) if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { mxCol = -int32(1) j4 = 0 @@ -119653,7 +114726,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j4 < int32((*TTable)(unsafe.Pointer(pTab10)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { mxCol++ } goto _55 @@ -119668,7 +114741,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p /* COLFLAG_VIRTUAL columns are not included in the WITHOUT ROWID ** PK index column-count, so there is no need to account for them ** in this case. */ - mxCol = int32((*TIndex)(unsafe.Pointer(_sqlite3PrimaryKeyIndex(tls, pTab10))).FnColumn) - int32(1) + mxCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(_sqlite3PrimaryKeyIndex(tls, pTab10))).FnColumn) - int32(1) } if mxCol >= 0 { _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp + 76)), mxCol, int32(3)) @@ -119676,7 +114749,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if !(isQuick != 0) { if pPk1 != 0 { - a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 76)), 0, r2, int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) + a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 76)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18268, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) @@ -119685,7 +114758,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeJumpHere(tls, v, a1+int32(1)) j4 = 0 for { - if !(j4 < int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) { + if !(j4 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) { break } _sqlite3ExprCodeLoadIndexColumn(tls, pParse, pPk1, *(*int32)(unsafe.Pointer(bp + 76)), j4, r2+j4) @@ -119725,14 +114798,14 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } /* Compute the operands that will be needed for OP_IsType */ p4 = int32(SQLITE_NULL) - if int32((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 76)), j4, int32(3)) p11 = -int32(1) p3 = int32(3) } else { if (*TColumn)(unsafe.Pointer(pCol1)).FiDflt != 0 { *(*uintptr)(unsafe.Pointer(bp + 84)) = uintptr(0) - _sqlite3ValueFromExpr(tls, db, _sqlite3ColumnExpr(tls, pTab10, pCol1), (*Tsqlite3)(unsafe.Pointer(db)).Fenc, uint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity), bp+84) + _sqlite3ValueFromExpr(tls, db, _sqlite3ColumnExpr(tls, pTab10, pCol1), (*Tsqlite3)(unsafe.Pointer(db)).Fenc, libc.Uint8FromInt8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity), bp+84) if *(*uintptr)(unsafe.Pointer(bp + 84)) != 0 { p4 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 84))) _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 84))) @@ -119774,7 +114847,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) - _ = libc.Int32FromInt32(0) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)])) zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18324, libc.VaList(bp+136, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) @@ -119814,7 +114886,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p /* Verify CHECK constraints */ if (*TTable)(unsafe.Pointer(pTab10)).FpCheck != 0 && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_IgnoreChecks) == uint64(0) { pCheck = _sqlite3ExprListDup(tls, db, (*TTable)(unsafe.Pointer(pTab10)).FpCheck, 0) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { addrCkFault = _sqlite3VdbeMakeLabel(tls, pParse) addrCkOk = _sqlite3VdbeMakeLabel(tls, pParse) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = *(*int32)(unsafe.Pointer(bp + 76)) + int32(1) @@ -119855,7 +114927,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pPrior = pIdx6 _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ - jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 80))+j4, ckUniq, r1, int32((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) + jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 80))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18421) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18426) @@ -119870,7 +114942,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** any extra bytes at the end. Verify that this is the case. */ if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 80))+j4, int32(3)) - jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+int32((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) + jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18447) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18483) @@ -119882,7 +114954,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p label6 = 0 kk = 0 for { - if !(kk < int32((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) { + if !(kk < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) { break } if *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx6)).FazColl + uintptr(kk)*4)) == uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) { @@ -119910,15 +114982,14 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p /* For UNIQUE indexes, verify that only one entry exists with the ** current key. The entry is unique if (1) any column is NULL ** or (2) the next entry has a different key */ - if int32((*TIndex)(unsafe.Pointer(pIdx6)).FonError) != OE_None { + if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx6)).FonError) != OE_None { uniqOk = _sqlite3VdbeMakeLabel(tls, pParse) kk = 0 for { - if !(kk < int32((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) { + if !(kk < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) { break } iCol1 = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx6)).FaiColumn + uintptr(kk)*2))) - _ = libc.Int32FromInt32(0) if iCol1 >= 0 && int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(iCol1)*12 + 4))&0xf>>0)) != 0 { goto _61 } @@ -119931,7 +115002,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p jmp61 = _sqlite3VdbeAddOp1(tls, v, int32(OP_Next), *(*int32)(unsafe.Pointer(bp + 80))+j4) _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 80))+j4, uniqOk, r1, int32((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 80))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18521) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) @@ -119948,8 +115019,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), *(*int32)(unsafe.Pointer(bp + 76)), loopTop) _sqlite3VdbeJumpHere(tls, v, loopTop-int32(1)) if pPk1 != 0 { - _ = libc.Int32FromInt32(0) - _sqlite3ReleaseTempRange(tls, pParse, r2, int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) + _sqlite3ReleaseTempRange(tls, pParse, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) } goto _53 _53: @@ -119968,10 +115038,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 && pObjTab != pTab11 { goto _62 } - if int32((*TTable)(unsafe.Pointer(pTab11)).FeTabType) == TABTYP_NORM { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab11)).FeTabType) == TABTYP_NORM { goto _62 } - if !(int32((*TTable)(unsafe.Pointer(pTab11)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab11)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { goto _62 } if int32((*TTable)(unsafe.Pointer(pTab11)).FnCol) <= 0 { @@ -120026,7 +115096,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ; i9++ } - aOp2 = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint32FromInt64(28)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_endCode)), _iLn21) + aOp2 = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(28)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_endCode)), _iLn21) if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 72)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*20))).Fp4type = int8(-libc.Int32FromInt32(1)) @@ -120064,9 +115134,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if _sqlite3ReadSchema(tls, pParse) != 0 { goto pragma_out } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _returnSingleText(tls, v, _encnames1[(*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc].FzName) } else { /* "PRAGMA encoding = XXX" */ /* Only change the value of sqlite.enc if the database handle is not @@ -120091,14 +115158,14 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).Fenc != 0 { - v64 = int32((*struct { + v64 = libc.Int32FromUint8((*struct { FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).Fenc) } else { v64 = int32(SQLITE_UTF16LE) } - enc = uint8(v64) + enc = libc.Uint8FromInt32(v64) (*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)).Fenc = enc _sqlite3SetTextEncoding(tls, db, enc) break @@ -120151,10 +115218,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_HEADER_VALUE): - iCookie = int32((*TPragmaName)(unsafe.Pointer(pPragma)).FiArg) /* Which cookie to read or write */ + iCookie = libc.Int32FromUint64((*TPragmaName)(unsafe.Pointer(pPragma)).FiArg) /* Which cookie to read or write */ _sqlite3VdbeUsesBtree(tls, v, iDb) - if zRight != 0 && int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_ReadOnly) == 0 { - aOp3 = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint32FromInt64(8)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_setCookie)), 0) + if zRight != 0 && libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_ReadOnly) == 0 { + aOp3 = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(8)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_setCookie)), 0) if 0 != 0 { break } @@ -120169,7 +115236,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p (*(*TVdbeOp)(unsafe.Pointer(aOp3 + 1*20))).Fopcode = uint8(OP_Noop) } } else { - aOp4 = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_readCookie)), 0) + aOp4 = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_readCookie)), 0) if 0 != 0 { break } @@ -120342,7 +115409,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nCheck = 0 /* Number of tables to be optimized */ nBtree = 0 /* Number of indexes on the current table */ if zRight != 0 { - opMask = uint32(_sqlite3Atoi(tls, zRight)) + opMask = libc.Uint32FromInt32(_sqlite3Atoi(tls, zRight)) if opMask&uint32(0x02) == uint32(0) { break } @@ -120384,7 +115451,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab12 = (*THashElem)(unsafe.Pointer(k4)).Fdata /* This only works for ordinary tables */ - if !(int32((*TTable)(unsafe.Pointer(pTab12)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab12)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { goto _73 } /* Do not scan system tables */ @@ -120446,9 +115513,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v75 = -int32(1) } - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IfSizeBetween), iTabCur, int32(uint32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1)), v75, int32(szThreshold)+int32(iRange)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IfSizeBetween), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1)), v75, int32(szThreshold)+int32(iRange)) } else { - _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, int32(uint32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18642, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { @@ -120489,7 +115556,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(iAddr1 < iEnd) { break } - if int32((*(*TVdbeOp)(unsafe.Pointer(aOp5 + uintptr(iAddr1)*20))).Fopcode) == int32(OP_SqlExec) { + if libc.Int32FromUint8((*(*TVdbeOp)(unsafe.Pointer(aOp5 + uintptr(iAddr1)*20))).Fopcode) == int32(OP_SqlExec) { (*(*TVdbeOp)(unsafe.Pointer(aOp5 + uintptr(iAddr1)*20))).Fp2 = nLimit } goto _77 @@ -120511,7 +115578,6 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p /*case PragTyp_BUSY_TIMEOUT*/ fallthrough default: - _ = libc.Int32FromInt32(0) if zRight != 0 { Xsqlite3_busy_timeout(tls, db, _sqlite3Atoi(tls, zRight)) } @@ -120590,7 +115656,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** PragFlg_NoColumns1 flag is set and the caller specified an argument ** to the PRAGMA, the implementation has not added any OP_ResultRow ** instructions to the VM. */ - if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_NoColumns1) != 0 && zRight != 0 { + if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_NoColumns1) != 0 && zRight != 0 { } goto pragma_out pragma_out: @@ -120849,9 +115915,9 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(200), 0) Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18660) i = 0 - j = int32((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) + j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { - if !(i < int32((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { + if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18675, libc.VaList(bp+232, int32(cSep), _pragCName[j])) @@ -120867,17 +115933,16 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg i++ } j = 0 - if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { + if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18688) j++ } - if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { + if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18700) j++ } Xsqlite3_str_append(tls, bp, __ccgo_ts+5170, int32(1)) _sqlite3StrAccumFinish(tls, bp) - _ = libc.Int32FromInt32(0) rc = Xsqlite3_declare_vtab(tls, db, bp+24) if rc == SQLITE_OK { pTab = Xsqlite3_malloc(tls, int32(24)) @@ -120887,8 +115952,8 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg libc.Xmemset(tls, pTab, 0, uint32(24)) (*TPragmaVtab)(unsafe.Pointer(pTab)).FpName = pPragma (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb = db - (*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden = uint8(i) - (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = uint8(j) + (*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden = libc.Uint8FromInt32(i) + (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+232, Xsqlite3_errmsg(tls, db))) @@ -120926,7 +115991,7 @@ func _pragmaVtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32 _, _, _, _, _ = i, j, pConstraint, pTab, seen pTab = tab (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromInt32(1) - if int32((*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden) == 0 { + if libc.Int32FromUint8((*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden) == 0 { return SQLITE_OK } pConstraint = (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint @@ -120937,17 +116002,16 @@ func _pragmaVtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32 if !(i < (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) { break } - if (*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn < int32((*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden) { + if (*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn < libc.Int32FromUint8((*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden) { goto _1 } - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) != int32(SQLITE_INDEX_CONSTRAINT_EQ) { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) != int32(SQLITE_INDEX_CONSTRAINT_EQ) { goto _1 } - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fusable) == 0 { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fusable) == 0 { return int32(SQLITE_CONSTRAINT) } - j = (*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - int32((*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden) - _ = libc.Int32FromInt32(0) + j = (*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - libc.Int32FromUint8((*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden) seen[j] = i + int32(1) goto _1 _1: @@ -121000,7 +116064,7 @@ func _pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { (*TPragmaVtabCursor)(unsafe.Pointer(pCsr)).FiRowid = 0 i = 0 for { - if !(i < int32(libc.Uint32FromInt64(8)/libc.Uint32FromInt64(4))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(8)/libc.Uint32FromInt64(4))) { break } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(i)*4))) @@ -121035,7 +116099,6 @@ func _pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) (r int32) { rc = SQLITE_OK /* Increment the xRowid value */ (*TPragmaVtabCursor)(unsafe.Pointer(pCsr)).FiRowid++ - _ = libc.Int32FromInt32(0) if int32(SQLITE_ROW) != Xsqlite3_step(tls, (*TPragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma) { rc = Xsqlite3_finalize(tls, (*TPragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma) (*TPragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma = uintptr(0) @@ -121061,7 +116124,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr _ = idxNum _ = idxStr _pragmaVtabCursorClear(tls, pCsr) - if int32((*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FmPragFlg)&int32(PragFlg_Result1) != 0 { + if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FmPragFlg)&int32(PragFlg_Result1) != 0 { v1 = 0 } else { v1 = int32(1) @@ -121073,8 +116136,6 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr break } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if zText != 0 { *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+32, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) == uintptr(0) { @@ -121131,10 +116192,10 @@ func _pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) _, _ = pCsr, pTab pCsr = pVtabCursor pTab = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab - if i < int32((*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden) { + if i < libc.Int32FromUint8((*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden) { Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*TPragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma, i)) } else { - Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(i-int32((*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden))*4)), -int32(1), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(i-libc.Int32FromUint8((*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden))*4)), -int32(1), uintptr(-libc.Int32FromInt32(1))) } return SQLITE_OK } @@ -121181,15 +116242,13 @@ func init() { func _sqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) (r uintptr) { var pName uintptr _ = pName - _ = libc.Int32FromInt32(0) pName = _pragmaLocate(tls, zName+uintptr(7)) if pName == uintptr(0) { return uintptr(0) } - if int32((*TPragmaName)(unsafe.Pointer(pName)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_Result0)|libc.Int32FromInt32(PragFlg_Result1)) == 0 { + if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pName)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_Result0)|libc.Int32FromInt32(PragFlg_Result1)) == 0 { return uintptr(0) } - _ = libc.Int32FromInt32(0) return _sqlite3VtabCreateModule(tls, db, zName, uintptr(unsafe.Pointer(&_pragmaVtabModule)), pName, uintptr(0)) } @@ -121230,12 +116289,12 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) if *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) != uintptr(0) { /* A error message has already been generated. Do not overwrite it */ } else { - if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { + if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18761, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*4)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(141840)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(141849)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*4)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*4)) @@ -121248,7 +116307,7 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) z = _sqlite3MPrintf(tls, db, __ccgo_ts+18820, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(141847)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(141856)) } } } @@ -121314,10 +116373,8 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr pData = pInit db = (*TInitData)(unsafe.Pointer(pData)).Fdb iDb = (*TInitData)(unsafe.Pointer(pData)).FiDb - _ = libc.Int32FromInt32(0) _ = NotUsed _ = argc - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_EncodingFixed) if argv == uintptr(0) { return 0 @@ -121327,15 +116384,13 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr _corruptSchema(tls, pData, argv, uintptr(0)) return int32(1) } - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(argv + 3*4)) == uintptr(0) { _corruptSchema(tls, pData, argv, uintptr(0)) } else { - if *(*uintptr)(unsafe.Pointer(argv + 4*4)) != 0 && int32('c') == int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4)))))]) && int32('r') == int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4)) + 1)))]) { + if *(*uintptr)(unsafe.Pointer(argv + 4*4)) != 0 && int32('c') == libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4)))))]) && int32('r') == libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4)) + 1)))]) { saved_iDb = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb /* Return code from sqlite3_prepare() */ - _ = libc.Int32FromInt32(0) - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(iDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), db+168) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { _corruptSchema(tls, pData, argv, __ccgo_ts+14609) @@ -121346,12 +116401,10 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) _sqlite3Prepare(tls, db, *(*uintptr)(unsafe.Pointer(argv + 4*4)), -int32(1), uint32(0), uintptr(0), bp, uintptr(0)) rc = (*Tsqlite3)(unsafe.Pointer(db)).FerrCode - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = saved_iDb /* assert( saved_iDb==0 || (db->mDbFlags & DBFLAG_Vacuum)!=0 ); */ if SQLITE_OK != rc { if int32(uint32(*(*uint8)(unsafe.Pointer(db + 168 + 8))&0x1>>0)) != 0 { - _ = libc.Int32FromInt32(0) } else { if rc > (*TInitData)(unsafe.Pointer(pData)).Frc { (*TInitData)(unsafe.Pointer(pData)).Frc = rc @@ -121409,12 +116462,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl var _ /* meta at bp+24 */ [5]int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _ = encoding, i, mask, openedTransaction, pDb, rc, size, xAuth, zSchemaTabName, zSql, v1, v2, p3, p5 openedTransaction = 0 - mask = int32((*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&libc.Uint32FromInt32(DBFLAG_EncodingFixed) | uint32(^libc.Int32FromInt32(DBFLAG_EncodingFixed))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + mask = libc.Int32FromUint32((*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&libc.Uint32FromInt32(DBFLAG_EncodingFixed) | libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_EncodingFixed))) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(1) /* Construct the in-memory representation schema tables (sqlite_schema or ** sqlite_temp_schema) by invoking the parser directly. The appropriate @@ -121442,7 +116490,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*(*TInitData)(unsafe.Pointer(bp + 44))).FnInitRow = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 44))).FmxPage = uint32(0) _sqlite3InitCallback(tls, bp+44, int32(5), bp, uintptr(0)) - *(*Tu32)(unsafe.Pointer(db + 24)) &= uint32(mask) + *(*Tu32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(mask) if (*(*TInitData)(unsafe.Pointer(bp + 44))).Frc != 0 { rc = (*(*TInitData)(unsafe.Pointer(bp + 44))).Frc goto error_out @@ -121451,7 +116499,6 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl */ pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _ = libc.Int32FromInt32(0) p3 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema + 78 *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(DB_SchemaLoaded)) rc = SQLITE_OK @@ -121488,7 +116535,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl */ i = 0 for { - if !(i < int32(libc.Uint32FromInt64(20)/libc.Uint32FromInt64(4))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(20)/libc.Uint32FromInt64(4))) { break } _sqlite3BtreeGetMeta(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt, i+int32(1), bp+24+uintptr(i)*4) @@ -121509,11 +116556,11 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl if (*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)] != 0 { /* text encoding */ if iDb == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_EncodingFixed) == uint32(0) { /* If opening the main database, set ENC(db). */ - encoding = uint8(int32(uint8((*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)])) & int32(3)) - if int32(encoding) == 0 { + encoding = libc.Uint8FromInt32(libc.Int32FromUint8(libc.Uint8FromInt32((*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)])) & int32(3)) + if libc.Int32FromUint8(encoding) == 0 { encoding = uint8(SQLITE_UTF8) } - if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > 0 && int32(encoding) != int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc) && (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) { + if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > 0 && libc.Int32FromUint8(encoding) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) && (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) { rc = int32(SQLITE_LOCKED) goto initone_error_out } else { @@ -121521,7 +116568,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } } else { /* If opening an attached database, the encoding much match ENC(db) */ - if (*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { + if (*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12220) rc = int32(SQLITE_ERROR) goto initone_error_out @@ -121543,11 +116590,11 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** file_format==3 Version 3.1.4. // ditto but with non-NULL defaults ** file_format==4 Version 3.3.0. // DESC indices. Boolean constants */ - (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8((*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_FILE_FORMAT)-libc.Int32FromInt32(1)]) - if int32((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) == 0 { + (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = libc.Uint8FromInt32((*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_FILE_FORMAT)-libc.Int32FromInt32(1)]) + if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) == 0 { (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } - if int32((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { + if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18913) rc = int32(SQLITE_ERROR) goto initone_error_out @@ -121562,7 +116609,6 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } /* Read the schema information out of the schema tables */ - _ = libc.Int32FromInt32(0) (*(*TInitData)(unsafe.Pointer(bp + 44))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18937, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth @@ -121576,7 +116622,6 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl if rc == SQLITE_OK { _sqlite3AnalysisLoad(tls, db, iDb) } - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) _sqlite3ResetAllSchemasOfConnection(tls, db) @@ -121637,13 +116682,9 @@ func _sqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) (r int32) { var commit_internal, i, rc int32 _, _, _ = commit_internal, i, rc commit_internal = libc.BoolInt32(!((*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&libc.Uint32FromInt32(DBFLAG_SchemaChange) != 0)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Fenc = (*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)).Fenc - _ = libc.Int32FromInt32(0) /* Do the main schema first */ - if !(int32((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)).FschemaFlags)&libc.Int32FromInt32(DB_SchemaLoaded) == libc.Int32FromInt32(DB_SchemaLoaded)) { + if !(libc.Int32FromUint16((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)).FschemaFlags)&libc.Int32FromInt32(DB_SchemaLoaded) == libc.Int32FromInt32(DB_SchemaLoaded)) { rc = _sqlite3InitOne(tls, db, 0, pzErrMsg, uint32(0)) if rc != 0 { return rc @@ -121655,8 +116696,7 @@ func _sqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) (r int32) { if !(i > 0) { break } - _ = libc.Int32FromInt32(0) - if !(int32((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema)).FschemaFlags)&libc.Int32FromInt32(DB_SchemaLoaded) == libc.Int32FromInt32(DB_SchemaLoaded)) { + if !(libc.Int32FromUint16((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema)).FschemaFlags)&libc.Int32FromInt32(DB_SchemaLoaded) == libc.Int32FromInt32(DB_SchemaLoaded)) { rc = _sqlite3InitOne(tls, db, i, pzErrMsg, uint32(0)) if rc != 0 { return rc @@ -121685,7 +116725,6 @@ func _sqlite3ReadSchema(tls *libc.TLS, pParse uintptr) (r int32) { _, _ = db, rc rc = SQLITE_OK db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { rc = _sqlite3Init(tls, db, pParse+4) if rc != SQLITE_OK { @@ -121715,8 +116754,6 @@ func _schemaIsValid(tls *libc.TLS, pParse uintptr) { var _ /* cookie at bp+0 */ int32 _, _, _, _, _ = db, iDb, openedTransaction, pBt, rc db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iDb = 0 for { if !(iDb < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -121745,9 +116782,8 @@ func _schemaIsValid(tls *libc.TLS, pParse uintptr) { ** value stored as part of the in-memory schema representation, ** set Parse.rc to SQLITE_SCHEMA. */ _sqlite3BtreeGetMeta(tls, pBt, int32(BTREE_SCHEMA_VERSION), bp) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) != (*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema)).Fschema_cookie { - if int32((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema)).FschemaFlags)&int32(DB_SchemaLoaded) == int32(DB_SchemaLoaded) { + if libc.Int32FromUint16((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema)).FschemaFlags)&int32(DB_SchemaLoaded) == int32(DB_SchemaLoaded) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_SCHEMA) } _sqlite3ResetOneSchema(tls, db, iDb) @@ -121787,14 +116823,12 @@ func _sqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) (r int32) ** statements too, but it never hurts to play the odds) and ** -32768 will still fit into a 16-bit signed integer. */ - _ = libc.Int32FromInt32(0) if pSchema != 0 { i = 0 for { if !(int32(1) != 0) { break } - _ = libc.Int32FromInt32(0) if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema == pSchema { break } @@ -121803,7 +116837,6 @@ func _sqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) (r int32) ; i++ } - _ = libc.Int32FromInt32(0) } return i } @@ -121818,9 +116851,6 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { var v1 int32 _, _, _ = db, pCleanup, v1 db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FaTableLock != 0 { _sqlite3DbNNFreeNN(tls, db, (*TParse)(unsafe.Pointer(pParse)).FaTableLock) } @@ -121836,15 +116866,13 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { _sqlite3ExprListDelete(tls, db, (*TParse)(unsafe.Pointer(pParse)).FpConstExpr) } - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable -= uint32((*TParse)(unsafe.Pointer(pParse)).FdisableLookaside) if (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 { v1 = 0 } else { - v1 = int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) + v1 = libc.Int32FromUint16((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(v1) - _ = libc.Int32FromInt32(0) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = libc.Uint16FromInt32(v1) (*Tsqlite3)(unsafe.Pointer(db)).FpParse = (*TParse)(unsafe.Pointer(pParse)).FpOuterParse } @@ -121913,7 +116941,6 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+164)-uint32(libc.UintptrFromInt32(0)+4)) libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db @@ -121948,11 +116975,9 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep (*(*TParse)(unsafe.Pointer(bp))).Fdb = db if pReprepare != 0 { (*(*TParse)(unsafe.Pointer(bp))).FpReprepare = pReprepare - (*(*TParse)(unsafe.Pointer(bp))).Fexplain = uint8(Xsqlite3_stmt_isexplain(tls, pReprepare)) + (*(*TParse)(unsafe.Pointer(bp))).Fexplain = libc.Uint8FromInt32(Xsqlite3_stmt_isexplain(tls, pReprepare)) } else { - _ = libc.Int32FromInt32(0) } - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1632, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) @@ -121960,7 +116985,6 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 goto end_prepare } - _ = libc.Int32FromInt32(0) /* For a long-term use prepared statement avoid the use of ** lookaside memory. */ @@ -122001,7 +117025,6 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } pBt = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpBt if pBt != 0 { - _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FzDbSName @@ -122025,7 +117048,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } - zSqlCopy = _sqlite3DbStrNDup(tls, db, zSql, uint64(nBytes)) + zSqlCopy = _sqlite3DbStrNDup(tls, db, zSql, libc.Uint64FromInt32(nBytes)) if zSqlCopy != 0 { _sqlite3RunParser(tls, bp, zSqlCopy) (*(*TParse)(unsafe.Pointer(bp))).FzTail = zSql + uintptr(int32((*(*TParse)(unsafe.Pointer(bp))).FzTail)-int32(zSqlCopy)) @@ -122036,11 +117059,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { _sqlite3RunParser(tls, bp, zSql) } - _ = libc.Int32FromInt32(0) if pzTail != 0 { *(*uintptr)(unsafe.Pointer(pzTail)) = (*(*TParse)(unsafe.Pointer(bp))).FzTail } - if int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _sqlite3VdbeSetSql(tls, (*(*TParse)(unsafe.Pointer(bp))).FpVdbe, zSql, int32((*(*TParse)(unsafe.Pointer(bp))).FzTail)-int32(zSql), uint8(prepFlags)) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -122048,13 +117070,12 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { _sqlite3VdbeFinalize(tls, (*(*TParse)(unsafe.Pointer(bp))).FpVdbe) } - _ = libc.Int32FromInt32(0) rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3859, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) @@ -122063,7 +117084,6 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _sqlite3Error(tls, db, rc) } } else { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*(*TParse)(unsafe.Pointer(bp))).FpVdbe rc = SQLITE_OK _sqlite3ErrorClear(tls, db) @@ -122088,7 +117108,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(142654)) + return _sqlite3MisuseError(tls, int32(142663)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -122097,7 +117117,6 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 ** or encounters a permanent error. A schema problem after one schema ** reset is considered a permanent error. */ rc = _sqlite3Prepare(tls, db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail) - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { break } @@ -122121,10 +117140,8 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 } _sqlite3BtreeLeaveAll(tls, db) rc = _sqlite3ApiExit(tls, db, rc) - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _ = libc.Int32FromInt32(0) return rc } @@ -122146,21 +117163,17 @@ func _sqlite3Reprepare(tls *libc.TLS, p uintptr) (r int32) { var rc int32 var _ /* pNew at bp+0 */ uintptr _, _, _, _ = db, prepFlags, rc, zSql - _ = libc.Int32FromInt32(0) zSql = Xsqlite3_sql(tls, p) - _ = libc.Int32FromInt32(0) /* Reprepare only called for prepare_v2() statements */ + /* Reprepare only called for prepare_v2() statements */ db = _sqlite3VdbeDb(tls, p) - _ = libc.Int32FromInt32(0) prepFlags = _sqlite3VdbePrepareFlags(tls, p) rc = _sqlite3LockAndPrepare(tls, db, zSql, -int32(1), uint32(prepFlags), p, bp, uintptr(0)) if rc != 0 { if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } - _ = libc.Int32FromInt32(0) return rc } else { - _ = libc.Int32FromInt32(0) } _sqlite3VdbeSwap(tls, *(*uintptr)(unsafe.Pointer(bp)), p) _sqlite3TransferBindings(tls, *(*uintptr)(unsafe.Pointer(bp)), p) @@ -122183,7 +117196,7 @@ func Xsqlite3_prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppS var rc int32 _ = rc rc = _sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(0), uintptr(0), ppStmt, pzTail) - _ = libc.Int32FromInt32(0) /* VERIFY: F13021 */ + /* VERIFY: F13021 */ return rc } @@ -122196,7 +117209,6 @@ func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ** ** Proof in that the 5th parameter to sqlite3LockAndPrepare is 0 */ rc = _sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), uintptr(0), ppStmt, pzTail) - _ = libc.Int32FromInt32(0) return rc } @@ -122211,7 +117223,6 @@ func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ** Proof by comparison to the implementation of sqlite3_prepare_v2() ** directly above. */ rc = _sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL)|prepFlags&uint32(SQLITE_PREPARE_MASK), uintptr(0), ppStmt, pzTail) - _ = libc.Int32FromInt32(0) return rc } @@ -122231,7 +117242,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(142803)) + return _sqlite3MisuseError(tls, int32(142812)) } if nBytes >= 0 { z = zSql @@ -122281,7 +117292,7 @@ func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, p var rc int32 _ = rc rc = _sqlite3Prepare16(tls, db, zSql, nBytes, uint32(0), ppStmt, pzTail) - _ = libc.Int32FromInt32(0) /* VERIFY: F13021 */ + /* VERIFY: F13021 */ return rc } @@ -122289,7 +117300,7 @@ func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32 var rc int32 _ = rc rc = _sqlite3Prepare16(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), ppStmt, pzTail) - _ = libc.Int32FromInt32(0) /* VERIFY: F13021 */ + /* VERIFY: F13021 */ return rc } @@ -122297,7 +117308,7 @@ func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32 var rc int32 _ = rc rc = _sqlite3Prepare16(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL)|prepFlags&uint32(SQLITE_PREPARE_MASK), ppStmt, pzTail) - _ = libc.Int32FromInt32(0) /* VERIFY: F13021 */ + /* VERIFY: F13021 */ return rc } @@ -122406,7 +117417,6 @@ type SortCtx1 = TSortCtx1 func _clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { var pPrior uintptr _ = pPrior - _ = libc.Int32FromInt32(0) for p != 0 { pPrior = (*TSelect)(unsafe.Pointer(p)).FpPrior _sqlite3ExprListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpEList) @@ -122423,7 +117433,6 @@ func _clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { _sqlite3WindowListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpWinDefn) } for (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _ = libc.Int32FromInt32(0) _sqlite3WindowUnlinkFromSelect(tls, (*TSelect)(unsafe.Pointer(p)).FpWin) } if bFree != 0 { @@ -122440,7 +117449,7 @@ func _clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { // ** Initialize a SelectDest structure. // */ func _sqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) { - (*TSelectDest)(unsafe.Pointer(pDest)).FeDest = uint8(eDest) + (*TSelectDest)(unsafe.Pointer(pDest)).FeDest = libc.Uint8FromInt32(eDest) (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm = iParm (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = 0 (*TSelectDest)(unsafe.Pointer(pDest)).FzAffSdst = uintptr(0) @@ -122465,7 +117474,6 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp pNew = v1 pAllocated = v1 if pNew == uintptr(0) { - _ = libc.Int32FromInt32(0) pNew = bp } if pEList == uintptr(0) { @@ -122479,7 +117487,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp v3 = pParse + 108 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) - (*TSelect)(unsafe.Pointer(pNew)).FselId = uint32(v2) + (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 @@ -122501,7 +117509,6 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp _clearSelect(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pNew, libc.BoolInt32(pNew != bp)) pAllocated = uintptr(0) } else { - _ = libc.Int32FromInt32(0) } return pAllocated } @@ -122619,11 +117626,11 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC p = apAll[i] j = 0 for { - if !(j < int32(libc.Uint32FromInt64(21)/libc.Uint32FromInt64(3))) { + if !(j < libc.Int32FromUint32(libc.Uint32FromInt64(21)/libc.Uint32FromInt64(3))) { break } - if (*TToken)(unsafe.Pointer(p)).Fn == uint32(_aKeyword[j].FnChar) && Xsqlite3_strnicmp(tls, (*TToken)(unsafe.Pointer(p)).Fz, uintptr(unsafe.Pointer(&_zKeyText))+uintptr(_aKeyword[j].Fi), int32((*TToken)(unsafe.Pointer(p)).Fn)) == 0 { - jointype |= int32(_aKeyword[j].Fcode) + if (*TToken)(unsafe.Pointer(p)).Fn == uint32(_aKeyword[j].FnChar) && Xsqlite3_strnicmp(tls, (*TToken)(unsafe.Pointer(p)).Fz, uintptr(unsafe.Pointer(&_zKeyText))+uintptr(_aKeyword[j].Fi), libc.Int32FromUint32((*TToken)(unsafe.Pointer(p)).Fn)) == 0 { + jointype |= libc.Int32FromUint8(_aKeyword[j].Fcode) break } goto _2 @@ -122631,7 +117638,7 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC ; j++ } - if j >= int32(libc.Uint32FromInt64(21)/libc.Uint32FromInt64(3)) { + if j >= libc.Int32FromUint32(libc.Uint32FromInt64(21)/libc.Uint32FromInt64(3)) { jointype |= int32(JT_ERROR) break } @@ -122670,7 +117677,7 @@ var _aKeyword = [7]struct { 1: { Fi: uint8(6), FnChar: uint8(4), - Fcode: uint8(libc.Int32FromInt32(JT_LEFT) | libc.Int32FromInt32(JT_OUTER)), + Fcode: libc.Uint8FromInt32(libc.Int32FromInt32(JT_LEFT) | libc.Int32FromInt32(JT_OUTER)), }, 2: { Fi: uint8(10), @@ -122680,12 +117687,12 @@ var _aKeyword = [7]struct { 3: { Fi: uint8(14), FnChar: uint8(5), - Fcode: uint8(libc.Int32FromInt32(JT_RIGHT) | libc.Int32FromInt32(JT_OUTER)), + Fcode: libc.Uint8FromInt32(libc.Int32FromInt32(JT_RIGHT) | libc.Int32FromInt32(JT_OUTER)), }, 4: { Fi: uint8(19), FnChar: uint8(4), - Fcode: uint8(libc.Int32FromInt32(JT_LEFT) | libc.Int32FromInt32(JT_RIGHT) | libc.Int32FromInt32(JT_OUTER)), + Fcode: libc.Uint8FromInt32(libc.Int32FromInt32(JT_LEFT) | libc.Int32FromInt32(JT_RIGHT) | libc.Int32FromInt32(JT_OUTER)), }, 5: { Fi: uint8(23), @@ -122695,7 +117702,7 @@ var _aKeyword = [7]struct { 6: { Fi: uint8(28), FnChar: uint8(5), - Fcode: uint8(libc.Int32FromInt32(JT_INNER) | libc.Int32FromInt32(JT_CROSS)), + Fcode: libc.Uint8FromInt32(libc.Int32FromInt32(JT_INNER) | libc.Int32FromInt32(JT_CROSS)), }, } @@ -122717,7 +117724,7 @@ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { return i } goto _1 @@ -122737,13 +117744,8 @@ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { func _sqlite3SrcItemColumnUsed(tls *libc.TLS, pItem uintptr, iCol int32) { var pResults uintptr _ = pResults - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x2000>>13)) != 0 { - _ = libc.Int32FromInt32(0) pResults = (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpEList - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) libc.SetBitFieldPtr16Uint32(pResults+8+uintptr(iCol)*20+8+4, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -122763,16 +117765,14 @@ func _sqlite3SrcItemColumnUsed(tls *libc.TLS, pItem uintptr, iCol int32) { func _tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, iStart int32, iEnd int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) (r int32) { var i, iCol int32 _, _ = i, iCol /* Index of column matching zCol */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Both or neither are NULL */ + /* Both or neither are NULL */ i = iStart for { if !(i <= iEnd) { break } iCol = _sqlite3ColumnIndex(tls, (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*68))).FpTab, zCol) - if iCol >= 0 && (bIgnoreHidden == 0 || libc.BoolInt32(int32((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*68))).FpTab)).FaCol+uintptr(iCol)*12)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0) == 0) { + if iCol >= 0 && (bIgnoreHidden == 0 || libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*68))).FpTab)).FaCol+uintptr(iCol)*12)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0) == 0) { if piTab != 0 { _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(i)*68, iCol) *(*int32)(unsafe.Pointer(piTab)) = i @@ -122819,13 +117819,10 @@ func _tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, iStart int32, iEnd int32, func _sqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, joinFlag Tu32) { var i int32 _ = i - _ = libc.Int32FromInt32(0) for p != 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= joinFlag - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(p + 36)) = iTable - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 { i = 0 for { @@ -122865,18 +117862,16 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { var i int32 _ = i for p != 0 { - if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 36)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 36)) == iTable { + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) if iTable >= 0 { - *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(EP_CanBeNull)) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) } - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 { i = 0 for { @@ -122940,16 +117935,16 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if (*TSrcItem)(unsafe.Pointer(pLeft)).FpTab == uintptr(0) || pRightTab == uintptr(0) { goto _1 } - if int32((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_OUTER) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_OUTER) != 0 { v2 = int32(EP_OuterON) } else { v2 = int32(EP_InnerON) } - joinType = uint32(v2) + joinType = libc.Uint32FromInt32(v2) /* If this is a NATURAL join, synthesize an appropriate USING clause ** to specify which columns should be joined. */ - if int32((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pRight + 36 + 4))&0x400>>10)) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 48)) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19050, libc.VaList(bp+16, 0)) @@ -122960,15 +117955,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if !(j < int32((*TTable)(unsafe.Pointer(pRightTab)).FnCol)) { break } /* Name of column in the right table */ - if int32((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pRightTab)).FaCol+uintptr(j)*12)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pRightTab)).FaCol+uintptr(j)*12)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0 { goto _3 } zName = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pRightTab)).FaCol + uintptr(j)*12))).FzCnName if _tableAndColumnIndex(tls, pSrc, 0, i, zName, uintptr(0), uintptr(0), int32(1)) != 0 { pUsing = _sqlite3IdListAppend(tls, pParse, pUsing, uintptr(0)) if pUsing != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*(*TIdList_item)(unsafe.Pointer(pUsing + 8 + uintptr((*TIdList)(unsafe.Pointer(pUsing)).FnId-int32(1))*8))).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zName) } } @@ -122996,7 +117989,6 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if int32(uint32(*(*uint16)(unsafe.Pointer(pRight + 36 + 4))&0x400>>10)) != 0 { pList = *(*uintptr)(unsafe.Pointer(pRight + 48)) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) j = 0 for { if !(j < (*TIdList)(unsafe.Pointer(pList)).FnId) { @@ -123010,7 +118002,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*68, *(*int32)(unsafe.Pointer(bp + 4))) - if int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -123042,10 +118034,8 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) _sqlite3SrcItemColumnUsed(tls, pRight, iRightCol) pEq = _sqlite3PExpr(tls, pParse, int32(TK_EQ), pE1, pE2) - _ = libc.Int32FromInt32(0) if pEq != 0 { *(*Tu32)(unsafe.Pointer(pEq + 4)) |= joinType - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pEq + 36)) = (*TExpr)(unsafe.Pointer(pE2)).FiTable } (*TSelect)(unsafe.Pointer(p)).FpWhere = _sqlite3ExprAnd(tls, pParse, (*TSelect)(unsafe.Pointer(p)).FpWhere, pEq) @@ -123143,13 +118133,12 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp var pKI, pOp, v, v4 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrFirst, addrJmp, bSeq, iCsr, iLimit, iSkip, nBase, nExpr, nKey, nOBSat, op, pKI, pOp, regBase, regPrevKey, regRecord, v, v1, v2, v3, v4, v5 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Stmt under construction */ - bSeq = libc.BoolInt32(int32((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) == 0) + bSeq = libc.BoolInt32(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) == 0) nExpr = (*TExprList)(unsafe.Pointer((*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr /* No. of ORDER BY terms */ nBase = nExpr + bSeq + nData /* Regs for sorter record */ regRecord = 0 /* Assembled sorter record */ nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat /* LIMIT counter */ iSkip = 0 /* End of the sorter insert loop */ - _ = libc.Int32FromInt32(0) /* Three cases: ** (1) The data to be sorted has already been packed into a Record ** by a prior OP_MakeRecord. In this case nData==1 and regData @@ -123163,15 +118152,12 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp ** regOrigData is 0 to prevent this routine from trying to copy ** values that might not yet exist. */ - _ = libc.Int32FromInt32(0) if nPrefixReg != 0 { - _ = libc.Int32FromInt32(0) regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) *(*int32)(unsafe.Pointer(pParse + 44)) += nBase } - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) } else { @@ -123184,7 +118170,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp } else { v2 = 0 } - _sqlite3ExprCodeExprList(tls, pParse, (*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy, regBase, regOrigData, uint8(int32(SQLITE_ECEL_DUP)|v2)) + _sqlite3ExprCodeExprList(tls, pParse, (*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy, regBase, regOrigData, libc.Uint8FromInt32(int32(SQLITE_ECEL_DUP)|v2)) if bSeq != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Sequence), (*TSortCtx)(unsafe.Pointer(pSort)).FiECursor, regBase+nExpr) } @@ -123210,7 +118196,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp pKI = *(*uintptr)(unsafe.Pointer(pOp + 16)) libc.Xmemset(tls, (*TKeyInfo)(unsafe.Pointer(pKI)).FaSortFlags, 0, uint32((*TKeyInfo)(unsafe.Pointer(pKI)).FnKeyField)) /* Makes OP_Jump testable */ _sqlite3VdbeChangeP4(tls, v, -int32(1), pKI, -int32(8)) - *(*uintptr)(unsafe.Pointer(pOp + 16)) = _sqlite3KeyInfoFromExprList(tls, pParse, (*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy, nOBSat, int32((*TKeyInfo)(unsafe.Pointer(pKI)).FnAllField)-int32((*TKeyInfo)(unsafe.Pointer(pKI)).FnKeyField)-int32(1)) + *(*uintptr)(unsafe.Pointer(pOp + 16)) = _sqlite3KeyInfoFromExprList(tls, pParse, (*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy, nOBSat, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKI)).FnAllField)-libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKI)).FnKeyField)-int32(1)) pOp = uintptr(0) /* Ensure pOp not used after sqlite3VdbeAddOp3() */ addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) @@ -123253,7 +118239,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if regRecord == 0 { regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) } - if int32((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { + if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { op = int32(OP_SorterInsert) } else { op = int32(OP_IdxInsert) @@ -123358,7 +118344,6 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a ; i++ } - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_Copy), regElem, regPrev, nResultCol-int32(1)) case int32(WHERE_DISTINCT_UNIQUE): /* nothing to do */ @@ -123406,7 +118391,7 @@ func _fixDistinctOpenEph(tls *libc.TLS, pParse uintptr, eTnctType int32, iVal in if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && (eTnctType == int32(WHERE_DISTINCT_UNIQUE) || eTnctType == int32(WHERE_DISTINCT_ORDERED)) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe _sqlite3VdbeChangeToNoop(tls, v, iOpenEphAddr) - if int32((*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetOp(tls, v, iOpenEphAddr+int32(1)))).Fopcode) == int32(OP_Explain) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetOp(tls, v, iOpenEphAddr+int32(1)))).Fopcode) == int32(OP_Explain) { _sqlite3VdbeChangeToNoop(tls, v, iOpenEphAddr+int32(1)) } if eTnctType == int32(WHERE_DISTINCT_ORDERED) { @@ -123441,14 +118426,12 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS var pEList, pSO, v uintptr var _ /* sRowLoadInfo at bp+0 */ TRowLoadInfo _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr, addrTest, eDest, eType, ecelFlags, hasDistinct, i, i2, iParm, iTab, j, nKey, nPrefixReg, nResultCol, pEList, pSO, r1, r11, r12, r13, r14, r2, r21, r3, regOrig, regResult, v, v1, v2, v5 - v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* True if the DISTINCT keyword is present */ - eDest = int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) /* How to dispose of results */ - iParm = (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm /* Number of result columns */ - nPrefixReg = 0 /* Start of memory holding full result (or 0) */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* True if the DISTINCT keyword is present */ + eDest = libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) /* How to dispose of results */ + iParm = (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm /* Number of result columns */ + nPrefixReg = 0 /* Start of memory holding full result (or 0) */ if pDistinct != 0 { - v1 = int32((*TDistinctCtx)(unsafe.Pointer(pDistinct)).FeTnctType) + v1 = libc.Int32FromUint8((*TDistinctCtx)(unsafe.Pointer(pDistinct)).FeTnctType) } else { v1 = WHERE_DISTINCT_NOOP } @@ -123457,7 +118440,6 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS pSort = uintptr(0) } if pSort == uintptr(0) && !(hasDistinct != 0) { - _ = libc.Int32FromInt32(0) _codeOffset(tls, v, (*TSelect)(unsafe.Pointer(p)).FiOffset, iContinue) } /* Pull the requested columns. @@ -123466,7 +118448,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst == 0 { if pSort != 0 { nPrefixReg = (*TExprList)(unsafe.Pointer((*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr - if !(int32((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { + if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } *(*int32)(unsafe.Pointer(pParse + 44)) += nPrefixReg @@ -123519,10 +118501,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(i < (*TExprList)(unsafe.Pointer((*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr) { break } - v5 = int32(*(*Tu16)(unsafe.Pointer((*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy + 8 + uintptr(i)*20 + 16))) + v5 = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy + 8 + uintptr(i)*20 + 16))) j = v5 if v5 > 0 { - *(*Tu16)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(j-int32(1))*20 + 16)) = uint16(i + int32(1) - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat) + *(*Tu16)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(j-int32(1))*20 + 16)) = libc.Uint16FromInt32(i + int32(1) - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat) } goto _4 _4: @@ -123537,7 +118519,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - if int32(*(*Tu16)(unsafe.Pointer(pEList + 8 + uintptr(i)*20 + 16))) > 0 { + if libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pEList + 8 + uintptr(i)*20 + 16))) > 0 { nResultCol-- regOrig = 0 } @@ -123546,13 +118528,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ; i++ } - _ = libc.Int32FromInt32(0) } (*(*TRowLoadInfo)(unsafe.Pointer(bp))).FregResult = regResult (*(*TRowLoadInfo)(unsafe.Pointer(bp))).FecelFlags = ecelFlags - if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && int32(ecelFlags)&int32(SQLITE_ECEL_OMITREF) != 0 && nPrefixReg > 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && libc.Int32FromUint8(ecelFlags)&int32(SQLITE_ECEL_OMITREF) != 0 && nPrefixReg > 0 { (*TSortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad = bp regOrig = 0 } else { @@ -123565,9 +118544,8 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** part of the result. */ if hasDistinct != 0 { - eType = int32((*TDistinctCtx)(unsafe.Pointer(pDistinct)).FeTnctType) + eType = libc.Int32FromUint8((*TDistinctCtx)(unsafe.Pointer(pDistinct)).FeTnctType) iTab = (*TDistinctCtx)(unsafe.Pointer(pDistinct)).FtabTnct - _ = libc.Int32FromInt32(0) iTab = _codeDistinct(tls, pParse, eType, iTab, iContinue, (*TSelect)(unsafe.Pointer(p)).FpEList, regResult) _fixDistinctOpenEph(tls, pParse, eType, iTab, (*TDistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct) if pSort == uintptr(0) { @@ -123613,10 +118591,8 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS addr = _sqlite3VdbeCurrentAddr(tls, v) + int32(4) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iParm+int32(1), addr, r11, 0) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm+int32(1), r11, regResult, nResultCol) - _ = libc.Int32FromInt32(0) } if pSort != 0 { - _ = libc.Int32FromInt32(0) _pushOntoSorter(tls, pParse, pSort, p, r11+nPrefixReg, regOrig, int32(1), nPrefixReg) } else { r2 = _sqlite3GetTempReg(tls, pParse) @@ -123658,7 +118634,6 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _pushOntoSorter(tls, pParse, pSort, p, regResult, regOrig, nResultCol, nPrefixReg) } else { r13 = _sqlite3GetTempReg(tls, pParse) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regResult, nResultCol, r13, (*TSelectDest)(unsafe.Pointer(pDest)).FzAffSdst, nResultCol) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) _sqlite3ReleaseTempReg(tls, pParse, r13) @@ -123678,11 +118653,8 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS fallthrough case int32(SRT_Mem): if pSort != 0 { - _ = libc.Int32FromInt32(0) _pushOntoSorter(tls, pParse, pSort, p, regResult, regOrig, nResultCol, nPrefixReg) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* The LIMIT clause will jump out of the loop for us */ } case int32(SRT_Coroutine): /* Send data to a co-routine */ @@ -123710,7 +118682,6 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS case int32(SRT_Queue): addrTest = 0 pSO = (*TSelectDest)(unsafe.Pointer(pDest)).FpOrderBy - _ = libc.Int32FromInt32(0) nKey = (*TExprList)(unsafe.Pointer(pSO)).FnExpr r14 = _sqlite3GetTempReg(tls, pParse) r21 = _sqlite3GetTempRange(tls, pParse, nKey+int32(2)) @@ -123731,7 +118702,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(i < nKey) { break } - _sqlite3VdbeAddOp2(tls, v, int32(OP_SCopy), regResult+int32(*(*Tu16)(unsafe.Pointer(pSO + 8 + uintptr(i)*20 + 16)))-int32(1), r21+i) + _sqlite3VdbeAddOp2(tls, v, int32(OP_SCopy), regResult+libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pSO + 8 + uintptr(i)*20 + 16)))-int32(1), r21+i) goto _7 _7: ; @@ -123753,7 +118724,6 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS */ fallthrough default: - _ = libc.Int32FromInt32(0) break } /* Jump to the end of the loop if the LIMIT is reached. Except, if @@ -123775,16 +118745,16 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = int32(uint32(N+X)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt32(1)) - uint32(4)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(24)+uint32(nExtra))) + nExtra = libc.Int32FromUint32(libc.Uint32FromInt32(N+X)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt32(1)) - uint32(4)) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(24)+libc.Uint32FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 20 + uintptr(N+X)*4 - (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = uint16(N) - (*TKeyInfo)(unsafe.Pointer(p)).FnAllField = uint16(N + X) + (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) + (*TKeyInfo)(unsafe.Pointer(p)).FnAllField = libc.Uint16FromInt32(N + X) (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*24, 0, uint32(nExtra)) + libc.Xmemset(tls, p+1*24, 0, libc.Uint32FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -123798,8 +118768,6 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt // */ func _sqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { if p != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TKeyInfo)(unsafe.Pointer(p)).FnRef-- if (*TKeyInfo)(unsafe.Pointer(p)).FnRef == uint32(0) { _sqlite3DbNNFreeNN(tls, (*TKeyInfo)(unsafe.Pointer(p)).Fdb, p) @@ -123814,7 +118782,6 @@ func _sqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { // */ func _sqlite3KeyInfoRef(tls *libc.TLS, p uintptr) (r uintptr) { if p != 0 { - _ = libc.Int32FromInt32(0) (*TKeyInfo)(unsafe.Pointer(p)).FnRef++ } return p @@ -123844,7 +118811,6 @@ func _sqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, i nExpr = (*TExprList)(unsafe.Pointer(pList)).FnExpr pInfo = _sqlite3KeyInfoAlloc(tls, db, nExpr-iStart, nExtra+int32(1)) if pInfo != 0 { - _ = libc.Int32FromInt32(0) i = iStart pItem = pList + 8 + uintptr(iStart)*20 for { @@ -123930,7 +118896,7 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, addrContinue = _sqlite3VdbeMakeLabel(tls, pParse) /* Top of output loop. Jump for Next. */ addrOnce = 0 pOrderBy = (*TSortCtx)(unsafe.Pointer(pSort)).FpOrderBy - eDest = int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) + eDest = libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) iParm = (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm /* True if sorter record includes seq. no. */ nRefKey = 0 aOutEx = (*TSelect)(unsafe.Pointer(p)).FpEList + 8 @@ -123945,7 +118911,6 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } else { _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19302, libc.VaList(bp+8, nKey)) } - _ = libc.Int32FromInt32(0) if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) _sqlite3VdbeGoto(tls, v, addrBreak) @@ -123967,7 +118932,7 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, regRow = _sqlite3GetTempRange(tls, pParse, nColumn) } } - if int32((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { + if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { v3 = pParse + 44 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) @@ -123984,7 +118949,6 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, _sqlite3VdbeJumpHere(tls, v, addrOnce) } addr = int32(1) + _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), iTab, addrBreak) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iTab, regSortOut, iSortTab) bSeq = 0 } else { @@ -124002,7 +118966,7 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, if !(i < nColumn) { break } - if int32(*(*Tu16)(unsafe.Pointer(aOutEx + uintptr(i)*20 + 16))) == 0 { + if libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(aOutEx + uintptr(i)*20 + 16))) == 0 { iCol++ } goto _6 @@ -124016,7 +118980,7 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, break } if *(*Tu16)(unsafe.Pointer(aOutEx + uintptr(i)*20 + 16)) != 0 { - iRead = int32(*(*Tu16)(unsafe.Pointer(aOutEx + uintptr(i)*20 + 16))) - int32(1) + iRead = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(aOutEx + uintptr(i)*20 + 16))) - int32(1) } else { v8 = iCol iCol-- @@ -124037,7 +119001,6 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iParm, regRow, regRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) case int32(SRT_Set): - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regRow, nColumn, regRowid, (*TSelectDest)(unsafe.Pointer(pDest)).FzAffSdst, nColumn) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, regRowid, regRow, nColumn) case int32(SRT_Mem): @@ -124052,7 +119015,6 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r1, regRow, i2) } default: - _ = libc.Int32FromInt32(0) if eDest == int32(SRT_Output) { _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst, nColumn) } else { @@ -124071,7 +119033,7 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, /* The bottom of the loop */ _sqlite3VdbeResolveLabel(tls, v, addrContinue) - if int32((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { + if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterNext), iTab, addr) } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iTab, addr) @@ -124120,9 +119082,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - switch int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) { case int32(TK_COLUMN): /* The expression is a column. Locate the table the column is being ** extracted from in NameContext.pSrcList. This table may be real @@ -124170,7 +119130,6 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr ** branch below. */ break } - _ = libc.Int32FromInt32(0) if pS != 0 { /* The "table" is actually a sub-select or a view in the FROM clause ** of the SELECT statement. Return the declaration type and origin @@ -124185,11 +119144,9 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } } else { /* A real table or a CTE table */ - _ = libc.Int32FromInt32(0) if iCol < 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } - _ = libc.Int32FromInt32(0) if iCol < 0 { zType = __ccgo_ts + 1136 *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 16781 @@ -124204,7 +119161,6 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } } case int32(TK_SELECT): - _ = libc.Int32FromInt32(0) pS1 = *(*uintptr)(unsafe.Pointer(pExpr + 20)) p1 = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pS1)).FpEList + 8))).FpExpr (*(*TNameContext)(unsafe.Pointer(bp + 48))).FpSrcList = (*TSelect)(unsafe.Pointer(pS1)).FpSrc @@ -124214,7 +119170,6 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr break } if pzOrigDb != 0 { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pzOrigDb)) = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(pzOrigTab)) = *(*uintptr)(unsafe.Pointer(bp + 4)) *(*uintptr)(unsafe.Pointer(pzOrigCol)) = *(*uintptr)(unsafe.Pointer(bp + 8)) @@ -124316,8 +119271,6 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) @@ -124328,22 +119281,19 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) break } p = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20))).FpExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Agg processing has not run yet */ - _ = libc.Int32FromInt32(0) /* Covering idx not yet coded */ + /* Agg processing has not run yet */ + /* Covering idx not yet coded */ if (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20))).FzEName != 0 && int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(i)*20 + 8 + 4))&0x3>>0)) == ENAME_NAME { /* An AS clause always takes first priority */ zName = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20))).FzEName _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName, uintptr(-libc.Int32FromInt32(1))) } else { - if srcName != 0 && int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) { + if srcName != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) { iCol = int32((*TExpr)(unsafe.Pointer(p)).FiColumn) pTab = (*TExpr)(unsafe.Pointer(p)).Fy.FpTab - _ = libc.Int32FromInt32(0) if iCol < 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } - _ = libc.Int32FromInt32(0) if iCol < 0 { zCol = __ccgo_ts + 16781 } else { @@ -124413,7 +119363,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+4) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(uint32(12)*uint32(nCol))) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint32(12)*libc.Uint32FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -124421,7 +119371,6 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, nCol = 0 aCol = uintptr(0) } - _ = libc.Int32FromInt32(0) *(*Ti16)(unsafe.Pointer(pnCol)) = int16(nCol) *(*uintptr)(unsafe.Pointer(paCol)) = aCol i = 0 @@ -124439,11 +119388,10 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, /* If the column contains an "AS <name>" phrase, use <name> as the name */ } else { pColExpr = _sqlite3ExprSkipCollateAndLikely(tls, (*TExprList_item)(unsafe.Pointer(pX)).FpExpr) - for pColExpr != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pColExpr)).Fop) == int32(TK_DOT) { + for pColExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pColExpr)).Fop) == int32(TK_DOT) { pColExpr = (*TExpr)(unsafe.Pointer(pColExpr)).FpRight - _ = libc.Int32FromInt32(0) } - if int32((*TExpr)(unsafe.Pointer(pColExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pColExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) && (*TExpr)(unsafe.Pointer(pColExpr)).Fy.FpTab != uintptr(0) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pColExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pColExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) && (*TExpr)(unsafe.Pointer(pColExpr)).Fy.FpTab != uintptr(0) { /* For columns use the column name name */ iCol = int32((*TExpr)(unsafe.Pointer(pColExpr)).FiColumn) pTab = (*TExpr)(unsafe.Pointer(pColExpr)).Fy.FpTab @@ -124457,12 +119405,11 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } zName = v3 } else { - if int32((*TExpr)(unsafe.Pointer(pColExpr)).Fop) == int32(TK_ID) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pColExpr)).Fop) == int32(TK_ID) { zName = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } else { /* Use the original text of the column expression as its name */ - _ = libc.Int32FromInt32(0) /* pointer comparison intended */ + /* pointer comparison intended */ } } } @@ -124491,7 +119438,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if nName > 0 { j = nName - int32(1) for { - if !(j > 0 && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zName + uintptr(j))))])&int32(0x04) != 0) { + if !(j > 0 && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zName + uintptr(j))))])&int32(0x04) != 0) { break } goto _7 @@ -124569,11 +119516,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS var _ /* sNC at bp+0 */ TNameContext _, _, _, _, _, _, _, _, _, _, _, _, _, _ = a, db, i, j, k, m, n, p, pCol, pColl, pS2, zType, p4, p5 db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { return } for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { @@ -124590,7 +119533,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS } m = 0 pS2 = pSelect - *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags) & libc.Int32FromInt32(COLFLAG_NOINSERT)) + *(*Tu32)(unsafe.Pointer(pTab + 28)) |= libc.Uint32FromInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags) & libc.Int32FromInt32(COLFLAG_NOINSERT)) p = (*(*TExprList_item)(unsafe.Pointer(a + uintptr(i)*20))).FpExpr /* pCol->szEst = ... // Column size est for SELECT tables never used */ (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3ExprAffinity(tls, p) @@ -124621,7 +119564,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS (*TColumn)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_BLOB) } } - if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) && int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_CAST) { + if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_CAST) { (*TColumn)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_FLEXNUM) } } @@ -124650,18 +119593,17 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS if zType != 0 { k = int64(_sqlite3Strlen30(tls, zType)) n = int64(_sqlite3Strlen30(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) - (*TColumn)(unsafe.Pointer(pCol)).FzCnName = _sqlite3DbReallocOrFree(tls, db, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, uint64(n+k+int64(2))) + (*TColumn)(unsafe.Pointer(pCol)).FzCnName = _sqlite3DbReallocOrFree(tls, db, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, libc.Uint64FromInt64(n+k+int64(2))) p4 = pCol + 10 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) & ^(libc.Int32FromInt32(COLFLAG_HASTYPE) | libc.Int32FromInt32(COLFLAG_HASCOLL))) if (*TColumn)(unsafe.Pointer(pCol)).FzCnName != 0 { - libc.Xmemcpy(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName+uintptr(n+int64(1)), zType, uint32(k+int64(1))) + libc.Xmemcpy(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName+uintptr(n+int64(1)), zType, libc.Uint32FromInt64(k+int64(1))) p5 = pCol + 10 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) } } pColl = _sqlite3ExprCollSeq(tls, pParse, p) if pColl != 0 { - _ = libc.Int32FromInt32(0) _sqlite3ColumnSetColl(tls, db, pCol, (*TCollSeq)(unsafe.Pointer(pColl)).FzName) } goto _1 @@ -124702,7 +119644,6 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a (*TTable)(unsafe.Pointer(pTab)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pTab)).FzName = uintptr(0) (*TTable)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) - _ = libc.Int32FromInt32(0) _sqlite3ColumnsFromExprList(tls, pParse, (*TSelect)(unsafe.Pointer(pSelect)).FpEList, pTab+34, pTab+4) _sqlite3SubqueryColumnTypes(tls, pParse, pTab, pSelect, aff) (*TTable)(unsafe.Pointer(pTab)).FiPKey = int16(-int32(1)) @@ -124723,7 +119664,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { if (*TParse)(unsafe.Pointer(pParse)).FpVdbe != 0 { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } - if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { + if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) } return _sqlite3VdbeCreate(tls, pParse) @@ -124774,8 +119715,6 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v3 = pParse + 44 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) @@ -124783,14 +119722,13 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int iLimit = v1 (*TSelect)(unsafe.Pointer(p)).FiLimit = v1 v = _sqlite3GetVdbe(tls, pParse) - _ = libc.Int32FromInt32(0) if _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer(pLimit)).FpLeft, bp) != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), *(*int32)(unsafe.Pointer(bp)), iLimit) if *(*int32)(unsafe.Pointer(bp)) == 0 { _sqlite3VdbeGoto(tls, v, iBreak) } else { - if *(*int32)(unsafe.Pointer(bp)) >= 0 && int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) > int32(_sqlite3LogEst(tls, uint64(*(*int32)(unsafe.Pointer(bp))))) { - (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3LogEst(tls, uint64(*(*int32)(unsafe.Pointer(bp)))) + if *(*int32)(unsafe.Pointer(bp)) >= 0 && int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) > int32(_sqlite3LogEst(tls, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp))))) { + (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp)))) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_FixedLimit) } } @@ -124832,7 +119770,6 @@ func _multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) ( } else { pRet = uintptr(0) } - _ = libc.Int32FromInt32(0) /* iCol must be less than p->pEList->nExpr. Otherwise an error would ** have been thrown during name resolution and we would not have gotten ** this far */ @@ -124877,7 +119814,7 @@ func _multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra if (*TExpr)(unsafe.Pointer(pTerm)).Fflags&uint32(EP_Collate) != 0 { pColl = _sqlite3ExprCollSeq(tls, pParse, pTerm) } else { - pColl = _multiSelectCollSeq(tls, pParse, p, int32((*(*struct { + pColl = _multiSelectCollSeq(tls, pParse, p, libc.Int32FromUint16((*(*struct { FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem + 16))).FiOrderByCol)-int32(1)) @@ -124886,7 +119823,6 @@ func _multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra } (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).FpExpr = _sqlite3ExprAddCollateString(tls, pParse, pTerm, (*TCollSeq)(unsafe.Pointer(pColl)).FzName) } - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pRet + 20 + uintptr(i)*4)) = pColl *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pRet)).FaSortFlags + uintptr(i))) = (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags goto _2 @@ -124991,7 +119927,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 - if int32((*TSelect)(unsafe.Pointer(p)).Fop) == int32(TK_UNION) { + if libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop) == int32(TK_UNION) { if pOrderBy != 0 { v5 = int32(SRT_DistQueue) } else { @@ -125088,7 +120024,6 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19466, 0) _sqlite3Select(tls, pParse, p, bp) - _ = libc.Int32FromInt32(0) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ _sqlite3VdbeGoto(tls, v, addrTop) @@ -125129,18 +120064,13 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow = int32(1) rc = 0 bShowAll = libc.BoolInt32((*TSelect)(unsafe.Pointer(p)).FpLimit == uintptr(0)) - _ = libc.Int32FromInt32(0) for cond := true; cond; cond = int32(1) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { return -int32(1) } if (*TSelect)(unsafe.Pointer(p)).FpPrior == uintptr(0) { break } - _ = libc.Int32FromInt32(0) p = (*TSelect)(unsafe.Pointer(p)).FpPrior nRow += bShowAll } @@ -125224,20 +120154,15 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only ** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT. */ - _ = libc.Int32FromInt32(0) /* Calling function guarantees this much */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + /* Calling function guarantees this much */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb pPrior = (*TSelect)(unsafe.Pointer(p)).FpPrior *(*TSelectDest)(unsafe.Pointer(bp)) = *(*TSelectDest)(unsafe.Pointer(pDest)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v = _sqlite3GetVdbe(tls, pParse) - _ = libc.Int32FromInt32(0) /* The VDBE already created by calling function */ + /* The VDBE already created by calling function */ /* Create the destination temporary table if necessary */ - if int32((*(*TSelectDest)(unsafe.Pointer(bp))).FeDest) == int32(SRT_EphemTab) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*(*TSelectDest)(unsafe.Pointer(bp))).FeDest) == int32(SRT_EphemTab) { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr) (*(*TSelectDest)(unsafe.Pointer(bp))).FeDest = uint8(SRT_Table) } @@ -125253,8 +120178,6 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* Make sure all SELECTs in the statement have the same number of elements ** in their result sets. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Recursive) != uint32(0) && _hasAnchor(tls, p) != 0 { _generateWithRecursiveQuery(tls, pParse, p, bp) } else { @@ -125269,11 +120192,10 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in } /* Generate code for the left and right SELECT statements. */ - switch int32((*TSelect)(unsafe.Pointer(p)).Fop) { + switch libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop) { case int32(TK_ALL): addr = 0 *(*int32)(unsafe.Pointer(bp + 28)) = 0 /* Initialize to suppress harmless compiler warning */ - _ = libc.Int32FromInt32(0) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = (*TSelect)(unsafe.Pointer(p)).FiLimit (*TSelect)(unsafe.Pointer(pPrior)).FiOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(pPrior)).FpLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit @@ -125296,8 +120218,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3LogEstAdd(tls, (*TSelect)(unsafe.Pointer(p)).FnSelectRow, (*TSelect)(unsafe.Pointer(pPrior)).FnSelectRow) - if (*TSelect)(unsafe.Pointer(p)).FpLimit != 0 && _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpLimit)).FpLeft, bp+28) != 0 && *(*int32)(unsafe.Pointer(bp + 28)) > 0 && int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) > int32(_sqlite3LogEst(tls, uint64(*(*int32)(unsafe.Pointer(bp + 28))))) { - (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3LogEst(tls, uint64(*(*int32)(unsafe.Pointer(bp + 28)))) + if (*TSelect)(unsafe.Pointer(p)).FpLimit != 0 && _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpLimit)).FpLeft, bp+28) != 0 && *(*int32)(unsafe.Pointer(bp + 28)) > 0 && int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) > int32(_sqlite3LogEst(tls, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 28))))) { + (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 28)))) } if addr != 0 { _sqlite3VdbeJumpHere(tls, v, addr) @@ -125307,11 +120229,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in case int32(TK_UNION): /* Cursor number of the temp table holding result */ op = uint8(0) priorOp = int32(SRT_Union) - if int32((*(*TSelectDest)(unsafe.Pointer(bp))).FeDest) == priorOp { + if libc.Int32FromUint8((*(*TSelectDest)(unsafe.Pointer(bp))).FeDest) == priorOp { /* We can reuse a temporary table generated by a SELECT to our ** right. */ - _ = libc.Int32FromInt32(0) /* Not allowed on leftward elements */ + /* Not allowed on leftward elements */ unionTab = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm } else { /* We will need to create our own temporary table to hold the @@ -125321,16 +120243,12 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 - _ = libc.Int32FromInt32(0) addr1 = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), unionTab, 0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(p + 20)) = addr1 *(*Tu32)(unsafe.Pointer(_findRightmost(tls, p) + 4)) |= uint32(SF_UsesEphemeral) - _ = libc.Int32FromInt32(0) } /* Code the SELECT statements to our left */ - _ = libc.Int32FromInt32(0) _sqlite3SelectDestInit(tls, bp+32, priorOp, unionTab) rc = _sqlite3Select(tls, pParse, pPrior, bp+32) if rc != 0 { @@ -125338,23 +120256,21 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in } /* Code the current SELECT statement */ - if int32((*TSelect)(unsafe.Pointer(p)).Fop) == int32(TK_EXCEPT) { + if libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop) == int32(TK_EXCEPT) { op = uint8(SRT_Except) } else { - _ = libc.Int32FromInt32(0) op = uint8(SRT_Union) } (*TSelect)(unsafe.Pointer(p)).FpPrior = uintptr(0) pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 32))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19540, libc.VaList(bp+96, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19540, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+32) - _ = libc.Int32FromInt32(0) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) - if int32((*TSelect)(unsafe.Pointer(p)).Fop) == int32(TK_UNION) { + if libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop) == int32(TK_UNION) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3LogEstAdd(tls, (*TSelect)(unsafe.Pointer(p)).FnSelectRow, (*TSelect)(unsafe.Pointer(pPrior)).FnSelectRow) } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) @@ -125364,9 +120280,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* Convert the data in the temporary table into whatever form ** it is that we currently need. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*(*TSelectDest)(unsafe.Pointer(bp))).FeDest) != priorOp && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if libc.Int32FromUint8((*(*TSelectDest)(unsafe.Pointer(bp))).FeDest) != priorOp && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { iBreak = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) _computeLimitRegisters(tls, pParse, p, iBreak) @@ -125379,7 +120293,6 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp2(tls, v, int32(OP_Close), unionTab, 0) } default: - _ = libc.Int32FromInt32(0) /* INTERSECT is different from the others since it requires ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. @@ -125392,12 +120305,9 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 - _ = libc.Int32FromInt32(0) addr2 = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), tab1, 0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(p + 20)) = addr2 *(*Tu32)(unsafe.Pointer(_findRightmost(tls, p) + 4)) |= uint32(SF_UsesEphemeral) - _ = libc.Int32FromInt32(0) /* Code the SELECTs to our left into temporary table "tab1". */ _sqlite3SelectDestInit(tls, bp+60, int32(SRT_Union), tab1) @@ -125408,13 +120318,12 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* Code the current SELECT into temporary table "tab2" */ addr2 = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), tab2, 0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(p + 20 + 1*4)) = addr2 (*TSelect)(unsafe.Pointer(p)).FpPrior = uintptr(0) pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 60))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19540, libc.VaList(bp+96, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19540, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+60) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -125429,7 +120338,6 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in if rc != 0 { break } - _ = libc.Int32FromInt32(0) iBreak1 = _sqlite3VdbeMakeLabel(tls, pParse) iCont1 = _sqlite3VdbeMakeLabel(tls, pParse) _computeLimitRegisters(tls, pParse, p, iBreak1) @@ -125464,8 +120372,6 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** no temp tables are required. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_UsesEphemeral) != 0 { /* Number of columns in result set */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) nCol = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr pKeyInfo = _sqlite3KeyInfoAlloc(tls, db, nCol, int32(1)) if !(pKeyInfo != 0) { @@ -125502,7 +120408,6 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in if addr3 < 0 { /* If [0] is unused then [1] is also unused. So we can ** always safely abort as soon as the first unused slot is found */ - _ = libc.Int32FromInt32(0) break } _sqlite3VdbeChangeP2(tls, v, addr3, nCol) @@ -125543,7 +120448,7 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19561, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19607, libc.VaList(bp+8, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19607, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -125592,9 +120497,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin /* Suppress the first OFFSET entries if there is an OFFSET clause */ _codeOffset(tls, v, (*TSelect)(unsafe.Pointer(p)).FiOffset, iContinue) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - switch int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) { + switch libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) { /* Store the result as data using a unique key. */ case int32(SRT_EphemTab): @@ -125648,7 +120551,6 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin */ fallthrough default: - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) break } @@ -125761,19 +120663,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aPermute, addr1, addrAeqB, addrAgtB, addrAltB, addrEofA, addrEofA_noB, addrEofB, addrOutA, addrOutB, addrSelectA, addrSelectB, db, i, j, labelCmpr, labelEnd, nExpr, nOrderBy, nSelect, op, pItem, pItem1, pKeyDup, pKeyMerge, pNew, pOrderBy, pPrior, pSplit, regAddrA, regAddrB, regLimitA, regLimitB, regOutA, regOutB, regPrev, savedLimit, savedOffset, v, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v3, v4, v9 /* Address of the output-A subroutine */ addrOutB = 0 /* One of TK_ALL, TK_UNION, TK_EXCEPT, TK_INTERSECT */ pKeyDup = uintptr(0) /* Mapping from ORDER BY terms to result set columns */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* "Managed" code needs this. Ticket #3382. */ + /* "Managed" code needs this. Ticket #3382. */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) /* Already thrown the error if VDBE alloc failed */ + /* Already thrown the error if VDBE alloc failed */ labelEnd = _sqlite3VdbeMakeLabel(tls, pParse) labelCmpr = _sqlite3VdbeMakeLabel(tls, pParse) /* Patch up the ORDER BY clause */ - op = int32((*TSelect)(unsafe.Pointer(p)).Fop) - _ = libc.Int32FromInt32(0) + op = libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop) pOrderBy = (*TSelect)(unsafe.Pointer(p)).FpOrderBy - _ = libc.Int32FromInt32(0) nOrderBy = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr /* For operators other than UNION ALL we have to make sure that ** the ORDER BY clause covers every term of the result set. Add @@ -125782,7 +120681,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr if op != int32(TK_ALL) { i = int32(1) for { - if !(int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && i <= (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr) { + if !(libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && i <= (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr) { break } j = 0 @@ -125791,9 +120690,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr if !(j < nOrderBy) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*(*struct { + if libc.Int32FromUint16((*(*struct { FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem + 16))).FiOrderByCol) == i { @@ -125818,7 +120715,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr if pOrderBy != 0 { v4 = nOrderBy nOrderBy++ - *(*Tu16)(unsafe.Pointer(pOrderBy + 8 + uintptr(v4)*20 + 16)) = uint16(i) + *(*Tu16)(unsafe.Pointer(pOrderBy + 8 + uintptr(v4)*20 + 16)) = libc.Uint16FromInt32(i) } } goto _1 @@ -125834,19 +120731,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*uint32(nOrderBy+libc.Int32FromInt32(1)))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*libc.Uint32FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { - *(*Tu32)(unsafe.Pointer(aPermute)) = uint32(nOrderBy) + *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) pItem1 = pOrderBy + 8 for { if !(i <= nOrderBy) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(aPermute + uintptr(i)*4)) = uint32(int32((*(*struct { + *(*Tu32)(unsafe.Pointer(aPermute + uintptr(i)*4)) = libc.Uint32FromInt32(libc.Int32FromUint16((*(*struct { FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem1 + 16))).FiOrderByCol) - int32(1)) @@ -125868,13 +120762,11 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr regPrev = 0 } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr - _ = libc.Int32FromInt32(0) regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) *(*int32)(unsafe.Pointer(pParse + 44)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < nExpr) { @@ -125892,14 +120784,13 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr /* Separate the left and the right query from one another */ nSelect = int32(1) - if (op == int32(TK_ALL) || op == int32(TK_UNION)) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_BalancedMerge)) == uint32(0) { + if (op == int32(TK_ALL) || op == int32(TK_UNION)) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BalancedMerge)) == uint32(0) { pSplit = p for { - if !((*TSelect)(unsafe.Pointer(pSplit)).FpPrior != uintptr(0) && int32((*TSelect)(unsafe.Pointer(pSplit)).Fop) == op) { + if !((*TSelect)(unsafe.Pointer(pSplit)).FpPrior != uintptr(0) && libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pSplit)).Fop) == op) { break } nSelect++ - _ = libc.Int32FromInt32(0) goto _7 _7: ; @@ -125923,11 +120814,8 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } } pPrior = (*TSelect)(unsafe.Pointer(pSplit)).FpPrior - _ = libc.Int32FromInt32(0) (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7492) _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7492) @@ -125974,7 +120862,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+28, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19689, libc.VaList(bp+64, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19689, libc.VaList(bp+64, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ @@ -126164,20 +121052,17 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pExpr == uintptr(0) { return uintptr(0) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) && *(*int32)(unsafe.Pointer(pExpr + 36)) == (*TSubstContext)(unsafe.Pointer(pSubst)).FiTable { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) && *(*int32)(unsafe.Pointer(pExpr + 36)) == (*TSubstContext)(unsafe.Pointer(pSubst)).FiTable { *(*int32)(unsafe.Pointer(pExpr + 36)) = (*TSubstContext)(unsafe.Pointer(pSubst)).FiNewTable } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TSubstContext)(unsafe.Pointer(pSubst)).FiTable && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_FixedCol)) != libc.Uint32FromInt32(0)) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TSubstContext)(unsafe.Pointer(pSubst)).FiTable && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) != libc.Uint32FromInt32(0)) { iColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCopy = (*(*TExprList_item)(unsafe.Pointer((*TSubstContext)(unsafe.Pointer(pSubst)).FpEList + 8 + uintptr(iColumn)*20))).FpExpr if _sqlite3ExprIsVector(tls, pCopy) != 0 { _sqlite3VectorErrorMsg(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pCopy) } else { db = (*TParse)(unsafe.Pointer((*TSubstContext)(unsafe.Pointer(pSubst)).FpParse)).Fdb - if (*TSubstContext)(unsafe.Pointer(pSubst)).FisOuterJoin != 0 && (int32((*TExpr)(unsafe.Pointer(pCopy)).Fop) != int32(TK_COLUMN) || (*TExpr)(unsafe.Pointer(pCopy)).FiTable != (*TSubstContext)(unsafe.Pointer(pSubst)).FiNewTable) { + if (*TSubstContext)(unsafe.Pointer(pSubst)).FisOuterJoin != 0 && (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCopy)).Fop) != int32(TK_COLUMN) || (*TExpr)(unsafe.Pointer(pCopy)).FiTable != (*TSubstContext)(unsafe.Pointer(pSubst)).FiNewTable) { libc.Xmemset(tls, bp, 0, uint32(52)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_IF_NULL_ROW) (*(*TExpr)(unsafe.Pointer(bp))).FpLeft = pCopy @@ -126192,23 +121077,23 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { return pExpr } if (*TSubstContext)(unsafe.Pointer(pSubst)).FisOuterJoin != 0 { - *(*Tu32)(unsafe.Pointer(pNew + 4)) |= uint32(libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { - _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 36)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { + _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 36)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } _sqlite3ExprDelete(tls, db, pExpr) pExpr = pNew - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRUEFALSE) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRUEFALSE) { *(*int32)(unsafe.Pointer(pExpr + 8)) = _sqlite3ExprTruthValue(tls, pExpr) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_INTEGER) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_IntValue)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) } /* Ensure that the expression now has an implicit collation sequence, ** just as it did when it was a column of a view or sub-query. */ pNat = _sqlite3ExprCollSeq(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pExpr) pColl = _sqlite3ExprCollSeq(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, (*(*TExprList_item)(unsafe.Pointer((*TSubstContext)(unsafe.Pointer(pSubst)).FpCList + 8 + uintptr(iColumn)*20))).FpExpr) - if pNat != pColl || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLLATE) { + if pNat != pColl || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLLATE) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { @@ -126216,10 +121101,10 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { } pExpr = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pExpr, v1) } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) } } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IF_NULL_ROW) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TSubstContext)(unsafe.Pointer(pSubst)).FiTable { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IF_NULL_ROW) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TSubstContext)(unsafe.Pointer(pSubst)).FiTable { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TSubstContext)(unsafe.Pointer(pSubst)).FiNewTable } (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _substExpr(tls, pSubst, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) @@ -126229,7 +121114,7 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { } else { _substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 20))) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { pWin = *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)) (*TWindow)(unsafe.Pointer(pWin)).FpFilter = _substExpr(tls, pSubst, (*TWindow)(unsafe.Pointer(pWin)).FpFilter) _substExprList(tls, pSubst, (*TWindow)(unsafe.Pointer(pWin)).FpPartition) @@ -126273,7 +121158,6 @@ func _substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { (*TSelect)(unsafe.Pointer(p)).FpHaving = _substExpr(tls, pSubst, (*TSelect)(unsafe.Pointer(p)).FpHaving) (*TSelect)(unsafe.Pointer(p)).FpWhere = _substExpr(tls, pSubst, (*TSelect)(unsafe.Pointer(p)).FpWhere) pSrc = (*TSelect)(unsafe.Pointer(p)).FpSrc - _ = libc.Int32FromInt32(0) i = (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc pItem = pSrc + 8 for { @@ -126315,7 +121199,7 @@ func _substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { func _recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { var pItem uintptr _ = pItem - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } pItem = *(*uintptr)(unsafe.Pointer(pWalker + 24)) @@ -126370,7 +121254,6 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr break } if i != iExcept { - _ = libc.Int32FromInt32(0) if !(int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x40>>6)) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { v3 = pParse + 40 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -126423,11 +121306,11 @@ func _renumberCursorDoMapping(tls *libc.TLS, pWalker uintptr, piCursor uintptr) func _renumberCursorsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { var op int32 _ = op - op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) if op == int32(TK_COLUMN) || op == int32(TK_IF_NULL_ROW) { _renumberCursorDoMapping(tls, pWalker, pExpr+28) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { _renumberCursorDoMapping(tls, pWalker, pExpr+36) } return WRC_Continue @@ -126490,25 +121373,18 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { var ii int32 var pList, pSub1 uintptr _, _, _, _ = aff, ii, pList, pSub1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pList = (*TSelect)(unsafe.Pointer(p)).FpEList ii = 0 for { if !(ii < (*TExprList)(unsafe.Pointer(pList)).FnExpr) { break } - _ = libc.Int32FromInt32(0) aff = _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*20))).FpExpr) pSub1 = (*TSelect)(unsafe.Pointer(p)).FpPrior for { if !(pSub1 != 0) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(_sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub1)).FpEList + 8 + uintptr(ii)*20))).FpExpr)) != int32(aff) { return int32(1) } @@ -126716,22 +121592,17 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA aCsrMap = uintptr(0) /* Check to see if flattening is permitted. Return 0 if not. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_QueryFlattener)) != uint32(0) { + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_QueryFlattener)) != uint32(0) { return 0 } pSrc = (*TSelect)(unsafe.Pointer(p)).FpSrc - _ = libc.Int32FromInt32(0) pSubitem = pSrc + 8 + uintptr(iFrom)*68 iParent = (*TSrcItem)(unsafe.Pointer(pSubitem)).FiCursor pSub = (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSelect - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 || (*TSelect)(unsafe.Pointer(pSub)).FpWin != 0 { return 0 } /* Restriction (25) */ pSubSrc = (*TSelect)(unsafe.Pointer(pSub)).FpSrc - _ = libc.Int32FromInt32(0) /* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants, ** not arbitrary expressions, we allowed some combining of LIMIT and OFFSET ** because they could be computed at compile-time. But when LIMIT and OFFSET @@ -126767,7 +121638,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) { return 0 /* Restriction (21) */ } - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(libc.Int32FromInt32(SF_Recursive)) != 0 { + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Recursive)) != 0 { return 0 /* Restrictions (22) */ } /* @@ -126785,18 +121656,17 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** ** See also tickets #306, #350, and #3300. */ - if int32((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || int32((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) } - _ = libc.Int32FromInt32(0) /* True by restriction (7) */ - if iFrom > 0 && int32((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + /* True by restriction (7) */ + if iFrom > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { return 0 /* Restriction (27a) */ } /* Condition (28) is blocked by the caller */ - _ = libc.Int32FromInt32(0) /* Restriction (17): If the sub-query is a compound SELECT, then it must ** use only the UNION ALL operator. And none of the simple select queries ** that make up the compound SELECT are allowed to be aggregate or distinct @@ -126814,13 +121684,10 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if !(pSub1 != 0) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TSelect)(unsafe.Pointer(pSub1)).FselFlags&uint32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) != uint32(0) || (*TSelect)(unsafe.Pointer(pSub1)).FpPrior != 0 && int32((*TSelect)(unsafe.Pointer(pSub1)).Fop) != int32(TK_ALL) || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub1)).FpSrc)).FnSrc < int32(1) || (*TSelect)(unsafe.Pointer(pSub1)).FpWin != 0 { + if (*TSelect)(unsafe.Pointer(pSub1)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) != uint32(0) || (*TSelect)(unsafe.Pointer(pSub1)).FpPrior != 0 && libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pSub1)).Fop) != int32(TK_ALL) || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub1)).FpSrc)).FnSrc < int32(1) || (*TSelect)(unsafe.Pointer(pSub1)).FpWin != 0 { return 0 } - if iFrom > 0 && int32((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub1)).FpSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if iFrom > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub1)).FpSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { /* Without this restriction, the JT_LTORJ flag would end up being ** omitted on left-hand tables of the right join that is being ** flattened. */ @@ -126838,7 +121705,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if !(ii < (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpOrderBy)).FnExpr) { break } - if int32(*(*Tu16)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpOrderBy + 8 + uintptr(ii)*20 + 16))) == 0 { + if libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpOrderBy + 8 + uintptr(ii)*20 + 16))) == 0 { return 0 } goto _2 @@ -126859,10 +121726,10 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if (*TParse)(unsafe.Pointer(pParse)).FnSelect > int32(500) { return 0 } - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_FlttnUnionAll)) != uint32(0) { + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FlttnUnionAll)) != uint32(0) { return 0 } - aCsrMap = _sqlite3DbMallocZero(tls, db, uint64((int64((*TParse)(unsafe.Pointer(pParse)).FnTab)+int64(1))*int64(4))) + aCsrMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((int64((*TParse)(unsafe.Pointer(pParse)).FnTab)+int64(1))*int64(4))) if aCsrMap != 0 { *(*int32)(unsafe.Pointer(aCsrMap)) = (*TParse)(unsafe.Pointer(pParse)).FnTab } @@ -126882,7 +121749,6 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA (*TSrcItem)(unsafe.Pointer(pSubitem)).FzName = uintptr(0) (*TSrcItem)(unsafe.Pointer(pSubitem)).FzAlias = uintptr(0) (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSelect = uintptr(0) - _ = libc.Int32FromInt32(0) /* If the sub-query is a compound SELECT statement, then (by restrictions ** 17 and 18 above) it must be a UNION ALL and the parent query must ** be of the form: @@ -126940,8 +121806,8 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA v5 = pParse + 108 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) - (*TSelect)(unsafe.Pointer(pNew)).FselId = uint32(v4) - if aCsrMap != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) + if aCsrMap != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { _renumberCursors(tls, pParse, pNew, iFrom, aCsrMap) } (*TSelect)(unsafe.Pointer(pNew)).FpPrior = pPrior @@ -126951,7 +121817,6 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA (*TSelect)(unsafe.Pointer(pNew)).FpNext = p (*TSelect)(unsafe.Pointer(p)).FpPrior = pNew } - _ = libc.Int32FromInt32(0) goto _3 _3: ; @@ -127004,8 +121869,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA break } jointype = uint8(0) - ltorj = uint8(int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(iFrom)*68))).Ffg.Fjointype) & int32(JT_LTORJ)) - _ = libc.Int32FromInt32(0) + ltorj = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(iFrom)*68))).Ffg.Fjointype) & int32(JT_LTORJ)) pSubSrc = (*TSelect)(unsafe.Pointer(pSub)).FpSrc /* FROM clause of subquery */ nSubSrc = (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc /* Number of terms in subquery FROM clause */ pSrc = (*TSelect)(unsafe.Pointer(pParent)).FpSrc /* FROM clause of the outer query */ @@ -127046,10 +121910,9 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x400>>10)) != 0 { _sqlite3IdListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 48))) } - _ = libc.Int32FromInt32(0) *(*TSrcItem)(unsafe.Pointer(pItem)) = *(*TSrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*68)) p9 = pItem + 36 - *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) | int32(ltorj)) + *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) | libc.Int32FromUint8(ltorj)) iNewParent = (*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*68))).FiCursor libc.Xmemset(tls, pSubSrc+8+uintptr(i)*68, 0, uint32(68)) goto _8 @@ -127060,7 +121923,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA p10 = pSrc + 8 + uintptr(iFrom)*68 + 36 *(*Tu8)(unsafe.Pointer(p10)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p10))) & libc.Int32FromInt32(JT_LTORJ)) p11 = pSrc + 8 + uintptr(iFrom)*68 + 36 - *(*Tu8)(unsafe.Pointer(p11)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p11))) | (int32(jointype) | int32(ltorj))) + *(*Tu8)(unsafe.Pointer(p11)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p11))) | (libc.Int32FromUint8(jointype) | libc.Int32FromUint8(ltorj))) /* Now begin substituting subquery result set expressions for ** references to the iParent in the outer query. ** @@ -127096,7 +121959,6 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ; i++ } - _ = libc.Int32FromInt32(0) (*TSelect)(unsafe.Pointer(pParent)).FpOrderBy = pOrderBy1 (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0) } @@ -127112,7 +121974,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA (*TSelect)(unsafe.Pointer(pParent)).FpWhere = pWhere } } - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { (*(*TSubstContext)(unsafe.Pointer(bp + 28))).FpParse = pParse (*(*TSubstContext)(unsafe.Pointer(bp + 28))).FiTable = iParent (*(*TSubstContext)(unsafe.Pointer(bp + 28))).FiNewTable = iNewParent @@ -127124,7 +121986,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA /* The flattened query is a compound if either the inner or the ** outer query is a compound. */ *(*Tu32)(unsafe.Pointer(pParent + 4)) |= (*TSelect)(unsafe.Pointer(pSub)).FselFlags & uint32(SF_Compound) - _ = libc.Int32FromInt32(0) /* restriction (17b) */ + /* restriction (17b) */ /* ** SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y; ** @@ -127206,9 +122068,7 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr var i int32 var pE2 uintptr _, _ = i, pE2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TExpr)(unsafe.Pointer(pColumn)).Fflags&uint32(libc.Int32FromInt32(EP_FixedCol)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pColumn)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) != uint32(0) { return } if int32(_sqlite3ExprAffinity(tls, pValue)) != 0 { @@ -127225,7 +122085,6 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr break } pE2 = *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2))*4)) - _ = libc.Int32FromInt32(0) if (*TExpr)(unsafe.Pointer(pE2)).FiTable == (*TExpr)(unsafe.Pointer(pColumn)).FiTable && int32((*TExpr)(unsafe.Pointer(pE2)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) { return /* Already present. Return without doing anything. */ } @@ -127238,7 +122097,7 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(uint32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint32(4))) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint32FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint32(4))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -127264,22 +122123,20 @@ func _findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn != uint32(0) { return } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AND) { _findConstInWhere(tls, pConst, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) _findConstInWhere(tls, pConst, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) return } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) { return } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_COLUMN) && _sqlite3ExprIsConstant(tls, (*TWhereConst)(unsafe.Pointer(pConst)).FpParse, pLeft) != 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_COLUMN) && _sqlite3ExprIsConstant(tls, (*TWhereConst)(unsafe.Pointer(pConst)).FpParse, pLeft) != 0 { _constInsert(tls, pConst, pRight, pLeft, pExpr) } - if int32((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_COLUMN) && _sqlite3ExprIsConstant(tls, (*TWhereConst)(unsafe.Pointer(pConst)).FpParse, pRight) != 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_COLUMN) && _sqlite3ExprIsConstant(tls, (*TWhereConst)(unsafe.Pointer(pConst)).FpParse, pRight) != 0 { _constInsert(tls, pConst, pLeft, pRight, pExpr) } } @@ -127302,7 +122159,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if *(*Tu8)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpOomFault)) != 0 { return int32(WRC_Prune) } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { @@ -127328,9 +122185,8 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Leaf)) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FixedCol)) - _ = libc.Int32FromInt32(0) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*4)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Prune) @@ -127366,12 +122222,8 @@ func _propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr var pConst uintptr _ = pConst pConst = *(*uintptr)(unsafe.Pointer(pWalker + 24)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob != 0 { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) >= int32(TK_EQ) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) <= int32(TK_GE) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) >= int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) <= int32(TK_GE) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) { _propagateConstantExprRewriteOne(tls, pConst, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, 0) if *(*Tu8)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpOomFault)) != 0 { return int32(WRC_Prune) @@ -127452,10 +122304,10 @@ func _propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*(*TWhereConst)(unsafe.Pointer(bp))).FnChng = 0 (*(*TWhereConst)(unsafe.Pointer(bp))).FapExpr = uintptr(0) (*(*TWhereConst)(unsafe.Pointer(bp))).FbHasAffBlob = 0 - if (*TSelect)(unsafe.Pointer(p)).FpSrc != uintptr(0) && (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc > 0 && int32((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpSrc != uintptr(0) && (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { /* Do not propagate constants on any ON clause if there is a ** RIGHT JOIN anywhere in the query */ - (*(*TWhereConst)(unsafe.Pointer(bp))).FmExcludeOn = uint32(libc.Int32FromInt32(EP_InnerON) | libc.Int32FromInt32(EP_OuterON)) + (*(*TWhereConst)(unsafe.Pointer(bp))).FmExcludeOn = libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON) | libc.Int32FromInt32(EP_OuterON)) } else { /* Do not propagate constants through the ON clause of a LEFT JOIN */ (*(*TWhereConst)(unsafe.Pointer(bp))).FmExcludeOn = uint32(EP_OuterON) @@ -127498,9 +122350,6 @@ func _propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { // ** * that the window frame has a PARTITION BY clause. // */ func _pushDownWindowCheck(tls *libc.TLS, pParse uintptr, pSubq uintptr, pExpr uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return _sqlite3ExprIsConstantOrGroupBy(tls, pParse, pExpr, (*TWindow)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSubq)).FpWin)).FpPartition) } @@ -127626,10 +122475,10 @@ func _pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere ui if pWhere == uintptr(0) { return 0 } - if (*TSelect)(unsafe.Pointer(pSubq)).FselFlags&uint32(libc.Int32FromInt32(SF_Recursive)|libc.Int32FromInt32(SF_MultiPart)) != 0 { + if (*TSelect)(unsafe.Pointer(pSubq)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Recursive)|libc.Int32FromInt32(SF_MultiPart)) != 0 { return 0 /* restrictions (2) and (11) */ } - if int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { return 0 /* restrictions (10) */ } if (*TSelect)(unsafe.Pointer(pSubq)).FpPrior != 0 { @@ -127640,8 +122489,7 @@ func _pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere ui break } op = (*TSelect)(unsafe.Pointer(pSel)).Fop - _ = libc.Int32FromInt32(0) - if int32(op) != int32(TK_ALL) && int32(op) != int32(TK_SELECT) { + if libc.Int32FromUint8(op) != int32(TK_ALL) && libc.Int32FromUint8(op) != int32(TK_SELECT) { notUnionAll = int32(1) } if (*TSelect)(unsafe.Pointer(pSel)).FpWin != 0 { @@ -127662,7 +122510,6 @@ func _pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere ui break } pList = (*TSelect)(unsafe.Pointer(pSel)).FpEList - _ = libc.Int32FromInt32(0) ii = 0 for { if !(ii < (*TExprList)(unsafe.Pointer(pList)).FnExpr) { @@ -127691,7 +122538,7 @@ func _pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere ui if (*TSelect)(unsafe.Pointer(pSubq)).FpLimit != uintptr(0) { return 0 /* restriction (3) */ } - for int32((*TExpr)(unsafe.Pointer(pWhere)).Fop) == int32(TK_AND) { + for libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pWhere)).Fop) == int32(TK_AND) { nChng += _pushDownWhereTerms(tls, pParse, pSubq, (*TExpr)(unsafe.Pointer(pWhere)).FpRight, pSrcList, iSrc) pWhere = (*TExpr)(unsafe.Pointer(pWhere)).FpLeft } @@ -127742,24 +122589,20 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) var v5 uint64 _, _, _, _, _, _, _, _, _, _, _, _, _ = colUsed, iCol, j, m, nChng, nCol, pList, pSub, pTab, pX, pY, v3, v5 /* Column number */ nChng = 0 /* Columns that may not be NULLed out */ - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x8>>3)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x100>>8)) != 0 { return 0 } - _ = libc.Int32FromInt32(0) pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab - _ = libc.Int32FromInt32(0) pSub = (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect - _ = libc.Int32FromInt32(0) pX = pSub for { if !(pX != 0) { break } - if (*TSelect)(unsafe.Pointer(pX)).FselFlags&uint32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) != uint32(0) { + if (*TSelect)(unsafe.Pointer(pX)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) != uint32(0) { return 0 } - if (*TSelect)(unsafe.Pointer(pX)).FpPrior != 0 && int32((*TSelect)(unsafe.Pointer(pX)).Fop) != int32(TK_ALL) { + if (*TSelect)(unsafe.Pointer(pX)).FpPrior != 0 && libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pX)).Fop) != int32(TK_ALL) { /* This optimization does not work for compound subqueries that ** use UNION, INTERSECT, or EXCEPT. Only UNION ALL is allowed. */ return 0 @@ -127783,12 +122626,12 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) break } iCol = *(*Tu16)(unsafe.Pointer(pList + 8 + uintptr(j)*20 + 16)) - if int32(iCol) > 0 { + if libc.Int32FromUint16(iCol) > 0 { iCol-- - if int32(iCol) >= int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - v3 = int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) + if libc.Int32FromUint16(iCol) >= libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { + v3 = libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) } else { - v3 = int32(iCol) + v3 = libc.Int32FromUint16(iCol) } colUsed |= libc.Uint64FromInt32(1) << v3 } @@ -127804,10 +122647,10 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) if !(j < nCol) { break } - if j < int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { + if j < libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { v5 = libc.Uint64FromInt32(1) << j } else { - v5 = libc.Uint64FromInt32(1) << (int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1)) + v5 = libc.Uint64FromInt32(1) << (libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1)) } m = v5 if m&colUsed != uint64(0) { @@ -127819,11 +122662,11 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) break } pY = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pX)).FpEList + 8 + uintptr(j)*20))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pY)).Fop) == int32(TK_NULL) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pY)).Fop) == int32(TK_NULL) { goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= uint32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -127864,15 +122707,10 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r _, _, _, _, _, _ = eRet, pEList, pOrderBy, sortFlags, zFunc, v1 eRet = WHERE_ORDERBY_NORMAL sortFlags = uint8(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pEList = *(*uintptr)(unsafe.Pointer(pFunc + 20)) - if pEList == uintptr(0) || (*TExprList)(unsafe.Pointer(pEList)).FnExpr != int32(1) || (*TExpr)(unsafe.Pointer(pFunc)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) || (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_MinMaxOpt)) != uint32(0) { - return uint8(eRet) + if pEList == uintptr(0) || (*TExprList)(unsafe.Pointer(pEList)).FnExpr != int32(1) || (*TExpr)(unsafe.Pointer(pFunc)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) || (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_MinMaxOpt)) != uint32(0) { + return libc.Uint8FromInt32(eRet) } - _ = libc.Int32FromInt32(0) zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15643) == 0 { eRet = int32(WHERE_ORDERBY_MIN) @@ -127884,17 +122722,16 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { - return uint8(eRet) + return libc.Uint8FromInt32(eRet) } } v1 = _sqlite3ExprListDup(tls, db, pEList, 0) pOrderBy = v1 *(*uintptr)(unsafe.Pointer(ppMinMax)) = v1 - _ = libc.Int32FromInt32(0) if pOrderBy != 0 { (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8))).Ffg.FsortFlags = sortFlags } - return uint8(eRet) + return libc.Uint8FromInt32(eRet) } // C documentation @@ -127919,19 +122756,15 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r func _isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) (r uintptr) { var pExpr, pTab uintptr _, _ = pExpr, pTab - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer(p)).FpWhere != 0 || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr != int32(1) || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc != int32(1) || (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect != 0 || (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc != int32(1) || (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { return uintptr(0) } pTab = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpTab - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { return uintptr(0) } pExpr = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return uintptr(0) } if (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo != pAggInfo { @@ -127940,8 +122773,7 @@ func _isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) (r uintptr) { if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_COUNT) == uint32(0) { return uintptr(0) } - _ = libc.Int32FromInt32(0) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)|libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)|libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return uintptr(0) } return pTab @@ -127963,8 +122795,6 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in _, _, _ = pIdx, pTab, zIndexedBy pTab = (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab zIndexedBy = *(*uintptr)(unsafe.Pointer(pFrom + 60)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pIdx = (*TTable)(unsafe.Pointer(pTab)).FpIndex for { if !(pIdx != 0 && _sqlite3StrICmp(tls, (*TIndex)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0) { @@ -127980,7 +122810,6 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) return int32(SQLITE_ERROR) } - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pFrom + 64)) = pIdx return SQLITE_OK } @@ -128023,7 +122852,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) } pX = p for { - if !(pX != 0 && (int32((*TSelect)(unsafe.Pointer(pX)).Fop) == int32(TK_ALL) || int32((*TSelect)(unsafe.Pointer(pX)).Fop) == int32(TK_SELECT))) { + if !(pX != 0 && (libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pX)).Fop) == int32(TK_ALL) || libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pX)).Fop) == int32(TK_SELECT))) { break } goto _1 @@ -128083,10 +122912,8 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Compound)) - _ = libc.Int32FromInt32(0) + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) - _ = libc.Int32FromInt32(0) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) return WRC_Continue @@ -128126,8 +122953,6 @@ func _searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) var p, zName uintptr _, _, _ = i, p, zName zName = (*TSrcItem)(unsafe.Pointer(pItem)).FzName - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p = pWith for { if !(p != 0) { @@ -128186,7 +123011,6 @@ func _sqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree Tu8) ( } } if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - _ = libc.Int32FromInt32(0) (*TWith)(unsafe.Pointer(pWith)).FpOuter = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = pWith } @@ -128217,7 +123041,6 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom var db, pCte, pCteUse, pEList, pItem, pLeft, pRecTerm, pSavedWith, pSel, pSrc, pTab, v1, v2, v5 uintptr var _ /* pWith at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bMayRecursive, db, i, iRecTab, pCte, pCteUse, pEList, pItem, pLeft, pRecTerm, pSavedWith, pSel, pSrc, pTab, rc, v1, v2, v4, v5 /* The matching WITH */ - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FpWith == uintptr(0) { /* There are no WITH clauses in the stack. No match is possible */ return 0 @@ -128255,7 +123078,6 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - _ = libc.Int32FromInt32(0) pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) if pTab == uintptr(0) { return int32(2) @@ -128276,14 +123098,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, db, (*TCte)(unsafe.Pointer(pCte)).FzName) (*TTable)(unsafe.Pointer(pTab)).FiPKey = int16(-int32(1)) (*TTable)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(libc.Int32FromInt32(TF_Ephemeral) | libc.Int32FromInt32(TF_NoVisibleRowid)) + *(*Tu32)(unsafe.Pointer(pTab + 28)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_Ephemeral) | libc.Int32FromInt32(TF_NoVisibleRowid)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect = _sqlite3SelectDup(tls, db, (*TCte)(unsafe.Pointer(pCte)).FpSelect, 0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(2) } *(*Tu32)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect + 4)) |= uint32(SF_CopyCte) - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x2>>1)) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19752, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 60)))) return int32(2) @@ -128295,10 +123115,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom v2 = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect pSel = v2 pRecTerm = v2 - bMayRecursive = libc.BoolInt32(int32((*TSelect)(unsafe.Pointer(pSel)).Fop) == int32(TK_ALL) || int32((*TSelect)(unsafe.Pointer(pSel)).Fop) == int32(TK_UNION)) - for bMayRecursive != 0 && int32((*TSelect)(unsafe.Pointer(pRecTerm)).Fop) == int32((*TSelect)(unsafe.Pointer(pSel)).Fop) { + bMayRecursive = libc.BoolInt32(libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pSel)).Fop) == int32(TK_ALL) || libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pSel)).Fop) == int32(TK_UNION)) + for bMayRecursive != 0 && libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pRecTerm)).Fop) == libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pSel)).Fop) { pSrc = (*TSelect)(unsafe.Pointer(pRecTerm)).FpSrc - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) { @@ -128336,11 +123155,6 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TSelect)(unsafe.Pointer(pRecTerm)).FpWith = (*TSelect)(unsafe.Pointer(pSel)).FpWith rc = _sqlite3WalkSelect(tls, pWalker, pRecTerm) (*TSelect)(unsafe.Pointer(pRecTerm)).FpWith = uintptr(0) @@ -128407,7 +123221,6 @@ func _sqlite3SelectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) { if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FpPrior == uintptr(0) { pWith = (*TSelect)(unsafe.Pointer(_findRightmost(tls, p))).FpWith if pWith != uintptr(0) { - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FpWith = (*TWith)(unsafe.Pointer(pWith)).FpOuter } } @@ -128429,7 +123242,6 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect - _ = libc.Int32FromInt32(0) v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(64)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab = v1 @@ -128449,9 +123261,8 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int (*TTable)(unsafe.Pointer(pTab)).FiPKey = int16(-int32(1)) (*TTable)(unsafe.Pointer(pTab)).FeTabType = uint8(TABTYP_VIEW) (*TTable)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) - _ = libc.Int32FromInt32(0) /* The usual case - do not allow ROWID on a subquery */ - *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(libc.Int32FromInt32(TF_Ephemeral) | libc.Int32FromInt32(TF_NoVisibleRowid)) + *(*Tu32)(unsafe.Pointer(pTab + 28)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_Ephemeral) | libc.Int32FromInt32(TF_NoVisibleRowid)) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { v2 = int32(SQLITE_ERROR) } else { @@ -128532,8 +123343,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } - _ = libc.Int32FromInt32(0) - if int32(selFlags)&int32(SF_Expanded) != 0 { + if libc.Int32FromUint16(selFlags)&int32(SF_Expanded) != 0 { return int32(WRC_Prune) } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { @@ -128541,7 +123351,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { v2 = pParse + 108 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) - (*TSelect)(unsafe.Pointer(p)).FselId = uint32(v1) + (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) } pTabList = (*TSelect)(unsafe.Pointer(p)).FpSrc pEList = (*TSelect)(unsafe.Pointer(p)).FpEList @@ -128569,16 +123379,12 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { break } - _ = libc.Int32FromInt32(0) if (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab != 0 { goto _3 } - _ = libc.Int32FromInt32(0) if (*TSrcItem)(unsafe.Pointer(pFrom)).FzName == uintptr(0) { pSel = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect /* A sub-query in the FROM clause of a SELECT */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _sqlite3WalkSelect(tls, pWalker, pSel) != 0 { return int32(WRC_Abort) } @@ -128593,10 +123399,8 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } pTab = (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab - _ = libc.Int32FromInt32(0) } else { /* An ordinary table or view name in the FROM clause */ - _ = libc.Int32FromInt32(0) v5 = _sqlite3LocateTableItem(tls, pParse, uint32(0), pFrom) pTab = v5 (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab = v5 @@ -128609,16 +123413,15 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && _cannotBeFunction(tls, pParse, pFrom) != 0 { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(WRC_Abort) } - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { eCodeOrig = uint8((*TWalker)(unsafe.Pointer(pWalker)).FeCode) if _sqlite3ViewGetColumnNames(tls, pParse, pTab) != 0 { return int32(WRC_Abort) } - _ = libc.Int32FromInt32(0) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19991, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } @@ -128626,11 +123429,11 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, 0) } else { - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) && int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x80>>7)) != 0 && (*(*struct { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) && int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x80>>7)) != 0 && (*(*struct { FnArg int32 FazArg uintptr Fp uintptr - })(unsafe.Pointer(pTab + 44))).Fp != uintptr(0) && int32((*TVTable)(unsafe.Pointer((*(*struct { + })(unsafe.Pointer(pTab + 44))).Fp != uintptr(0) && libc.Int32FromUint8((*TVTable)(unsafe.Pointer((*(*struct { FnArg int32 FazArg uintptr Fp uintptr @@ -128638,7 +123441,6 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15202, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } - _ = libc.Int32FromInt32(0) nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol (*TTable)(unsafe.Pointer(pTab)).FnCol = int16(-int32(1)) (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) /* Turn on Select.selId renumbering */ @@ -128660,7 +123462,6 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } /* Process NATURAL keywords, and ON and USING clauses of joins. */ - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 || _sqlite3ProcessJoin(tls, pParse, p) != 0 { return int32(WRC_Abort) } @@ -128681,12 +123482,10 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } pE = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(k)*20))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_ASTERISK) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_ASTERISK) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_DOT) && int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pE)).FpRight)).Fop) == int32(TK_ASTERISK) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_DOT) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pE)).FpRight)).Fop) == int32(TK_ASTERISK) { break } elistFlags |= (*TExpr)(unsafe.Pointer(pE)).Fflags @@ -128703,7 +123502,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { */ a = pEList + 8 pNew = uintptr(0) - flags = int32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags) + flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags) longNames = libc.BoolInt32(flags&int32(SQLITE_FullColNames) != 0 && flags&int32(SQLITE_ShortColNames) == 0) k = 0 for { @@ -128713,14 +123512,13 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pE = (*(*TExprList_item)(unsafe.Pointer(a + uintptr(k)*20))).FpExpr elistFlags |= (*TExpr)(unsafe.Pointer(pE)).Fflags pRight = (*TExpr)(unsafe.Pointer(pE)).FpRight - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pE)).Fop) != int32(TK_ASTERISK) && (int32((*TExpr)(unsafe.Pointer(pE)).Fop) != int32(TK_DOT) || int32((*TExpr)(unsafe.Pointer(pRight)).Fop) != int32(TK_ASTERISK)) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) != int32(TK_ASTERISK) && (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) != int32(TK_DOT) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) != int32(TK_ASTERISK)) { /* This particular expression does not need to be expanded. */ pNew = _sqlite3ExprListAppend(tls, pParse, pNew, (*(*TExprList_item)(unsafe.Pointer(a + uintptr(k)*20))).FpExpr) if pNew != 0 { (*(*TExprList_item)(unsafe.Pointer(pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*20))).FzEName = (*(*TExprList_item)(unsafe.Pointer(a + uintptr(k)*20))).FzEName - libc.SetBitFieldPtr16Uint32(pNew+8+uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*20+8+4, uint32(int32(uint32(*(*uint16)(unsafe.Pointer(a + uintptr(k)*20 + 8 + 4))&0x3>>0))), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pNew+8+uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*20+8+4, libc.Uint32FromInt32(int32(uint32(*(*uint16)(unsafe.Pointer(a + uintptr(k)*20 + 8 + 4))&0x3>>0))), 0, 0x3) (*(*TExprList_item)(unsafe.Pointer(a + uintptr(k)*20))).FzEName = uintptr(0) } (*(*TExprList_item)(unsafe.Pointer(a + uintptr(k)*20))).FpExpr = uintptr(0) @@ -128729,15 +123527,10 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** expanded. */ tableSeen = 0 /* Set to 1 when TABLE matches */ zTName = uintptr(0) - if int32((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_DOT) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_DOT) { zTName = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pE)).FpLeft + 8)) - _ = libc.Int32FromInt32(0) iErrOfst = *(*int32)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pE)).FpRight + 36)) } else { - _ = libc.Int32FromInt32(0) iErrOfst = *(*int32)(unsafe.Pointer(pE + 36)) } i = 0 @@ -128756,13 +123549,8 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { break } - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x2000>>13)) != 0 { - _ = libc.Int32FromInt32(0) pNestedFrom = (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect)).FpEList - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } else { if zTName != 0 && _sqlite3StrICmp(tls, zTName, zTabName) != 0 { goto _8 @@ -128776,7 +123564,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } zSchemaName = v10 } - if i+int32(1) < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc && int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 1*68 + 36 + 4))&0x400>>10)) != 0 && int32(selFlags)&int32(SF_NestedFrom) != 0 { + if i+int32(1) < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc && int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 1*68 + 36 + 4))&0x400>>10)) != 0 && libc.Int32FromUint16(selFlags)&int32(SF_NestedFrom) != 0 { pUsing = *(*uintptr)(unsafe.Pointer(pFrom + 1*68 + 48)) ii = 0 for { @@ -128789,7 +123577,6 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*20 - _ = libc.Int32FromInt32(0) (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20022, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+8+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+8+4, libc.Uint32FromInt32(1), 7, 0x80) @@ -128803,7 +123590,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pUsing = uintptr(0) } nAdd = int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) - if (*TTable)(unsafe.Pointer(pTab1)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) && int32(selFlags)&int32(SF_NestedFrom) != 0 { + if (*TTable)(unsafe.Pointer(pTab1)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) && libc.Int32FromUint16(selFlags)&int32(SF_NestedFrom) != 0 { nAdd++ } j = 0 @@ -128830,16 +123617,15 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** result-set list unless the SELECT has the SF_IncludeHidden ** bit set. */ - if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_IncludeHidden) == uint32(0) && int32((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol+uintptr(j)*12)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_IncludeHidden) == uint32(0) && libc.Int32FromUint16((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol+uintptr(j)*12)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0 { goto _12 } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_NOEXPAND) != 0 && zTName == uintptr(0) && int32(selFlags)&int32(SF_NestedFrom) == 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_NOEXPAND) != 0 && zTName == uintptr(0) && libc.Int32FromUint16(selFlags)&int32(SF_NestedFrom) == 0 { goto _12 } } - _ = libc.Int32FromInt32(0) tableSeen = int32(1) - if i > 0 && zTName == uintptr(0) && int32(selFlags)&int32(SF_NestedFrom) == 0 { + if i > 0 && zTName == uintptr(0) && libc.Int32FromUint16(selFlags)&int32(SF_NestedFrom) == 0 { if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x400>>10)) != 0 && _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 48)), zName) >= 0 { /* In a join with a USING clause, omit columns in the ** using clause from the table on the right. */ @@ -128847,10 +123633,10 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } pRight = _sqlite3Expr(tls, db, int32(TK_ID), zName) - if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(1) && (int32((*TSrcItem)(unsafe.Pointer(pFrom)).Ffg.Fjointype)&int32(JT_LTORJ) == 0 || int32(selFlags)&int32(SF_NestedFrom) != 0 || !(_inAnyUsingClause(tls, zName, pFrom, (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc-i-int32(1)) != 0)) || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(1) && (libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pFrom)).Ffg.Fjointype)&int32(JT_LTORJ) == 0 || libc.Int32FromUint16(selFlags)&int32(SF_NestedFrom) != 0 || !(_inAnyUsingClause(tls, zName, pFrom, (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc-i-int32(1)) != 0)) || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { pLeft = _sqlite3Expr(tls, db, int32(TK_ID), zTabName) pExpr = _sqlite3PExpr(tls, pParse, int32(TK_DOT), pLeft, pRight) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TExpr)(unsafe.Pointer(pE)).FpLeft != 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TExpr)(unsafe.Pointer(pE)).FpLeft != 0 { _sqlite3RenameTokenRemap(tls, pParse, pLeft, (*TExpr)(unsafe.Pointer(pE)).FpLeft) } if zSchemaName != 0 { @@ -128866,10 +123652,8 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break /* OOM */ } pX1 = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*20 - _ = libc.Int32FromInt32(0) - if int32(selFlags)&int32(SF_NestedFrom) != 0 && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if libc.Int32FromUint16(selFlags)&int32(SF_NestedFrom) != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { - _ = libc.Int32FromInt32(0) (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*20))).FzEName) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20027, libc.VaList(bp+8, zSchemaName, zTabName, zName)) @@ -128879,8 +123663,8 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } else { v13 = int32(ENAME_TAB) } - libc.SetBitFieldPtr16Uint32(pX1+8+4, uint32(v13), 0, 0x3) - if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x400>>10)) != 0 && _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 48)), zName) >= 0 || pUsing != 0 && _sqlite3IdListIndex(tls, pUsing, zName) >= 0 || j < int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_NOEXPAND) != 0 { + libc.SetBitFieldPtr16Uint32(pX1+8+4, libc.Uint32FromInt32(v13), 0, 0x3) + if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x400>>10)) != 0 && _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 48)), zName) >= 0 || pUsing != 0 && _sqlite3IdListIndex(tls, pUsing, zName) >= 0 || j < int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_NOEXPAND) != 0 { libc.SetBitFieldPtr16Uint32(pX1+8+4, libc.Uint32FromInt32(1), 8, 0x100) } } else { @@ -128924,7 +123708,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20074, 0) return int32(WRC_Abort) } - if elistFlags&uint32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { + if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_ComplexResult) } } @@ -128987,7 +123771,6 @@ func _selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { } *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_HasTypeInfo) pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse - _ = libc.Int32FromInt32(0) pTabList = (*TSelect)(unsafe.Pointer(p)).FpSrc i = 0 pFrom = pTabList + 8 @@ -128996,7 +123779,6 @@ func _selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { break } pTab = (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab - _ = libc.Int32FromInt32(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Ephemeral) != uint32(0) { /* A sub-query in the FROM clause of a SELECT */ pSel = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect @@ -129047,8 +123829,6 @@ func _sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { // ** This routine acts recursively on all subqueries within the SELECT. // */ func _sqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return } @@ -129089,8 +123869,6 @@ func _analyzeAggFuncArgs(tls *libc.TLS, pAggInfo uintptr, pNC uintptr) { var i int32 var pExpr uintptr _, _ = i, pExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pNC + 24)) |= int32(NC_InAggFunc) i = 0 for { @@ -129098,16 +123876,11 @@ func _analyzeAggFuncArgs(tls *libc.TLS, pAggInfo uintptr, pNC uintptr) { break } pExpr = (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3ExprAnalyzeAggList(tls, pNC, *(*uintptr)(unsafe.Pointer(pExpr + 20))) if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3ExprAnalyzeAggList(tls, pNC, *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20))) } - _ = libc.Int32FromInt32(0) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { _sqlite3ExprAnalyzeAggregates(tls, pNC, (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FpFilter) } goto _1 @@ -129130,11 +123903,8 @@ func _analyzeAggFuncArgs(tls *libc.TLS, pAggInfo uintptr, pNC uintptr) { func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect uintptr, pAggInfo uintptr, pNC uintptr) { var j, k, mx int32 _, _, _ = j, k, mx - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if int32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { @@ -129150,7 +123920,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint16(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -129169,25 +123939,24 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { return WRC_Continue } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_COLUMN) { return WRC_Continue } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) { return WRC_Continue } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IF_NULL_ROW) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IF_NULL_ROW) { return WRC_Continue } pAggInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - _ = libc.Int32FromInt32(0) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*16 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) return int32(WRC_Prune) } @@ -129239,8 +124008,6 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // ** // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) *(*int32)(unsafe.Pointer(pParse + 44)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } @@ -129263,9 +124030,6 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { _, _, _, _, _, _, _, _, _ = i, nExtra, nReg, pE, pFunc, pKeyInfo, pKeyInfo1, pOBList, v v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe nReg = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if nReg == 0 { return } @@ -129281,7 +124045,6 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(pE + 20)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 20)))).FnExpr != int32(1) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20105, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) @@ -129293,17 +124056,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { nExtra = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr)).FpLeft + 20)) if !((*TAggInfo_func)(unsafe.Pointer(pFunc)).FbOBUnique != 0) { nExtra++ /* One extra column for the OP_Sequence */ } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FbOBPayload != 0 { /* extra columns for the function arguments */ - _ = libc.Int32FromInt32(0) nExtra += (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr + 20)))).FnExpr } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FbUseSubtype != 0 { @@ -129341,18 +124099,13 @@ func _finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { break } - _ = libc.Int32FromInt32(0) pList = *(*uintptr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 20)) if (*TAggInfo_func)(unsafe.Pointer(pF)).FiOBTab >= 0 { /* Loop counter */ - _ = libc.Int32FromInt32(0) nArg = (*TExprList)(unsafe.Pointer(pList)).FnExpr regAgg = _sqlite3GetTempRange(tls, pParse, nArg) - if int32((*TAggInfo_func)(unsafe.Pointer(pF)).FbOBPayload) == 0 { + if libc.Int32FromUint8((*TAggInfo_func)(unsafe.Pointer(pF)).FbOBPayload) == 0 { nKey = 0 } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) nKey = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFExpr)).FpLeft + 20)))).FnExpr if !((*TAggInfo_func)(unsafe.Pointer(pF)).FbOBUnique != 0) { nKey++ @@ -129372,7 +124125,7 @@ func _finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { } if (*TAggInfo_func)(unsafe.Pointer(pF)).FbUseSubtype != 0 { regSubtype = _sqlite3GetTempReg(tls, pParse) - iBaseCol = nKey + nArg + libc.BoolInt32(int32((*TAggInfo_func)(unsafe.Pointer(pF)).FbOBPayload) == 0 && int32((*TAggInfo_func)(unsafe.Pointer(pF)).FbOBUnique) == 0) + iBaseCol = nKey + nArg + libc.BoolInt32(libc.Int32FromUint8((*TAggInfo_func)(unsafe.Pointer(pF)).FbOBPayload) == 0 && libc.Int32FromUint8((*TAggInfo_func)(unsafe.Pointer(pF)).FbOBUnique) == 0) j = nArg - int32(1) for { if !(j >= 0) { @@ -129387,15 +124140,13 @@ func _finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { } _sqlite3ReleaseTempReg(tls, pParse, regSubtype) } - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_AggStep), 0, regAgg, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+(*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn+i) _sqlite3VdbeAppendP4(tls, v, (*TAggInfo_func)(unsafe.Pointer(pF)).FpFunc, -int32(7)) - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(nArg))) + _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(nArg))) _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), (*TAggInfo_func)(unsafe.Pointer(pF)).FiOBTab, iTop+int32(1)) _sqlite3VdbeJumpHere(tls, v, iTop) _sqlite3ReleaseTempRange(tls, pParse, regAgg, nArg) } - _ = libc.Int32FromInt32(0) if pList != 0 { v4 = (*TExprList)(unsafe.Pointer(pList)).FnExpr } else { @@ -129436,7 +124187,6 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe regHit = 0 addrHitTest = 0 - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return } @@ -129450,11 +124200,8 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui addrNext = 0 regAggSz = 0 regDistinct = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pList = *(*uintptr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 20)) - if (*TExpr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { pFilter = (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFExpr)).Fy)))).FpFilter if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 && regAcc != 0 { /* If regAcc==0, there there exists some min() or max() function @@ -129479,15 +124226,8 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _sqlite3ExprIfFalse(tls, pParse, pFilter, addrNext, int32(SQLITE_JUMPIFNULL)) } if (*TAggInfo_func)(unsafe.Pointer(pF)).FiOBTab >= 0 { /* The ORDER BY clause */ - _ = libc.Int32FromInt32(0) nArg = (*TExprList)(unsafe.Pointer(pList)).FnExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFExpr)).FpLeft + 20)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) regAggSz = (*TExprList)(unsafe.Pointer(pOBList)).FnExpr if !((*TAggInfo_func)(unsafe.Pointer(pF)).FbOBUnique != 0) { regAggSz++ /* One register for OP_Sequence */ @@ -129558,7 +124298,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui /* Invoke the AggStep function */ if (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { pColl = uintptr(0) - _ = libc.Int32FromInt32(0) /* pList!=0 if pF->pFunc has NEEDCOLL */ + /* pList!=0 if pF->pFunc has NEEDCOLL */ j = 0 pItem = pList + 8 for { @@ -129583,10 +124323,9 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui } _sqlite3VdbeAddOp4(tls, v, int32(OP_CollSeq), regHit, 0, 0, pColl, -int32(2)) } - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_AggStep), 0, regAgg, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+(*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn+i) _sqlite3VdbeAppendP4(tls, v, (*TAggInfo_func)(unsafe.Pointer(pF)).FpFunc, -int32(7)) - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(nArg))) + _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(nArg))) _sqlite3ReleaseTempRange(tls, pParse, regAgg, nArg) } if addrNext != 0 { @@ -129610,7 +124349,6 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator) { break } - _ = libc.Int32FromInt32(0) _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pC)).FpCExpr, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+i) goto _9 _9: @@ -129636,7 +124374,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp var bCover int32 var v1, v2 uintptr _, _, _ = bCover, v1, v2 - if int32((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { v1 = __ccgo_ts + 20222 @@ -129669,7 +124407,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 var db, pNew, pS, pWhere uintptr var t TExpr _, _, _, _, _ = db, pNew, pS, pWhere, t - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AND) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AND) { pS = *(*uintptr)(unsafe.Pointer(pWalker + 24)) /* This routine is called before the HAVING clause of the current ** SELECT is analyzed for aggregates. So if pExpr->pAggInfo is set @@ -129678,7 +124416,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** belongs to an outer query. Do not move the expression to the WHERE ** clause in this obscure case, as doing so may corrupt the outer Select ** statements AggInfo structure. */ - if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { + if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8255) if pNew != 0 { @@ -129738,7 +124476,6 @@ func _isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr, iFirst int3 var pItem, pS1 uintptr var v1 int32 _, _, _ = pItem, pS1, v1 - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselFlags&uint32(SF_PushDown) != 0 { return uintptr(0) } @@ -129755,8 +124492,6 @@ func _isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr, iFirst int3 if (*TSrcItem)(unsafe.Pointer(pItem)).FzName == uintptr(0) { continue } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema != (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pThis)).FpTab)).FpSchema { continue } @@ -129836,21 +124571,19 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 return 0 } pExpr = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - _ = libc.Int32FromInt32(0) if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+15937) != 0 { return 0 } /* Is count() */ - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) { return 0 } /* Must be count(*) */ if (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc != int32(1) { return 0 } /* One table in FROM */ - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return 0 } /* Not a window function */ pSub = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect @@ -129864,7 +124597,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 return 0 } /* Not a CTE */ for cond := true; cond; cond = pSub != 0 { - if int32((*TSelect)(unsafe.Pointer(pSub)).Fop) != int32(TK_ALL) && (*TSelect)(unsafe.Pointer(pSub)).FpPrior != 0 { + if libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pSub)).Fop) != int32(TK_ALL) && (*TSelect)(unsafe.Pointer(pSub)).FpPrior != 0 { return 0 } /* Must be UNION ALL */ if (*TSelect)(unsafe.Pointer(pSub)).FpWhere != 0 { @@ -129876,7 +124609,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { return 0 } /* Not an aggregate */ - _ = libc.Int32FromInt32(0) /* Due to the previous */ + /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } /* If we reach this point then it is OK to perform the transformation */ @@ -129892,7 +124625,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= uint32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -129912,7 +124645,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) return int32(1) } @@ -129986,17 +124719,17 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp pItem = pTabList + 8 + uintptr(i)*68 if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x100>>8)) != 0 { pCteUse = *(*uintptr)(unsafe.Pointer(pItem + 64)) - if int32((*TCteUse)(unsafe.Pointer(pCteUse)).FeM10d) == M10d_Yes { + if libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(pCteUse)).FeM10d) == M10d_Yes { return 0 } /* (2a) */ - if (*TCteUse)(unsafe.Pointer(pCteUse)).FnUse >= int32(2) && int32((*TCteUse)(unsafe.Pointer(pCteUse)).FeM10d) != int32(M10d_No) { + if (*TCteUse)(unsafe.Pointer(pCteUse)).FnUse >= int32(2) && libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(pCteUse)).FeM10d) != int32(M10d_No) { return 0 } /* (2b) */ } - if int32((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { return 0 } /* (3) */ - if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Coroutines)) != uint32(0) { + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Coroutines)) != uint32(0) { return 0 } /* (4) */ if _isSelfJoinView(tls, pTabList, pItem, i+int32(1), (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) != uintptr(0) { @@ -130006,7 +124739,7 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc == int32(1) { return int32(1) } /* (1a) */ - if int32((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + 1*68))).Ffg.Fjointype)&int32(JT_CROSS) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + 1*68))).Ffg.Fjointype)&int32(JT_CROSS) != 0 { return int32(1) } /* (1b) */ if selFlags&int32(SF_UpdateFrom) != 0 { @@ -130018,7 +124751,7 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp return 0 } /* (1c-iii) */ for int32(1) != 0 { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0 { return 0 } /* (1c-ii) */ if i == 0 { @@ -130067,35 +124800,26 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r rc = int32(1) /* The database connection */ *(*uintptr)(unsafe.Pointer(bp + 52)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(1) } - _ = libc.Int32FromInt32(0) if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_SELECT), uintptr(0), uintptr(0), uintptr(0)) != 0 { return int32(1) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) { /* All of these destinations are also able to ignore the ORDER BY clause */ if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto select_end } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the SF_UFSrcCheck flag is set, then this function is being called ** as part of populating the temp table for an UPDATE...FROM statement. ** In this case, it is an error if the target object (pSrc->a[0]) name @@ -130120,13 +124844,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) } - if int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) } if _sqlite3WindowRewrite(tls, pParse, p) != 0 { - _ = libc.Int32FromInt32(0) goto select_end } pTabList = (*TSelect)(unsafe.Pointer(p)).FpSrc @@ -130147,7 +124870,6 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* The expander should have already created transient Table objects ** even for FROM clause elements such as subqueries that do not correspond ** to a real table */ - _ = libc.Int32FromInt32(0) /* Try to simplify joins: ** ** LEFT JOIN -> JOIN @@ -130159,9 +124881,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** perform the appropriate simplification. This is called ** "OUTER JOIN strength reduction" in the SQLite documentation. */ - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0 && _sqlite3ExprImpliesNonNullRow(tls, (*TSelect)(unsafe.Pointer(p)).FpWhere, (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor, int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LTORJ)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_SimplifyJoin)) == uint32(0) { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0 && _sqlite3ExprImpliesNonNullRow(tls, (*TSelect)(unsafe.Pointer(p)).FpWhere, (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor, libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LTORJ)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_SimplifyJoin)) == uint32(0) { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { p3 = pItem + 36 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^libc.Int32FromInt32(JT_LEFT)) } else { @@ -130170,15 +124892,15 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _unsetJoinExpr(tls, (*TSelect)(unsafe.Pointer(p)).FpWhere, (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor, 0) } } - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { j = i + int32(1) for { if !(j < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { break } pI2 = pTabList + 8 + uintptr(j)*68 - if int32((*TSrcItem)(unsafe.Pointer(pI2)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { - if int32((*TSrcItem)(unsafe.Pointer(pI2)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pI2)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pI2)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { p6 = pI2 + 36 *(*Tu8)(unsafe.Pointer(p6)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p6))) & ^libc.Int32FromInt32(JT_RIGHT)) } else { @@ -130199,7 +124921,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } p9 = pTabList + 8 + uintptr(j)*68 + 36 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^libc.Int32FromInt32(JT_LTORJ)) - if int32((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*68))).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*68))).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { break } goto _8 @@ -130223,7 +124945,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** elimination) on a MATERIALIZED common table expression because ** a MATERIALIZED common table expression is an optimization fence. */ - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x100>>8)) != 0 && int32((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 64)))).FeM10d) == M10d_Yes { + if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x100>>8)) != 0 && libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 64)))).FeM10d) == M10d_Yes { goto _2 } /* Do not try to flatten an aggregate subquery. @@ -130236,7 +124958,6 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != uint32(0) { goto _2 } - _ = libc.Int32FromInt32(0) /* If a FROM-clause subquery has an ORDER BY clause that is not ** really doing anything, then delete it now so that it does not ** interfere with query flattening. See the discussion at @@ -130259,7 +124980,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** ** Also retain the ORDER BY if the OmitOrderBy optimization is disabled. */ - if (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) && ((*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) || (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(1)) && (*TSelect)(unsafe.Pointer(pSub)).FpLimit == uintptr(0) && (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_OrderByReqd) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_OrderByReqd) == uint32(0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OmitOrderBy)) == uint32(0) { + if (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) && ((*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) || (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(1)) && (*TSelect)(unsafe.Pointer(pSub)).FpLimit == uintptr(0) && (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_OrderByReqd) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_OrderByReqd) == uint32(0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OmitOrderBy)) == uint32(0) { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy) (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0) } @@ -130281,7 +125002,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** ** SELECT x FROM (SELECT x FROM tab ORDER BY y LIMIT 10); */ - if (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) && i == 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_ComplexResult) != uint32(0) && ((*TSrcList)(unsafe.Pointer(pTabList)).FnSrc == int32(1) || int32((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + 1*68))).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0) { + if (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) && i == 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_ComplexResult) != uint32(0) && ((*TSrcList)(unsafe.Pointer(pTabList)).FnSrc == int32(1) || libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + 1*68))).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0) { goto _2 } if _flattenSubquery(tls, pParse, p, i, isAgg) != 0 { @@ -130295,7 +125016,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto select_end } - if !(int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= libc.Int32FromInt32(SRT_Fifo)) { + if !(libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= libc.Int32FromInt32(SRT_Fifo)) { (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy = (*TSelect)(unsafe.Pointer(p)).FpOrderBy } goto _2 @@ -130318,10 +125039,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** as the equivalent optimization will be handled by query planner in ** sqlite3WhereBegin(). */ - if (*TSelect)(unsafe.Pointer(p)).FpWhere != uintptr(0) && int32((*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpWhere)).Fop) == int32(TK_AND) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_PropagateConst)) == uint32(0) && _propagateConstants(tls, pParse, p) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpWhere != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpWhere)).Fop) == int32(TK_AND) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_PropagateConst)) == uint32(0) && _propagateConstants(tls, pParse, p) != 0 { } else { } - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_QueryFlattener)|libc.Int32FromInt32(SQLITE_CountOfView)) == uint32(0) && _countOfViewOptimization(tls, pParse, p) != 0 { + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_QueryFlattener)|libc.Int32FromInt32(SQLITE_CountOfView)) == uint32(0) && _countOfViewOptimization(tls, pParse, p) != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto select_end } @@ -130363,7 +125084,6 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r goto _10 } /* The code for a subquery should only be generated once. */ - _ = libc.Int32FromInt32(0) /* Increment Parse.nHeight by the height of the largest expression ** tree referred to by this, the parent select. The child select ** may contain expression trees of at most @@ -130375,20 +125095,19 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Make copies of constant WHERE-clause terms in the outer query down ** inside the subquery. This can help the subquery to run more efficiently. */ - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_PushDown)) == uint32(0) && (int32(uint32(*(*uint16)(unsafe.Pointer(pItem1 + 36 + 4))&0x100>>8)) == 0 || int32((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 64)))).FeM10d) != M10d_Yes && (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 64)))).FnUse < int32(2)) && _pushDownWhereTerms(tls, pParse, pSub1, (*TSelect)(unsafe.Pointer(p)).FpWhere, pTabList, i) != 0 { - _ = libc.Int32FromInt32(0) + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_PushDown)) == uint32(0) && (int32(uint32(*(*uint16)(unsafe.Pointer(pItem1 + 36 + 4))&0x100>>8)) == 0 || libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 64)))).FeM10d) != M10d_Yes && (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 64)))).FnUse < int32(2)) && _pushDownWhereTerms(tls, pParse, pSub1, (*TSelect)(unsafe.Pointer(p)).FpWhere, pTabList, i) != 0 { } else { } /* Convert unused result columns of the subquery into simple NULL ** expressions, to avoid unneeded searching and computation. */ - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_NullUnusedCols)) == uint32(0) && _disableUnusedSubqueryResultColumns(tls, pItem1) != 0 { + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_NullUnusedCols)) == uint32(0) && _disableUnusedSubqueryResultColumns(tls, pItem1) != 0 { } zSavedAuthContext = (*TParse)(unsafe.Pointer(pParse)).FzAuthContext (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = (*TSrcItem)(unsafe.Pointer(pItem1)).FzName /* Generate code to implement the subquery */ - if _fromClauseTermCanBeCoroutine(tls, pParse, pTabList, i, int32((*TSelect)(unsafe.Pointer(p)).FselFlags)) != 0 { + if _fromClauseTermCanBeCoroutine(tls, pParse, pTabList, i, libc.Int32FromUint32((*TSelect)(unsafe.Pointer(p)).FselFlags)) != 0 { /* Implement a co-routine that will return a single row of the result ** set on each invocation. */ @@ -130499,8 +125218,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** written the query must use a temp-table for at least one of the ORDER ** BY and DISTINCT, and an index or separate temp-table for the other. */ - if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy, pEList, -int32(1)) == 0 && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Distinct)) + if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy, pEList, -int32(1)) == 0 && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) v16 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v16 pGroupBy = v16 @@ -130508,7 +125227,6 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Notice that even thought SF_Distinct has been cleared from p->selFlags, ** the sDistinct.isTnct is still set. Hence, isTnct represents the ** original setting of the SF_Distinct flag, not the current setting */ - _ = libc.Int32FromInt32(0) (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct = uint8(2) } /* If there is an ORDER BY clause, then create an ephemeral index to @@ -130531,7 +125249,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } /* If the output is destined for a temporary table, open that table. */ - if int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_EphemTab) { + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_EphemTab) { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_NestedFrom) != 0 { ii = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - int32(1) @@ -130596,12 +125314,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r v24 = 0 } /* No aggregate functions and no GROUP BY clause */ - wctrlFlags = uint16(uint32(v24) | (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_FixedLimit)) + wctrlFlags = uint16(libc.Uint32FromInt32(v24) | (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_FixedLimit)) pWin = (*TSelect)(unsafe.Pointer(p)).FpWin /* Main window object (or NULL) */ if pWin != 0 { _sqlite3WindowCodeInit(tls, pParse, p) } - _ = libc.Int32FromInt32(0) /* Begin the database scan. */ pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy, (*TSelect)(unsafe.Pointer(p)).FpEList, p, wctrlFlags, int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow)) if pWInfo == uintptr(0) { @@ -130611,7 +125328,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { - (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = uint8(_sqlite3WhereIsDistinct(tls, pWInfo)) + (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) } if (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy != 0 { (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FnOBSat = _sqlite3WhereIsOrdered(tls, pWInfo) @@ -130627,7 +125344,6 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FaddrSortIndex >= 0 && (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy == uintptr(0) { _sqlite3VdbeChangeToNoop(tls, v, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FaddrSortIndex) } - _ = libc.Int32FromInt32(0) if pWin != 0 { addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) @@ -130691,7 +125407,6 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r k-- pItem2 += 20 } - _ = libc.Int32FromInt32(0) if int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) > int32(66) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = int16(66) } @@ -130714,7 +125429,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(ii1 < (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { break } - sortFlags = uint8(int32((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy + 8 + uintptr(ii1)*20))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) + sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy + 8 + uintptr(ii1)*20))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*20))).Ffg.FsortFlags = sortFlags goto _29 _29: @@ -130726,7 +125441,6 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } } } else { - _ = libc.Int32FromInt32(0) (*TSelect)(unsafe.Pointer(p)).FnSelectRow = 0 } /* Create a label to jump to when we want to abort the query */ @@ -130752,15 +125466,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v30 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint16(v30) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v30) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+84, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+84, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy) if pHaving != 0 { if pGroupBy != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _havingToWhere(tls, pParse, p) pWhere = (*TSelect)(unsafe.Pointer(p)).FpWhere } @@ -130793,7 +125504,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v31 = 0 } - distFlag = uint16(v31) + distFlag = libc.Uint16FromInt32(v31) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out @@ -130805,7 +125516,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r *(*int32)(unsafe.Pointer(v33))++ (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v32 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, int32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ v35 = pParse + 44 @@ -130838,7 +125549,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** in the right order to begin with. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) - if int32((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { + if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { v42 = int32(WHERE_DISTINCTBY) } else { v42 = int32(WHERE_GROUPBY) @@ -130848,7 +125559,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v43 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, uint16(v42|v43|int32(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v42|v43|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -130941,7 +125652,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** This is an optimization - the correct answer should result regardless. ** Use the SQLITE_GroupByOrder flag with SQLITE_TESTCTRL_OPTIMIZER to ** disable this optimization for testing purposes. */ - if orderByGrp != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (groupBySort != 0 || _sqlite3WhereIsSorted(tls, pWInfo) != 0) { + if orderByGrp != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (groupBySort != 0 || _sqlite3WhereIsSorted(tls, pWInfo) != 0) { (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy = uintptr(0) _sqlite3VdbeChangeToNoop(tls, v, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FaddrSortIndex) } @@ -131031,7 +125742,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _resetAccumulator(tls, pParse, pAggInfo) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iUseFlag) _sqlite3VdbeAddOp1(tls, v, int32(OP_Return), regReset) - if int32(distFlag) != 0 && eDist != WHERE_DISTINCT_NOOP { + if libc.Int32FromUint16(distFlag) != 0 && eDist != WHERE_DISTINCT_NOOP { pF = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } @@ -131094,12 +125805,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pKeyInfo2 = _sqlite3KeyInfoOfIndex(tls, pParse, pBest) } /* Open a read-only cursor, execute the OP_Count, close the cursor. */ - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenRead), iCsr, int32(iRoot), iDb, int32(1)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenRead), iCsr, libc.Int32FromUint32(iRoot), iDb, int32(1)) if pKeyInfo2 != 0 { _sqlite3VdbeChangeP4(tls, v, -int32(1), pKeyInfo2, -int32(8)) } _assignAggregateRegisters(tls, pParse, pAggInfo) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iCsr, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+(*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn+libc.Int32FromInt32(0)) _sqlite3VdbeAddOp1(tls, v, int32(OP_Close), iCsr) _explainSimpleCount(tls, pParse, pTab1, pBest) @@ -131122,7 +125832,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { break } - if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { + if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { goto _55 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { @@ -131142,14 +125852,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { - _ = libc.Int32FromInt32(0) pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 20)) if pDistinct1 != 0 { v58 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { v58 = 0 } - distFlag1 = uint16(v58) + distFlag1 = libc.Uint16FromInt32(v58) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -131157,16 +125866,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** processing is much simpler since there is only a single row ** of output. */ - _ = libc.Int32FromInt32(0) _resetAccumulator(tls, pParse, pAggInfo) /* If this query is a candidate for the min/max optimization, then ** minMaxFlag will have been previously set to either ** WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX and pMinMaxOrderBy will ** be an appropriate ORDER BY expression for the optimization. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 52)), pDistinct1, p, uint16(int32(minMaxFlag)|int32(distFlag1)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 52)), pDistinct1, p, libc.Uint16FromInt32(libc.Int32FromUint8(minMaxFlag)|libc.Int32FromUint16(distFlag1)), 0) if pWInfo == uintptr(0) { goto select_end } @@ -131193,14 +125899,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ - if int32((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { + if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { _explainTempTable(tls, pParse, __ccgo_ts+20382) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. */ if (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy != 0 { - _ = libc.Int32FromInt32(0) _generateSortTail(tls, pParse, p, bp+12, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pDest) } /* Jump here to skip this query @@ -131215,8 +125920,6 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r goto select_end select_end: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 52))) _sqlite3VdbeExplainPop(tls, pParse) return rc @@ -131285,8 +125988,8 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { need = nCol } - if (*TTabResult)(unsafe.Pointer(p)).FnData+uint32(need) > (*TTabResult)(unsafe.Pointer(p)).FnAlloc { - (*TTabResult)(unsafe.Pointer(p)).FnAlloc = (*TTabResult)(unsafe.Pointer(p)).FnAlloc*uint32(2) + uint32(need) + if (*TTabResult)(unsafe.Pointer(p)).FnData+libc.Uint32FromInt32(need) > (*TTabResult)(unsafe.Pointer(p)).FnAlloc { + (*TTabResult)(unsafe.Pointer(p)).FnAlloc = (*TTabResult)(unsafe.Pointer(p)).FnAlloc*uint32(2) + libc.Uint32FromInt32(need) azNew = _sqlite3Realloc(tls, (*TTabResult)(unsafe.Pointer(p)).FazResult, uint64(uint32(4)*(*TTabResult)(unsafe.Pointer(p)).FnAlloc)) if azNew == uintptr(0) { goto malloc_failed @@ -131297,7 +126000,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr ** the names of all columns. */ if (*TTabResult)(unsafe.Pointer(p)).FnRow == uint32(0) { - (*TTabResult)(unsafe.Pointer(p)).FnColumn = uint32(nCol) + (*TTabResult)(unsafe.Pointer(p)).FnColumn = libc.Uint32FromInt32(nCol) i = 0 for { if !(i < nCol) { @@ -131317,7 +126020,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr i++ } } else { - if int32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { + if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20400, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) @@ -131336,11 +126039,11 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr z = uintptr(0) } else { n = _sqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) + int32(1) - z = Xsqlite3_malloc64(tls, uint64(n)) + z = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(n)) if z == uintptr(0) { goto malloc_failed } - libc.Xmemcpy(tls, z, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)), uint32(n)) + libc.Xmemcpy(tls, z, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)), libc.Uint32FromInt32(n)) } v6 = p + 20 v5 = *(*Tu32)(unsafe.Pointer(v6)) @@ -131403,8 +126106,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp } *(*uintptr)(unsafe.Pointer((*(*TTabResult)(unsafe.Pointer(bp))).FazResult)) = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3_get_table_cb), bp, pzErrMsg) - _ = libc.Int32FromInt32(0) - *(*uintptr)(unsafe.Pointer((*(*TTabResult)(unsafe.Pointer(bp))).FazResult)) = uintptr(int32((*(*TTabResult)(unsafe.Pointer(bp))).FnData)) + *(*uintptr)(unsafe.Pointer((*(*TTabResult)(unsafe.Pointer(bp))).FazResult)) = uintptr(libc.Int32FromUint32((*(*TTabResult)(unsafe.Pointer(bp))).FnData)) if rc&int32(0xff) == int32(SQLITE_ABORT) { Xsqlite3_free_table(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FazResult+1*4) if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { @@ -131433,10 +126135,10 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp } *(*uintptr)(unsafe.Pointer(pazResult)) = (*(*TTabResult)(unsafe.Pointer(bp))).FazResult + 1*4 if pnColumn != 0 { - *(*int32)(unsafe.Pointer(pnColumn)) = int32((*(*TTabResult)(unsafe.Pointer(bp))).FnColumn) + *(*int32)(unsafe.Pointer(pnColumn)) = libc.Int32FromUint32((*(*TTabResult)(unsafe.Pointer(bp))).FnColumn) } if pnRow != 0 { - *(*int32)(unsafe.Pointer(pnRow)) = int32((*(*TTabResult)(unsafe.Pointer(bp))).FnRow) + *(*int32)(unsafe.Pointer(pnRow)) = libc.Int32FromUint32((*(*TTabResult)(unsafe.Pointer(bp))).FnRow) } return rc } @@ -131451,7 +126153,6 @@ func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { _, _ = i, n if azResult != 0 { azResult -= 4 - _ = libc.Int32FromInt32(0) n = int32(*(*uintptr)(unsafe.Pointer(azResult))) i = int32(1) for { @@ -131527,7 +126228,6 @@ func _sqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) func _sqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) (r uintptr) { var p, pList, pTmpSchema, pTrig uintptr _, _, _, _ = p, pList, pTmpSchema, pTrig /* Loop variable for TEMP triggers */ - _ = libc.Int32FromInt32(0) pTmpSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*16))).FpSchema p = (*THash)(unsafe.Pointer(pTmpSchema + 40)).Ffirst pList = (*TTable)(unsafe.Pointer(pTab)).FpTrigger @@ -131537,10 +126237,7 @@ func _sqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) (r uintptr (*TTrigger)(unsafe.Pointer(pTrig)).FpNext = pList pList = pTrig } else { - if int32((*TTrigger)(unsafe.Pointer(pTrig)).Fop) == int32(TK_RETURNING) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(pTrig)).Fop) == int32(TK_RETURNING) { (*TTrigger)(unsafe.Pointer(pTrig)).Ftable = (*TTable)(unsafe.Pointer(pTab)).FzName (*TTrigger)(unsafe.Pointer(pTrig)).FpTabSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema (*TTrigger)(unsafe.Pointer(pTrig)).FpNext = pList @@ -131573,10 +126270,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 pTrigger = uintptr(0) /* Table that the trigger fires off of */ zName = uintptr(0) /* Name of the trigger */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* State vector for the DB fixer */ - _ = libc.Int32FromInt32(0) /* pName1->z might be NULL, but not pName1 itself */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + /* pName1->z might be NULL, but not pName1 itself */ if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { @@ -131613,14 +126307,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ** exist, the error is caught by the block below. */ pTab = _sqlite3SrcListLookup(tls, pParse, pTableName) - if int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && (*TToken)(unsafe.Pointer(pName2)).Fn == uint32(0) && pTab != 0 && (*TTable)(unsafe.Pointer(pTab)).FpSchema == (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && (*TToken)(unsafe.Pointer(pName2)).Fn == uint32(0) && pTab != 0 && (*TTable)(unsafe.Pointer(pTab)).FpSchema == (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema { iDb = int32(1) } /* Ensure the table name matches database name and that the table exists */ if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _ = libc.Int32FromInt32(0) _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+20511, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+4, pTableName) != 0 { goto trigger_cleanup @@ -131630,7 +126323,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 /* The table does not exist. */ goto trigger_orphan_error } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20519, 0) goto trigger_orphan_error } @@ -131642,19 +126335,16 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ** specified name exists */ zName = _sqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp))) if zName == uintptr(0) { - _ = libc.Int32FromInt32(0) goto trigger_cleanup } if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20511, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } - _ = libc.Int32FromInt32(0) - if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema+40, zName) != 0 { if !(noErr != 0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20600, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) } else { - _ = libc.Int32FromInt32(0) _sqlite3CodeVerifySchema(tls, pParse, iDb) } goto trigger_cleanup @@ -131668,7 +126358,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 /* INSTEAD of triggers are only for views and views only support INSTEAD ** of triggers. */ - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { v1 = __ccgo_ts + 20664 } else { @@ -131677,11 +126367,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20677, libc.VaList(bp+64, v1, pTableName+8)) goto trigger_orphan_error } - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20714, libc.VaList(bp+64, pTableName+8)) goto trigger_orphan_error } - if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { iTabDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) code = int32(SQLITE_CREATE_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iTabDb)*16))).FzDbSName @@ -131724,14 +126414,14 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 (*TTrigger)(unsafe.Pointer(pTrigger)).Ftable = _sqlite3DbStrDup(tls, db, (*(*TSrcItem)(unsafe.Pointer(pTableName + 8))).FzName) (*TTrigger)(unsafe.Pointer(pTrigger)).FpSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema (*TTrigger)(unsafe.Pointer(pTrigger)).FpTabSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema - (*TTrigger)(unsafe.Pointer(pTrigger)).Fop = uint8(op) + (*TTrigger)(unsafe.Pointer(pTrigger)).Fop = libc.Uint8FromInt32(op) if tr_tm == int32(TK_BEFORE) { v4 = int32(TRIGGER_BEFORE) } else { v4 = int32(TRIGGER_AFTER) } - (*TTrigger)(unsafe.Pointer(pTrigger)).Ftr_tm = uint8(v4) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + (*TTrigger)(unsafe.Pointer(pTrigger)).Ftr_tm = libc.Uint8FromInt32(v4) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenRemap(tls, pParse, (*TTrigger)(unsafe.Pointer(pTrigger)).Ftable, (*(*TSrcItem)(unsafe.Pointer(pTableName + 8))).FzName) (*TTrigger)(unsafe.Pointer(pTrigger)).FpWhen = pWhen pWhen = uintptr(0) @@ -131740,7 +126430,6 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } (*TTrigger)(unsafe.Pointer(pTrigger)).FpColumns = pColumns pColumns = uintptr(0) - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger = pTrigger goto trigger_cleanup trigger_cleanup: @@ -131752,13 +126441,12 @@ trigger_cleanup: if !((*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0) { _sqlite3DeleteTrigger(tls, db, pTrigger) } else { - _ = libc.Int32FromInt32(0) } return goto trigger_orphan_error trigger_orphan_error: ; - if int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) == int32(1) { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) == int32(1) { /* Ticket #3810. ** Normally, whenever a table is dropped, all associated triggers are ** dropped too. But if a TEMP trigger is created on a non-TEMP table @@ -131806,8 +126494,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger = pTrig pTrig = uintptr(0) } else { @@ -131850,15 +126537,12 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { pLink = pTrig pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema + 40 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pTrig = _sqlite3HashInsert(tls, pHash, zName, pTrig) if pTrig != 0 { _sqlite3OomFault(tls, db) } else { if (*TTrigger)(unsafe.Pointer(pLink)).FpSchema == (*TTrigger)(unsafe.Pointer(pLink)).FpTabSchema { pTab = _sqlite3HashFind(tls, (*TTrigger)(unsafe.Pointer(pLink)).FpTabSchema+8, (*TTrigger)(unsafe.Pointer(pLink)).Ftable) - _ = libc.Int32FromInt32(0) (*TTrigger)(unsafe.Pointer(pLink)).FpNext = (*TTable)(unsafe.Pointer(pTab)).FpTrigger (*TTable)(unsafe.Pointer(pTab)).FpTrigger = pLink } @@ -131868,7 +126552,6 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl triggerfinish_cleanup: ; _sqlite3DeleteTrigger(tls, db, pTrig) - _ = libc.Int32FromInt32(0) _sqlite3DeleteTriggerStep(tls, db, pStepList) } @@ -131889,7 +126572,7 @@ func _triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) (r if !(*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) { break } - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&int32(0x01) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&int32(0x01) != 0 { *(*int8)(unsafe.Pointer(z + uintptr(i))) = int8(' ') } goto _1 @@ -131948,7 +126631,7 @@ func _triggerStepAllocate(tls *libc.TLS, pParse uintptr, op Tu8, pName uintptr, (*TTriggerStep)(unsafe.Pointer(pTriggerStep)).FzTarget = z (*TTriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = op (*TTriggerStep)(unsafe.Pointer(pTriggerStep)).FzSpan = _triggerSpanDup(tls, db, zStart, zEnd) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenMap(tls, pParse, (*TTriggerStep)(unsafe.Pointer(pTriggerStep)).FzTarget, pName) } } @@ -131968,10 +126651,9 @@ func _sqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr var db, pTriggerStep uintptr _, _ = db, pTriggerStep db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) pTriggerStep = _triggerStepAllocate(tls, pParse, uint8(TK_INSERT), pTableName, zStart, zEnd) if pTriggerStep != 0 { - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*TTriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect pSelect = uintptr(0) } else { @@ -132004,7 +126686,7 @@ func _sqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr db = (*TParse)(unsafe.Pointer(pParse)).Fdb pTriggerStep = _triggerStepAllocate(tls, pParse, uint8(TK_UPDATE), pTableName, zStart, zEnd) if pTriggerStep != 0 { - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*TTriggerStep)(unsafe.Pointer(pTriggerStep)).FpExprList = pEList (*TTriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = pWhere (*TTriggerStep)(unsafe.Pointer(pTriggerStep)).FpFrom = pFrom @@ -132037,7 +126719,7 @@ func _sqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr db = (*TParse)(unsafe.Pointer(pParse)).Fdb pTriggerStep = _triggerStepAllocate(tls, pParse, uint8(TK_DELETE), pTableName, zStart, zEnd) if pTriggerStep != 0 { - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*TTriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = pWhere pWhere = uintptr(0) } else { @@ -132090,10 +126772,8 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int if SQLITE_OK != _sqlite3ReadSchema(tls, pParse) { goto drop_trigger_cleanup } - _ = libc.Int32FromInt32(0) zDb = (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzDatabase zName = (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName - _ = libc.Int32FromInt32(0) i = OMIT_TEMPDB for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -132108,7 +126788,6 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int if zDb != 0 && _sqlite3DbIsNamed(tls, db, j, zDb) == 0 { goto _1 } - _ = libc.Int32FromInt32(0) pTrigger = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*16))).FpSchema+40, zName) if pTrigger != 0 { break @@ -132157,9 +126836,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { _, _, _, _, _, _, _, _, _ = code, db, iDb, pTable, v, zDb, zTab, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTrigger)(unsafe.Pointer(pTrigger)).FpSchema) - _ = libc.Int32FromInt32(0) pTable = _tableOfTrigger(tls, pTrigger) - _ = libc.Int32FromInt32(0) if pTable != 0 { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName @@ -132195,7 +126872,6 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { func _sqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) { var pHash, pTab, pTrigger, pp uintptr _, _, _, _ = pHash, pTab, pTrigger, pp - _ = libc.Int32FromInt32(0) pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema + 40 pTrigger = _sqlite3HashInsert(tls, pHash, zName, uintptr(0)) if pTrigger != 0 { @@ -132288,7 +126964,6 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, mask = 0 pList = uintptr(0) pList = _sqlite3TriggerList(tls, pParse, pTab) - _ = libc.Int32FromInt32(0) if pList != uintptr(0) { p = pList if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_EnableTrigger) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpTrigger != uintptr(0) { @@ -132306,15 +126981,14 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p = pList } for cond := true; cond; cond = p != 0 { - if int32((*TTrigger)(unsafe.Pointer(p)).Fop) == op && _checkColumnOverlap(tls, (*TTrigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 { - mask |= int32((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) + if libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Fop) == op && _checkColumnOverlap(tls, (*TTrigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 { + mask |= libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) } else { - if int32((*TTrigger)(unsafe.Pointer(p)).Fop) == int32(TK_RETURNING) { + if libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Fop) == int32(TK_RETURNING) { /* The first time a RETURNING trigger is seen, the "op" value tells ** us what time of trigger it should be. */ - _ = libc.Int32FromInt32(0) - (*TTrigger)(unsafe.Pointer(p)).Fop = uint8(op) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + (*TTrigger)(unsafe.Pointer(p)).Fop = libc.Uint8FromInt32(op) + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { v1 = __ccgo_ts + 20994 @@ -132327,11 +127001,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, } else { (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_AFTER) } - mask |= int32((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) + mask |= libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) } else { - if (*TTrigger)(unsafe.Pointer(p)).FbReturning != 0 && int32((*TTrigger)(unsafe.Pointer(p)).Fop) == int32(TK_INSERT) && op == int32(TK_UPDATE) && (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) { + if (*TTrigger)(unsafe.Pointer(p)).FbReturning != 0 && libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Fop) == int32(TK_INSERT) && op == int32(TK_UPDATE) && (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) { /* Also fire a RETURNING trigger for an UPSERT */ - mask |= int32((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) + mask |= libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) } } } @@ -132353,7 +127027,6 @@ exit_triggers_exist: } func _sqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) (r uintptr) { - _ = libc.Int32FromInt32(0) if (*TTable)(unsafe.Pointer(pTab)).FpTrigger == uintptr(0) && !(_tempTriggersExist(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0) || (*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0 { if pMask != 0 { *(*int32)(unsafe.Pointer(pMask)) = 0 @@ -132384,8 +127057,6 @@ func _sqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) (r uin db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* SrcList to be returned */ zName = _sqlite3DbStrDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) pSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pSrc != 0 { pSchema = (*TTrigger)(unsafe.Pointer((*TTriggerStep)(unsafe.Pointer(pStep)).FpTrig)).FpSchema (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = zName @@ -132394,7 +127065,7 @@ func _sqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) (r uin } if (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { pDup = _sqlite3SrcListDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom, 0) - if pDup != 0 && (*TSrcList)(unsafe.Pointer(pDup)).FnSrc > int32(1) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if pDup != 0 && (*TSrcList)(unsafe.Pointer(pDup)).FnSrc > int32(1) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { pSubquery = _sqlite3SelectNew(tls, pParse, uintptr(0), pDup, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0)) (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(0) (*(*TToken)(unsafe.Pointer(bp))).Fz = uintptr(0) @@ -132416,16 +127087,13 @@ func _sqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) (r uin // ** form "table.*". // */ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pTerm)).Fop) == int32(TK_ASTERISK) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pTerm)).Fop) == int32(TK_ASTERISK) { return int32(1) } - if int32((*TExpr)(unsafe.Pointer(pTerm)).Fop) != int32(TK_DOT) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pTerm)).Fop) != int32(TK_DOT) { return 0 } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21056, 0) @@ -132461,7 +127129,7 @@ func _sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab if !(jj < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*12)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0 { + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*12)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0 { goto _2 } pNewExpr = _sqlite3Expr(tls, db, int32(TK_ID), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(jj)*12))).FzCnName) @@ -132482,7 +127150,7 @@ func _sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) && (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FzEName != uintptr(0) { pItem1 = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*20 (*TExprList_item)(unsafe.Pointer(pItem1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FzEName) - libc.SetBitFieldPtr16Uint32(pItem1+8+4, uint32(int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*20 + 8 + 4))&0x3>>0))), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pItem1+8+4, libc.Uint32FromInt32(int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*20 + 8 + 4))&0x3>>0))), 0, 0x3) } } goto _1 @@ -132502,7 +127170,7 @@ func _sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab func _sqlite3ReturningSubqueryVarSelect(tls *libc.TLS, NotUsed uintptr, pExpr uintptr) (r int32) { _ = NotUsed if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) && (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FselFlags&uint32(SF_Correlated) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_VarSelect)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_VarSelect)) } return WRC_Continue } @@ -132520,9 +127188,7 @@ func _sqlite3ReturningSubqueryCorrelated(tls *libc.TLS, pWalker uintptr, pSelect var i int32 var pSrc uintptr _, _ = i, pSrc - _ = libc.Int32FromInt32(0) pSrc = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) { @@ -132586,13 +127252,11 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { /* This RETURNING trigger must be for a different statement as ** this statement lacks a RETURNING clause. */ return } - _ = libc.Int32FromInt32(0) pReturning = *(*uintptr)(unsafe.Pointer(pParse + 144)) if pTrigger != pReturning+8 { /* This RETURNING trigger is for a different statement */ @@ -132608,7 +127272,6 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab (*(*TSrcItem)(unsafe.Pointer(bp + 76 + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - _ = libc.Int32FromInt32(0) _sqlite3GenerateColumnNames(tls, pParse, bp) } _sqlite3ExprListDelete(tls, db, (*(*TSelect)(unsafe.Pointer(bp))).FpEList) @@ -132639,7 +127302,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab break } pCol = (*(*TExprList_item)(unsafe.Pointer(pNew + 8 + uintptr(i)*20))).FpExpr - _ = libc.Int32FromInt32(0) /* Due to !db->mallocFailed ~9 lines above */ + /* Due to !db->mallocFailed ~9 lines above */ _sqlite3ExprCodeFactorable(tls, pParse, pCol, reg+i) if int32(_sqlite3ExprAffinity(tls, pCol)) == int32(SQLITE_AFF_REAL) { _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), reg+i) @@ -132674,9 +127337,6 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon _, _, _, _, _ = db, pSelect, pStep, v, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pStep = pStepList for { if !(pStep != 0) { @@ -132696,27 +127356,25 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon ** INSERT OR IGNORE INTO t1 ... ; -- insert into t2 uses IGNORE policy */ if orconf == int32(OE_Default) { - v2 = int32((*TTriggerStep)(unsafe.Pointer(pStep)).Forconf) + v2 = libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Forconf) } else { - v2 = int32(uint8(orconf)) + v2 = libc.Int32FromUint8(libc.Uint8FromInt32(orconf)) } - (*TParse)(unsafe.Pointer(pParse)).FeOrconf = uint8(v2) - _ = libc.Int32FromInt32(0) + (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6327, libc.VaList(bp+40, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } - switch int32((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { + switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): - _sqlite3Update(tls, pParse, _sqlite3TriggerStepSrc(tls, pParse, pStep), _sqlite3ExprListDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpExprList, 0), _sqlite3ExprDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0), int32((*TParse)(unsafe.Pointer(pParse)).FeOrconf), uintptr(0), uintptr(0), uintptr(0)) + _sqlite3Update(tls, pParse, _sqlite3TriggerStepSrc(tls, pParse, pStep), _sqlite3ExprListDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpExprList, 0), _sqlite3ExprDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0), libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeOrconf), uintptr(0), uintptr(0), uintptr(0)) _sqlite3VdbeAddOp0(tls, v, int32(OP_ResetCount)) case int32(TK_INSERT): - _sqlite3Insert(tls, pParse, _sqlite3TriggerStepSrc(tls, pParse, pStep), _sqlite3SelectDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpSelect, 0), _sqlite3IdListDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpIdList), int32((*TParse)(unsafe.Pointer(pParse)).FeOrconf), _sqlite3UpsertDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpUpsert)) + _sqlite3Insert(tls, pParse, _sqlite3TriggerStepSrc(tls, pParse, pStep), _sqlite3SelectDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpSelect, 0), _sqlite3IdListDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpIdList), libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeOrconf), _sqlite3UpsertDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpUpsert)) _sqlite3VdbeAddOp0(tls, v, int32(OP_ResetCount)) case int32(TK_DELETE): _sqlite3DeleteFrom(tls, pParse, _sqlite3TriggerStepSrc(tls, pParse, pStep), _sqlite3ExprDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0), uintptr(0), uintptr(0)) _sqlite3VdbeAddOp0(tls, v, int32(OP_ResetCount)) default: - _ = libc.Int32FromInt32(0) pSelect = _sqlite3SelectDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpSelect, 0) _sqlite3SelectDestInit(tls, bp, int32(SRT_Discard), 0) _sqlite3Select(tls, pParse, pSelect, bp) @@ -132739,8 +127397,6 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon // ** from pFrom to pTo. // */ func _transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pTo)).FnErr == 0 { (*TParse)(unsafe.Pointer(pTo)).FzErrMsg = (*TParse)(unsafe.Pointer(pFrom)).FzErrMsg (*TParse)(unsafe.Pointer(pTo)).FnErr = (*TParse)(unsafe.Pointer(pFrom)).FnErr @@ -132774,8 +127430,6 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp pWhen = uintptr(0) /* Name context for sub-vdbe */ pProgram = uintptr(0) /* Sub-vdbe for trigger program */ iEndTrigger = 0 /* Parse context for sub-vdbe */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Allocate the TriggerPrg and SubProgram objects. To ensure that they ** are freed if an error occurs, link them into the Parse.pTriggerPrg ** list of the top-level Parse object sooner rather than later. */ @@ -132817,7 +127471,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp ** OP_Halt inserted at the end of the program. */ if (*TTrigger)(unsafe.Pointer(pTrigger)).FpWhen != 0 { pWhen = _sqlite3ExprDup(tls, db, (*TTrigger)(unsafe.Pointer(pTrigger)).FpWhen, 0) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && SQLITE_OK == _sqlite3ResolveExprNames(tls, bp, pWhen) { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && SQLITE_OK == _sqlite3ResolveExprNames(tls, bp, pWhen) { iEndTrigger = _sqlite3VdbeMakeLabel(tls, bp+36) _sqlite3ExprIfFalse(tls, bp+36, pWhen, iEndTrigger, int32(SQLITE_JUMPIFNULL)) } @@ -132832,7 +127486,6 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+36) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - _ = libc.Int32FromInt32(0) (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+4, pTop+104) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 36))).FnMem @@ -132844,7 +127497,6 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp } else { _transferParseError(tls, pParse, bp+36) } - _ = libc.Int32FromInt32(0) _sqlite3ParseObjectReset(tls, bp+36) return pPrg } @@ -132866,7 +127518,6 @@ func _getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt v1 = pParse } pRoot = v1 - _ = libc.Int32FromInt32(0) /* It may be that this trigger has already been coded (or is in the ** process of being coded). If this is the case, then an entry with ** a matching TriggerPrg.pTrigger field will be present somewhere @@ -132903,7 +127554,6 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab _, _, _, _, _ = bRecursive, pPrg, v, v1, v2 v = _sqlite3GetVdbe(tls, pParse) pPrg = _getRowTrigger(tls, pParse, p, pTab, orconf) - _ = libc.Int32FromInt32(0) /* Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { @@ -132917,7 +127567,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** invocation is disallowed if (a) the sub-program is really a trigger, ** not a foreign key action, and (b) the flag to enable recursive triggers ** is clear. */ - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(bRecursive))) + _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(bRecursive))) } } @@ -132966,9 +127616,6 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab func _sqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { var p uintptr _ = p /* Used to iterate through pTrigger list */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p = pTrigger for { if !(p != 0) { @@ -132977,15 +127624,12 @@ func _sqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op /* Sanity checking: The schema for the trigger and for the table are ** always defined. The trigger must be in the same schema as the table ** or else it must be a TEMP trigger. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Determine whether we should code this trigger. One of two choices: ** 1. The trigger is an exact match to the current DML statement ** 2. This is a RETURNING trigger for INSERT but we are currently ** doing the UPDATE part of an UPSERT. */ - if (int32((*TTrigger)(unsafe.Pointer(p)).Fop) == op || (*TTrigger)(unsafe.Pointer(p)).FbReturning != 0 && int32((*TTrigger)(unsafe.Pointer(p)).Fop) == int32(TK_INSERT) && op == int32(TK_UPDATE)) && int32((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) == tr_tm && _checkColumnOverlap(tls, (*TTrigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 { + if (libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Fop) == op || (*TTrigger)(unsafe.Pointer(p)).FbReturning != 0 && libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Fop) == int32(TK_INSERT) && op == int32(TK_UPDATE)) && libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) == tr_tm && _checkColumnOverlap(tls, (*TTrigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 { if !((*TTrigger)(unsafe.Pointer(p)).FbReturning != 0) { _sqlite3CodeRowTriggerDirect(tls, pParse, p, pTab, reg, orconf, ignoreJump) } else { @@ -133040,8 +127684,7 @@ func _sqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pCh } op = v1 mask = uint32(0) - _ = libc.Int32FromInt32(0) - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { return uint32(0xffffffff) } p = pTrigger @@ -133049,7 +127692,7 @@ func _sqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pCh if !(p != 0) { break } - if int32((*TTrigger)(unsafe.Pointer(p)).Fop) == op && tr_tm&int32((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) != 0 && _checkColumnOverlap(tls, (*TTrigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 { + if libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Fop) == op && tr_tm&libc.Int32FromUint8((*TTrigger)(unsafe.Pointer(p)).Ftr_tm) != 0 && _checkColumnOverlap(tls, (*TTrigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 { if (*TTrigger)(unsafe.Pointer(p)).FbReturning != 0 { mask = uint32(0xffffffff) } else { @@ -133106,20 +127749,16 @@ func _sqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg var pCol uintptr var _ /* pValue at bp+0 */ uintptr _, _ = enc, pCol - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12 if (*TColumn)(unsafe.Pointer(pCol)).FiDflt != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) enc = (*Tsqlite3)(unsafe.Pointer(_sqlite3VdbeDb(tls, v))).Fenc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _sqlite3ValueFromExpr(tls, _sqlite3VdbeDb(tls, v), _sqlite3ColumnExpr(tls, pTab, pCol), enc, uint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) + _sqlite3ValueFromExpr(tls, _sqlite3VdbeDb(tls, v), _sqlite3ColumnExpr(tls, pTab, pCol), enc, libc.Uint8FromInt8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { _sqlite3VdbeAppendP4(tls, v, *(*uintptr)(unsafe.Pointer(bp)), -int32(10)) } } - if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_REAL) && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_REAL) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), iReg) } } @@ -133141,13 +127780,10 @@ func _indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef u var iIdxCol Ti16 _ = iIdxCol iIdxCol = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2)) - _ = libc.Int32FromInt32(0) /* Cannot index rowid */ + /* Cannot index rowid */ if int32(iIdxCol) >= 0 { return libc.BoolInt32(*(*int32)(unsafe.Pointer(aXRef + uintptr(iIdxCol)*4)) >= 0) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return _sqlite3ExprReferencesUpdatedColumn(tls, (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(iCol)*20))).FpExpr, aXRef, chngRowid) } @@ -133248,9 +127884,7 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p _ = pLimit pSrc = _sqlite3SrcListDup(tls, db, pTabList, 0) pWhere2 = _sqlite3ExprDup(tls, db, pWhere, 0) - _ = libc.Int32FromInt32(0) if pSrc != 0 { - _ = libc.Int32FromInt32(0) (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpTab)).FnTabRef-- (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpTab = uintptr(0) @@ -133258,7 +127892,7 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p if pPk != 0 { i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } pNew = _exprRowColumn(tls, pParse, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) @@ -133268,14 +127902,14 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p ; i++ } - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { v2 = int32(SRT_Table) } else { v2 = int32(SRT_Upfrom) } eDest = v2 } else { - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { i = 0 for { if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { @@ -133289,7 +127923,7 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p } eDest = int32(SRT_Table) } else { - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { v4 = int32(SRT_Table) } else { v4 = int32(SRT_Upfrom) @@ -133298,7 +127932,6 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p pList = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3PExpr(tls, pParse, int32(TK_ROW), uintptr(0), uintptr(0))) } } - _ = libc.Int32FromInt32(0) if pChanges != 0 { i = 0 for { @@ -133312,13 +127945,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p i++ } } - pSelect = _sqlite3SelectNew(tls, pParse, pList, pSrc, pWhere2, pGrp, uintptr(0), pOrderBy2, uint32(libc.Int32FromInt32(SF_UFSrcCheck)|libc.Int32FromInt32(SF_IncludeHidden)|libc.Int32FromInt32(SF_UpdateFrom)), pLimit2) + pSelect = _sqlite3SelectNew(tls, pParse, pList, pSrc, pWhere2, pGrp, uintptr(0), pOrderBy2, libc.Uint32FromInt32(libc.Int32FromInt32(SF_UFSrcCheck)|libc.Int32FromInt32(SF_IncludeHidden)|libc.Int32FromInt32(SF_UpdateFrom)), pLimit2) if pSelect != 0 { *(*Tu32)(unsafe.Pointer(pSelect + 4)) |= uint32(SF_OrderByReqd) } _sqlite3SelectDestInit(tls, bp, eDest, iEph) if pPk != 0 { - v6 = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) + v6 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } else { v6 = -int32(1) } @@ -133380,11 +128013,9 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui regKey = 0 /* composite PRIMARY KEY value */ libc.Xmemset(tls, bp, 0, uint32(8)) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto update_cleanup } - _ = libc.Int32FromInt32(0) /* Locate the table which we want to update. */ pTab = _sqlite3SrcListLookup(tls, pParse, pTabList) @@ -133396,8 +128027,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** updated is a view. */ pTrigger = _sqlite3TriggersExist(tls, pParse, pTab, int32(TK_UPDATE), pChanges, bp+44) - isView = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW)) - _ = libc.Int32FromInt32(0) + isView = libc.BoolInt32(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW)) /* If there was a FROM clause, set nChangeFrom to the number of expressions ** in the change-list. Otherwise, set it to 0. There cannot be a FROM ** clause if this function is being called to generate code for part of @@ -133408,7 +128038,6 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui v1 = 0 } nChangeFrom = v1 - _ = libc.Int32FromInt32(0) if _sqlite3ViewGetColumnNames(tls, pParse, pTab) != 0 { goto update_cleanup } @@ -133459,13 +128088,13 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*uint32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+uint32(nIdx)+uint32(2))) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*libc.Uint32FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint32FromInt32(nIdx)+uint32(2))) if aXRef == uintptr(0) { goto update_cleanup } aRegIdx = aXRef + uintptr((*TTable)(unsafe.Pointer(pTab)).FnCol)*4 aToOpen = aRegIdx + uintptr(nIdx)*4 + libc.UintptrFromInt32(1)*4 - libc.Xmemset(tls, aToOpen, int32(1), uint32(nIdx+int32(1))) + libc.Xmemset(tls, aToOpen, int32(1), libc.Uint32FromInt32(nIdx+int32(1))) *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nIdx+int32(1)))) = uint8(0) i = 0 for { @@ -133514,16 +128143,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FhName) == int32(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) == 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) == 0 { if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr iRowidExpr = i } else { - if pPk != 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { chngPk = uint8(1) } else { - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21112, libc.VaList(bp+80, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) goto update_cleanup } @@ -133567,10 +128196,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ; i++ } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - chngKey = uint8(int32(chngRowid) + int32(chngPk)) + chngKey = libc.Uint8FromInt32(libc.Int32FromUint8(chngRowid) + libc.Int32FromUint8(chngPk)) /* Mark generated columns as changing if their generator expressions ** reference any changing column. The actual aXRef[] value for ** generated expressions is not used, other than to check to see that it @@ -133589,10 +128215,10 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { goto _12 } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { goto _12 } - if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), aXRef, int32(chngRowid)) != 0 { + if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } @@ -133608,13 +128234,13 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** case, set all bits of the colUsed mask (to ensure that the virtual ** table implementation makes all columns available). */ - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = uint64(-libc.Int32FromInt32(1)) + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { v13 = uint64(0) } (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 - hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, int32(chngKey)) + hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold ** the key for accessing each index. @@ -133628,26 +128254,26 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(pIdx != 0) { break } - if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, int32(chngRowid)) != 0 { + if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { v16 = pParse + 44 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) reg = v15 - *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 44)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } - if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, int32(chngRowid)) != 0 { + if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { v19 = pParse + 44 *(*int32)(unsafe.Pointer(v19))++ v18 = *(*int32)(unsafe.Pointer(v19)) reg = v18 - *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) - if onError == int32(OE_Default) && int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { + *(*int32)(unsafe.Pointer(pParse + 44)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 56)) = int32(1) } break @@ -133675,20 +128301,19 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if *(*int32)(unsafe.Pointer(bp + 56)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ - libc.Xmemset(tls, aToOpen, int32(1), uint32(nIdx+int32(1))) + libc.Xmemset(tls, aToOpen, int32(1), libc.Uint32FromInt32(nIdx+int32(1))) } - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 { _sqlite3VdbeCountChanges(tls, v) } _sqlite3BeginWriteOperation(tls, pParse, libc.BoolInt32(pTrigger != 0 || hasFK != 0), iDb) /* Allocate required registers. */ - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { /* For now, regRowSet and aRegIdx[nAllIdx] share the same register. ** If regRowSet turns out to be needed, then aRegIdx[nAllIdx] will be ** reallocated. aRegIdx[nAllIdx] is the register in which the main ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ - _ = libc.Int32FromInt32(0) regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) v24 = pParse + 44 *(*int32)(unsafe.Pointer(v24))++ @@ -133728,7 +128353,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Virtual tables must be handled separately */ - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { _updateVirtualTable(tls, pParse, pTabList, pTab, pChanges, pRowidExpr, aXRef, pWhere, onError) goto update_cleanup } @@ -133738,7 +128363,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui labelContinue = v27 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) && !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) && pUpsert == uintptr(0) { + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) && !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) && pUpsert == uintptr(0) { v29 = pParse + 44 *(*int32)(unsafe.Pointer(v29))++ v28 = *(*int32)(unsafe.Pointer(v29)) @@ -133753,9 +128378,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui iEph = v30 addrOpen = _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenEphemeral), iEph, 0, regRowSet) } else { - _ = libc.Int32FromInt32(0) if pPk != 0 { - v32 = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) + v32 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } else { v32 = 0 } @@ -133785,7 +128409,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if pPk != 0 { pKeyInfo = _sqlite3KeyInfoOfIndex(tls, pParse, pPk) if pKeyInfo != 0 { - (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField = uint16(nEphCol) + (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField = libc.Uint16FromInt32(nEphCol) _sqlite3VdbeAppendP4(tls, v, pKeyInfo, -int32(8)) } } @@ -133826,10 +128450,10 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** (5) There are subqueries in the WHERE clause */ flags = int32(WHERE_ONEPASS_DESIRED) - if !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !(pTrigger != 0) && !(hasFK != 0) && !(chngKey != 0) && !(*(*int32)(unsafe.Pointer(bp + 56)) != 0) && (pWhere == uintptr(0) || !((*TExpr)(unsafe.Pointer(pWhere)).Fflags&uint32(libc.Int32FromInt32(EP_Subquery)) != libc.Uint32FromInt32(0))) { + if !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !(pTrigger != 0) && !(hasFK != 0) && !(chngKey != 0) && !(*(*int32)(unsafe.Pointer(bp + 56)) != 0) && (pWhere == uintptr(0) || !((*TExpr)(unsafe.Pointer(pWhere)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != libc.Uint32FromInt32(0))) { flags |= int32(WHERE_ONEPASS_MULTIROW) } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), uintptr(0), uint16(flags), iIdxCur) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), uintptr(0), libc.Uint16FromInt32(flags), iIdxCur) if pWInfo == uintptr(0) { goto update_cleanup } @@ -133852,7 +128476,6 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if iCur >= 0 && iCur != iDataCur && *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(iCur-iBaseCur))) != 0 { eOnePass = ONEPASS_OFF } - _ = libc.Int32FromInt32(0) } } } @@ -133883,7 +128506,6 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < int32(nPk)) { break } - _ = libc.Int32FromInt32(0) _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), iPk+i) goto _40 _40: @@ -133930,7 +128552,6 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Top of the update loop */ if eOnePass != ONEPASS_OFF { if (*(*[2]int32)(unsafe.Pointer(bp + 48)))[0] != iDataCur && (*(*[2]int32)(unsafe.Pointer(bp + 48)))[int32(1)] != iDataCur { - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NotFound), iDataCur, labelBreak, regKey, nKey) } if eOnePass != int32(ONEPASS_SINGLE) { @@ -133983,9 +128604,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** contain the new value. If the rowid is not being modified, ** then regNewRowid is the same register as regOldRowid, which is ** already populated. */ - _ = libc.Int32FromInt32(0) if chngRowid != 0 { - _ = libc.Int32FromInt32(0) if nChangeFrom == 0 { _sqlite3ExprCode(tls, pParse, pRowidExpr, regNewRowid) } else { @@ -134020,7 +128639,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ; i++ } - if int32(chngRowid) == 0 && pPk == uintptr(0) { + if libc.Int32FromUint8(chngRowid) == 0 && pPk == uintptr(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Copy), regOldRowid, regNewRowid) } } @@ -134037,7 +128656,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** may have modified them). So not loading those that are not going to ** be used eliminates some redundant opcodes. */ - newmask = int32(_sqlite3TriggerColmask(tls, pParse, pTrigger, pChanges, int32(1), int32(TRIGGER_BEFORE), pTab, onError)) + newmask = libc.Int32FromUint32(_sqlite3TriggerColmask(tls, pParse, pTrigger, pChanges, int32(1), int32(TRIGGER_BEFORE), pTab, onError)) i = 0 k = regNew for { @@ -134047,8 +128666,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if i == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, k) } else { - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { k-- } } else { @@ -134061,13 +128680,12 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui v46 = int32(nPk) } nOff = v46 - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*20))).FpExpr, k) } } else { - if 0 == *(*int32)(unsafe.Pointer(bp + 44))&int32(TRIGGER_BEFORE) || i > int32(31) || uint32(newmask)&(libc.Uint32FromInt32(1)<<i) != 0 { + if 0 == *(*int32)(unsafe.Pointer(bp + 44))&int32(TRIGGER_BEFORE) || i > int32(31) || libc.Uint32FromInt32(newmask)&(libc.Uint32FromInt32(1)<<i) != 0 { /* This branch loads the value of a column that will not be changed ** into a register. This is done if there are no BEFORE triggers, or ** if there are one or more BEFORE triggers that use this value via @@ -134123,8 +128741,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { k-- } } else { @@ -134145,8 +128763,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } if !(isView != 0) { /* Do constraint checks. */ - _ = libc.Int32FromInt32(0) - _sqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, iDataCur, iIdxCur, regNewRowid, regOldRowid, chngKey, uint8(onError), labelContinue, bp+56, aXRef, uintptr(0)) + _sqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, iDataCur, iIdxCur, regNewRowid, regOldRowid, chngKey, libc.Uint8FromInt32(onError), labelContinue, bp+56, aXRef, uintptr(0)) /* If REPLACE conflict handling may have been used, or if the PK of the ** row is changing, then the GenerateConstraintChecks() above may have ** moved cursor iDataCur. Reseek it. */ @@ -134159,7 +128776,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Do FK constraint checks. */ if hasFK != 0 { - _sqlite3FkCheck(tls, pParse, pTab, regOldRowid, 0, aXRef, int32(chngKey)) + _sqlite3FkCheck(tls, pParse, pTab, regOldRowid, 0, aXRef, libc.Int32FromUint8(chngKey)) } /* Delete the index entries associated with the current record. */ _sqlite3GenerateRowIndexDelete(tls, pParse, pTab, iDataCur, iIdxCur, aRegIdx, -int32(1)) @@ -134180,7 +128797,6 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** value is copied from memory cell (regNewRowid+1+iCol), where iCol ** is the column index supplied by the user. */ - _ = libc.Int32FromInt32(0) if hasFK > int32(1) || chngKey != 0 { v48 = 0 } else { @@ -134188,14 +128804,13 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { - _ = libc.Int32FromInt32(0) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } if !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { _sqlite3VdbeAppendP4(tls, v, pTab, -int32(5)) } if hasFK != 0 { - _sqlite3FkCheck(tls, pParse, pTab, 0, regNewRowid, aXRef, int32(chngKey)) + _sqlite3FkCheck(tls, pParse, pTab, 0, regNewRowid, aXRef, libc.Int32FromUint8(chngKey)) } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { @@ -134208,7 +128823,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ if hasFK != 0 { - _sqlite3FkActions(tls, pParse, pTab, pChanges, regOldRowid, aXRef, int32(chngKey)) + _sqlite3FkActions(tls, pParse, pTab, pChanges, regOldRowid, aXRef, libc.Int32FromUint8(chngKey)) } } /* Increment the row counter @@ -134238,7 +128853,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** maximum rowid counter values recorded while inserting into ** autoincrement tables. */ - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0) && pUpsert == uintptr(0) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0) && pUpsert == uintptr(0) { _sqlite3AutoincrementEnd(tls, pParse) } /* @@ -134303,7 +128918,6 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - _ = libc.Int32FromInt32(0) v2 = pParse + 40 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ @@ -134321,8 +128935,6 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp } } else { /* PRIMARY KEY column */ pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iPk = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn)) if *(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)) >= 0 { pRow = _sqlite3ExprDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)))*20))).FpExpr, 0) @@ -134373,7 +128985,6 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*20))).FpExpr, regArg+int32(2)+i) } else { @@ -134394,15 +129005,12 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp } } else { /* PRIMARY KEY column */ pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iPk1 = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk1)).FaiColumn)) _sqlite3VdbeAddOp3(tls, v, int32(OP_VColumn), iCsr, int32(iPk1), regArg) _sqlite3VdbeAddOp2(tls, v, int32(OP_SCopy), regArg+int32(2)+int32(iPk1), regArg+int32(1)) } eOnePass = _sqlite3WhereOkOnePass(tls, pWInfo, bp) /* There is no ONEPASS_MULTI on virtual tables */ - _ = libc.Int32FromInt32(0) if eOnePass != 0 { /* If using the onepass strategy, no-op out the OP_OpenEphemeral coded ** above. */ @@ -134445,7 +129053,7 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp } else { v10 = onError } - _sqlite3VdbeChangeP5(tls, v, uint16(v10)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v10)) _sqlite3MayAbort(tls, pParse) /* End of the ephemeral table scan. Or, if using the onepass strategy, ** jump to here if the scan visited zero rows. */ @@ -134561,10 +129169,6 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr var _ /* zWhich at bp+140 */ [16]int8 _, _, _, _, _, _, _, _, _, _, _, _, _ = iCursor, ii, jj, nClause, nn, pExpr, pIdx, pTab, pTarget, pTerm, rc, v2, v3 /* Index column converted into an Expr */ nClause = 0 /* Counter of ON CONFLICT clauses */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Resolve all symbolic names in the conflict-target clause, which ** includes both the list of columns and the optional partial-index ** WHERE clause. @@ -134592,9 +129196,8 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr v2 = (*(*TExprList_item)(unsafe.Pointer(pTarget + 8))).FpExpr pTerm = v2 } - if v3 && int32((*TExpr)(unsafe.Pointer(v2)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pTerm)).FiColumn) == -int32(1) { + if v3 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(v2)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pTerm)).FiColumn) == -int32(1) { /* The conflict-target is the rowid of the primary table */ - _ = libc.Int32FromInt32(0) goto _1 } /* Initialize sCol[0..1] to be an expression parse tree for a @@ -134614,10 +129217,10 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if !(pIdx != 0) { break } - if !(int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) != libc.Int32FromInt32(OE_None)) { + if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) != libc.Int32FromInt32(OE_None)) { goto _4 } - if (*TExprList)(unsafe.Pointer(pTarget)).FnExpr != int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { + if (*TExprList)(unsafe.Pointer(pTarget)).FnExpr != libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { goto _4 } if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { @@ -134628,7 +129231,7 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr goto _4 } } - nn = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + nn = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) ii = 0 for { if !(ii < nn) { @@ -134636,11 +129239,8 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr } *(*uintptr)(unsafe.Pointer(bp + 36 + 8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(ii)*4)) if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))) == -int32(2) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pExpr = (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(ii)*20))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLLATE) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLLATE) { (*(*[2]TExpr)(unsafe.Pointer(bp + 36)))[0].FpLeft = pExpr pExpr = bp + 36 } @@ -134774,8 +129374,6 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb pTop = pUpsert - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iDataCur = (*TUpsert)(unsafe.Pointer(pUpsert)).FiDataCur pUpsert = _sqlite3UpsertOfIndex(tls, pTop, pIdx) if pIdx != 0 && iCur != iDataCur { @@ -134786,7 +129384,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab _sqlite3ReleaseTempReg(tls, pParse, regRowid) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - nPk = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) + nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) *(*int32)(unsafe.Pointer(pParse + 44)) += nPk i = 0 @@ -134794,7 +129392,6 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab if !(i < nPk) { break } - _ = libc.Int32FromInt32(0) k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 @@ -134880,7 +129477,6 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 break } zSubSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - _ = libc.Int32FromInt32(0) /* The secondary SQL must be one of CREATE TABLE, CREATE INDEX, ** or INSERT. Historically there have been attacks that first ** corrupt the sqlite_schema.sql field with other kinds of statements @@ -134893,7 +129489,6 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 } } } - _ = libc.Int32FromInt32(0) if rc == int32(SQLITE_DONE) { rc = SQLITE_OK } @@ -135029,8 +129624,8 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) - *(*uint32)(unsafe.Pointer(db + 56)) &= uint32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) - *(*uint32)(unsafe.Pointer(db + 56)) |= uint32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) + *(*uint32)(unsafe.Pointer(db + 56)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) + *(*uint32)(unsafe.Pointer(db + 56)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { zOut = __ccgo_ts + 1662 } @@ -135042,9 +129637,9 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 28)) |= uint64(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) - *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(libc.Int32FromInt32(DBFLAG_PreferBuiltin) | libc.Int32FromInt32(DBFLAG_Vacuum)) - *(*Tu64)(unsafe.Pointer(db + 28)) &= ^(uint64(libc.Int32FromInt32(SQLITE_ForeignKeys)|libc.Int32FromInt32(SQLITE_ReverseOrder)|libc.Int32FromInt32(SQLITE_Defensive)) | uint64(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) + *(*Tu64)(unsafe.Pointer(db + 28)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu32)(unsafe.Pointer(db + 24)) |= libc.Uint32FromInt32(libc.Int32FromInt32(DBFLAG_PreferBuiltin) | libc.Int32FromInt32(DBFLAG_Vacuum)) + *(*Tu64)(unsafe.Pointer(db + 28)) &= ^(libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_ForeignKeys)|libc.Int32FromInt32(SQLITE_ReverseOrder)|libc.Int32FromInt32(SQLITE_Defensive)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(0) zDbMain = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName pMain = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpBt @@ -135069,9 +129664,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p if rc != SQLITE_OK { goto end_of_vacuum } - _ = libc.Int32FromInt32(0) pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(nDb)*16 - _ = libc.Int32FromInt32(0) pTemp = (*TDb)(unsafe.Pointer(pDb)).FpBt if pOut != 0 { id = _sqlite3PagerFile(tls, _sqlite3BtreePager(tls, pTemp)) @@ -135125,7 +129718,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p /* Query the schema of the main database. Create a mirror schema ** in the temporary database. */ - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(nDb) /* force new CREATE statements into vacuum_db */ + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21416, libc.VaList(bp+24, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum @@ -135140,8 +129733,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** the contents to the temporary database. */ rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21578, libc.VaList(bp+24, zDbMain)) - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(db + 24)) &= uint32(^libc.Int32FromInt32(DBFLAG_Vacuum)) + *(*Tu32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -135154,18 +129746,16 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p if rc != 0 { goto end_of_vacuum } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Copy Btree meta values */ i = 0 for { - if !(i < int32(libc.Uint32FromInt64(10)/libc.Uint32FromInt64(1))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(10)/libc.Uint32FromInt64(1))) { break } /* GetMeta() and UpdateMeta() cannot fail in this context because ** we already have page 1 loaded into cache and marked dirty. */ - _sqlite3BtreeGetMeta(tls, pMain, int32(_aCopy[i]), bp+8) - rc = _sqlite3BtreeUpdateMeta(tls, pTemp, int32(_aCopy[i]), *(*Tu32)(unsafe.Pointer(bp + 8))+uint32(_aCopy[i+int32(1)])) + _sqlite3BtreeGetMeta(tls, pMain, libc.Int32FromUint8(_aCopy[i]), bp+8) + rc = _sqlite3BtreeUpdateMeta(tls, pTemp, libc.Int32FromUint8(_aCopy[i]), *(*Tu32)(unsafe.Pointer(bp + 8))+uint32(_aCopy[i+int32(1)])) if rc != SQLITE_OK { goto end_of_vacuum } @@ -135187,7 +129777,6 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p if pOut == uintptr(0) { _sqlite3BtreeSetAutoVacuum(tls, pMain, _sqlite3BtreeGetAutoVacuum(tls, pTemp)) } - _ = libc.Int32FromInt32(0) if pOut == uintptr(0) { nRes = _sqlite3BtreeGetRequestedReserve(tls, pTemp) rc = _sqlite3BtreeSetPageSize(tls, pMain, _sqlite3BtreeGetPageSize(tls, pTemp), nRes, int32(1)) @@ -135296,13 +129885,13 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(uint32(24)+uint32(nName)+uint32(1))) + pMod = _sqlite3Malloc(tls, uint64(uint32(24)+libc.Uint32FromInt32(nName)+uint32(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } zCopy = pMod + 1*24 - libc.Xmemcpy(tls, zCopy, zName, uint32(nName+int32(1))) + libc.Xmemcpy(tls, zCopy, zName, libc.Uint32FromInt32(nName+int32(1))) (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux @@ -135411,13 +130000,11 @@ func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) (r int32) // ** module when the reference count reaches zero. // */ func _sqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { - _ = libc.Int32FromInt32(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule-- if (*TModule)(unsafe.Pointer(pMod)).FnRefModule == 0 { if (*TModule)(unsafe.Pointer(pMod)).FxDestroy != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TModule)(unsafe.Pointer(pMod)).FxDestroy})))(tls, (*TModule)(unsafe.Pointer(pMod)).FpAux) } - _ = libc.Int32FromInt32(0) _sqlite3DbFree(tls, db, pMod) } } @@ -135446,7 +130033,6 @@ func _sqlite3VtabLock(tls *libc.TLS, pVTab uintptr) { func _sqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) (r uintptr) { var pVtab uintptr _ = pVtab - _ = libc.Int32FromInt32(0) pVtab = (*(*struct { FnArg int32 FazArg uintptr @@ -135474,9 +130060,6 @@ func _sqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { var db, p uintptr _, _ = db, p db = (*TVTable)(unsafe.Pointer(pVTab)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TVTable)(unsafe.Pointer(pVTab)).FnRef-- if (*TVTable)(unsafe.Pointer(pVTab)).FnRef == 0 { p = (*TVTable)(unsafe.Pointer(pVTab)).FpVtab @@ -135501,7 +130084,6 @@ func _vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { var db2, pNext, pRet, pVTable uintptr _, _, _, _ = db2, pNext, pRet, pVTable pRet = uintptr(0) - _ = libc.Int32FromInt32(0) pVTable = (*(*struct { FnArg int32 FazArg uintptr @@ -135518,11 +130100,9 @@ func _vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { ** this makes it safe to access the sqlite3.pDisconnect list of any ** database connection that may have an entry in the p->u.vtab.p list. */ - _ = libc.Int32FromInt32(0) for pVTable != 0 { db2 = (*TVTable)(unsafe.Pointer(pVTable)).Fdb pNext = (*TVTable)(unsafe.Pointer(pVTable)).FpNext - _ = libc.Int32FromInt32(0) if db2 == db { pRet = pVTable (*(*struct { @@ -135537,7 +130117,6 @@ func _vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { } pVTable = pNext } - _ = libc.Int32FromInt32(0) return pRet } @@ -135554,9 +130133,6 @@ func _vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { func _sqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { var pVTab, ppVTab uintptr _, _ = pVTab, ppVTab - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) ppVTab = p + 44 + 8 for { if !(*(*uintptr)(unsafe.Pointer(ppVTab)) != 0) { @@ -135601,8 +130177,6 @@ func _sqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { var p, pNext uintptr _, _ = p, pNext p = (*Tsqlite3)(unsafe.Pointer(db)).FpDisconnect - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if p != 0 { (*Tsqlite3)(unsafe.Pointer(db)).FpDisconnect = uintptr(0) for cond := true; cond; cond = p != 0 { @@ -135632,8 +130206,6 @@ func _sqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { func _sqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { var i int32 _ = i - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) { _vtabDisconnectAll(tls, uintptr(0), p) } @@ -135687,8 +130259,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint var nBytes Tsqlite3_int64 _, _, _, _, _, _ = azModuleArg, db, i, nBytes, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) - nBytes = int64(uint32(4) * uint32(libc.Int32FromInt32(2)+(*(*struct { + nBytes = libc.Int64FromUint32(uint32(4) * libc.Uint32FromInt32(libc.Int32FromInt32(2)+(*(*struct { FnArg int32 FazArg uintptr Fp uintptr @@ -135704,7 +130275,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FnArg int32 FazArg uintptr Fp uintptr - })(unsafe.Pointer(pTable + 44))).FazArg, uint64(nBytes)) + })(unsafe.Pointer(pTable + 44))).FazArg, libc.Uint64FromInt64(nBytes)) if azModuleArg == uintptr(0) { _sqlite3DbFree(tls, db, zArg) } else { @@ -135738,15 +130309,12 @@ func _sqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName if pTable == uintptr(0) { return } - _ = libc.Int32FromInt32(0) (*TTable)(unsafe.Pointer(pTable)).FeTabType = uint8(TABTYP_VTAB) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) _addModuleArgument(tls, pParse, pTable, _sqlite3NameFromToken(tls, db, pModuleName)) _addModuleArgument(tls, pParse, pTable, uintptr(0)) _addModuleArgument(tls, pParse, pTable, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTable)).FzName)) - _ = libc.Int32FromInt32(0) - (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = uint32(t__predefined_ptrdiff_t((*TToken)(unsafe.Pointer(pModuleName)).Fz+uintptr((*TToken)(unsafe.Pointer(pModuleName)).Fn)) - int32((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(t__predefined_ptrdiff_t((*TToken)(unsafe.Pointer(pModuleName)).Fz+uintptr((*TToken)(unsafe.Pointer(pModuleName)).Fn)) - int32((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) /* Creating a virtual table invokes the authorization callback twice. ** The first invocation, to obtain permission to INSERT a row into the ** sqlite_schema table, has already been made by sqlite3StartTable(). @@ -135758,7 +130326,7 @@ func _sqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName Fp uintptr })(unsafe.Pointer(pTable + 44))).FazArg != 0 { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTable)).FpSchema) - _ = libc.Int32FromInt32(0) /* The database the table is being created in */ + /* The database the table is being created in */ _sqlite3AuthCheck(tls, pParse, int32(SQLITE_CREATE_VTABLE), (*TTable)(unsafe.Pointer(pTable)).FzName, *(*uintptr)(unsafe.Pointer((*(*struct { FnArg int32 FazArg uintptr @@ -135780,9 +130348,9 @@ func _addArgumentToVtab(tls *libc.TLS, pParse uintptr) { _, _, _ = db, n, z if (*TParse)(unsafe.Pointer(pParse)).FsArg.Fz != 0 && (*TParse)(unsafe.Pointer(pParse)).FpNewTable != 0 { z = (*TParse)(unsafe.Pointer(pParse)).FsArg.Fz - n = int32((*TParse)(unsafe.Pointer(pParse)).FsArg.Fn) + n = libc.Int32FromUint32((*TParse)(unsafe.Pointer(pParse)).FsArg.Fn) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _addModuleArgument(tls, pParse, (*TParse)(unsafe.Pointer(pParse)).FpNewTable, _sqlite3DbStrNDup(tls, db, z, uint64(n))) + _addModuleArgument(tls, pParse, (*TParse)(unsafe.Pointer(pParse)).FpNewTable, _sqlite3DbStrNDup(tls, db, z, libc.Uint64FromInt32(n))) } } @@ -135803,7 +130371,6 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pTab == uintptr(0) { return } - _ = libc.Int32FromInt32(0) _addArgumentToVtab(tls, pParse) (*TParse)(unsafe.Pointer(pParse)).FsArg.Fz = uintptr(0) if (*(*struct { @@ -135823,7 +130390,7 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { _sqlite3MayAbort(tls, pParse) /* Compute the complete text of the CREATE VIRTUAL TABLE statement */ if pEnd != 0 { - (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = uint32(int32((*TToken)(unsafe.Pointer(pEnd)).Fz)-int32((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + (*TToken)(unsafe.Pointer(pEnd)).Fn + (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32((*TToken)(unsafe.Pointer(pEnd)).Fz)-int32((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + (*TToken)(unsafe.Pointer(pEnd)).Fn } zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21859, libc.VaList(bp+8, pParse+200)) /* A slot for the record has already been allocated in the @@ -135851,12 +130418,11 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { } else { pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema zName = (*TTable)(unsafe.Pointer(pTab)).FzName - _ = libc.Int32FromInt32(0) _sqlite3MarkAllShadowTablesOf(tls, db, pTab) pOld = _sqlite3HashInsert(tls, pSchema+8, zName, pTab) if pOld != 0 { _sqlite3OomFault(tls, db) - _ = libc.Int32FromInt32(0) /* Malloc must have failed inside HashInsert() */ + /* Malloc must have failed inside HashInsert() */ return } (*TParse)(unsafe.Pointer(pParse)).FpNewTable = uintptr(0) @@ -135889,8 +130455,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { (*TToken)(unsafe.Pointer(pArg)).Fz = (*TToken)(unsafe.Pointer(p)).Fz (*TToken)(unsafe.Pointer(pArg)).Fn = (*TToken)(unsafe.Pointer(p)).Fn } else { - _ = libc.Int32FromInt32(0) - (*TToken)(unsafe.Pointer(pArg)).Fn = uint32(t__predefined_ptrdiff_t((*TToken)(unsafe.Pointer(p)).Fz+uintptr((*TToken)(unsafe.Pointer(p)).Fn)) - int32((*TToken)(unsafe.Pointer(pArg)).Fz)) + (*TToken)(unsafe.Pointer(pArg)).Fn = libc.Uint32FromInt32(t__predefined_ptrdiff_t((*TToken)(unsafe.Pointer(p)).Fz+uintptr((*TToken)(unsafe.Pointer(p)).Fn)) - int32((*TToken)(unsafe.Pointer(pArg)).Fz)) } } @@ -135916,7 +130481,6 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, Fp uintptr })(unsafe.Pointer(pTab + 44))).FnArg *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) - _ = libc.Int32FromInt32(0) azArg = (*(*struct { FnArg int32 FazArg uintptr @@ -135957,8 +130521,6 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, Fp uintptr })(unsafe.Pointer(pTab + 44))).FazArg + 1*4)) = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName /* Invoke the virtual table constructor */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*(*TVtabCtx)(unsafe.Pointer(bp))).FpTab = pTab (*(*TVtabCtx)(unsafe.Pointer(bp))).FpVTable = pVTable (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx @@ -135966,14 +130528,11 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+8, bp+16) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } - _ = libc.Int32FromInt32(0) if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22043, libc.VaList(bp+32, zModuleName)) @@ -136052,7 +130611,6 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, j++ } if int32(*(*int8)(unsafe.Pointer(zType + uintptr(i)))) == int32('\000') && i > 0 { - _ = libc.Int32FromInt32(0) *(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1)))) = int8('\000') } p6 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 + 10 @@ -136091,8 +130649,6 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int var _ /* zErr at bp+0 */ uintptr _, _, _, _, _ = db, pMod, rc, zMod, zModule db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _sqlite3GetVTable(tls, db, pTab) != 0 { return SQLITE_OK } @@ -136138,11 +130694,11 @@ func _growVTrans(tls *libc.TLS, db uintptr) (r int32) { /* Grow the sqlite3.aVTrans array if required */ if (*Tsqlite3)(unsafe.Pointer(db)).FnVTrans%ARRAY_INCR == 0 { nBytes = int64(4) * (int64((*Tsqlite3)(unsafe.Pointer(db)).FnVTrans) + int64(ARRAY_INCR)) - aVTrans = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaVTrans, uint64(nBytes)) + aVTrans = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaVTrans, libc.Uint64FromInt64(nBytes)) if !(aVTrans != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, aVTrans+uintptr((*Tsqlite3)(unsafe.Pointer(db)).FnVTrans)*4, 0, uint32(4)*uint32(ARRAY_INCR)) + libc.Xmemset(tls, aVTrans+uintptr((*Tsqlite3)(unsafe.Pointer(db)).FnVTrans)*4, 0, uint32(4)*libc.Uint32FromInt32(ARRAY_INCR)) (*Tsqlite3)(unsafe.Pointer(db)).FaVTrans = aVTrans } return SQLITE_OK @@ -136184,7 +130740,6 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, _, _, _, _ = pMod, pTab, rc, zMod rc = SQLITE_OK pTab = _sqlite3FindTable(tls, db, zTab, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) - _ = libc.Int32FromInt32(0) /* Locate the required virtual table module */ zMod = *(*uintptr)(unsafe.Pointer((*(*struct { FnArg int32 @@ -136244,7 +130799,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp + 284)) == int32(TK_SPACE) { z += uintptr(_sqlite3GetToken(tls, z, bp+284)) } - if *(*int32)(unsafe.Pointer(bp + 284)) != int32(_aKeyword1[i]) { + if *(*int32)(unsafe.Pointer(bp + 284)) != libc.Int32FromUint8(_aKeyword1[i]) { _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22138, 0) return int32(SQLITE_ERROR) } @@ -136256,27 +130811,21 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(156227))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(156236))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(156229)) + return _sqlite3MisuseError(tls, int32(156238)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab - _ = libc.Int32FromInt32(0) _sqlite3ParseObjectInit(tls, bp, db) (*(*TParse)(unsafe.Pointer(bp))).FeParseMode = uint8(PARSE_MODE_DECLARE_VTAB) (*(*TParse)(unsafe.Pointer(bp))).FdisableTriggers = uint8(1) /* We should never be able to reach this point while loading the ** schema. Nevertheless, defend against that (turn off db->init.busy) ** in case a bug arises. */ - _ = libc.Int32FromInt32(0) - initBusy = int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) + initBusy = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) (*(*TParse)(unsafe.Pointer(bp))).FnQueryLoop = int16(1) if SQLITE_OK == _sqlite3RunParser(tls, bp, zCreateTable) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if !((*TTable)(unsafe.Pointer(pTab)).FaCol != 0) { pNew = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable (*TTable)(unsafe.Pointer(pTab)).FaCol = (*TTable)(unsafe.Pointer(pNew)).FaCol @@ -136288,19 +130837,16 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i v2 = (*TTable)(unsafe.Pointer(pNew)).FnCol (*TTable)(unsafe.Pointer(pTab)).FnCol = v2 (*TTable)(unsafe.Pointer(pTab)).FnNVCol = v2 - *(*Tu32)(unsafe.Pointer(pTab + 28)) |= (*TTable)(unsafe.Pointer(pNew)).FtabFlags & uint32(libc.Int32FromInt32(TF_WithoutRowid)|libc.Int32FromInt32(TF_NoVisibleRowid)) + *(*Tu32)(unsafe.Pointer(pTab + 28)) |= (*TTable)(unsafe.Pointer(pNew)).FtabFlags & libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid)|libc.Int32FromInt32(TF_NoVisibleRowid)) (*TTable)(unsafe.Pointer(pNew)).FnCol = 0 (*TTable)(unsafe.Pointer(pNew)).FaCol = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if !((*TTable)(unsafe.Pointer(pNew)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer((*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(pCtx)).FpVTable)).FpMod)).FpModule)).FxUpdate != uintptr(0) && int32((*TIndex)(unsafe.Pointer(_sqlite3PrimaryKeyIndex(tls, pNew))).FnKeyCol) != int32(1) { + if !((*TTable)(unsafe.Pointer(pNew)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer((*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(pCtx)).FpVTable)).FpMod)).FpModule)).FxUpdate != uintptr(0) && libc.Int32FromUint16((*TIndex)(unsafe.Pointer(_sqlite3PrimaryKeyIndex(tls, pNew))).FnKeyCol) != int32(1) { /* WITHOUT ROWID virtual tables must either be read-only (xUpdate==0) ** or else must have a single-column PRIMARY KEY */ rc = int32(SQLITE_ERROR) } pIdx = (*TTable)(unsafe.Pointer(pNew)).FpIndex if pIdx != 0 { - _ = libc.Int32FromInt32(0) (*TTable)(unsafe.Pointer(pTab)).FpIndex = pIdx (*TTable)(unsafe.Pointer(pNew)).FpIndex = uintptr(0) (*TIndex)(unsafe.Pointer(pIdx)).FpTable = pTab @@ -136323,8 +130869,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i } _sqlite3DeleteTable(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FpNewTable) _sqlite3ParseObjectReset(tls, bp) - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(initBusy) - _ = libc.Int32FromInt32(0) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = libc.Uint8FromInt32(initBusy) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -136350,7 +130895,7 @@ func _sqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) _, _, _, _ = p, pTab, rc, xDestroy rc = SQLITE_OK pTab = _sqlite3FindTable(tls, db, zTab, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) - if pTab != uintptr(0) && int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) && (*(*struct { + if pTab != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) && (*(*struct { FnArg int32 FazArg uintptr Fp uintptr @@ -136364,7 +130909,6 @@ func _sqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) if !(p != 0) { break } - _ = libc.Int32FromInt32(0) if (*Tsqlite3_vtab)(unsafe.Pointer((*TVTable)(unsafe.Pointer(p)).FpVtab)).FnRef > 0 { return int32(SQLITE_LOCKED) } @@ -136378,12 +130922,10 @@ func _sqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) if xDestroy == uintptr(0) { xDestroy = (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer((*TVTable)(unsafe.Pointer(p)).FpMod)).FpModule)).FxDisconnect } - _ = libc.Int32FromInt32(0) (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, (*TVTable)(unsafe.Pointer(p)).FpVtab) /* Remove the sqlite3_vtab* from the aVTrans[] array, if applicable */ if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) (*TVTable)(unsafe.Pointer(p)).FpVtab = uintptr(0) (*(*struct { FnArg int32 @@ -136486,7 +131028,7 @@ func _sqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) (r int32) { // ** sqlite3.aVTrans array. Then clear the array itself. // */ func _sqlite3VtabRollback(tls *libc.TLS, db uintptr) (r int32) { - _callFinaliser(tls, db, int32(uint32(libc.UintptrFromInt32(0)+68))) + _callFinaliser(tls, db, libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+68))) return SQLITE_OK } @@ -136497,7 +131039,7 @@ func _sqlite3VtabRollback(tls *libc.TLS, db uintptr) (r int32) { // ** sqlite3.aVTrans array. Then clear the array itself. // */ func _sqlite3VtabCommit(tls *libc.TLS, db uintptr) (r int32) { - _callFinaliser(tls, db, int32(uint32(libc.UintptrFromInt32(0)+64))) + _callFinaliser(tls, db, libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+64))) return SQLITE_OK } @@ -136584,8 +131126,6 @@ func _sqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32 var savedFlags Tu64 _, _, _, _, _, _ = i, pMod, pVTab, rc, savedFlags, xMethod rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FaVTrans != 0 { i = 0 for { @@ -136653,20 +131193,17 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg if pExpr == uintptr(0) { return pDef } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return pDef } - _ = libc.Int32FromInt32(0) pTab = (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab if pTab == uintptr(0) { return pDef } - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { return pDef } pVtab = (*TVTable)(unsafe.Pointer(_sqlite3GetVTable(tls, db, pTab))).FpVtab - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pMod = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule if (*Tsqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction == uintptr(0) { return pDef @@ -136684,13 +131221,13 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(uint32(40)+uint32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint32(1))) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint32(40)+libc.Uint32FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint32(1))) if pNew == uintptr(0) { return pDef } *(*TFuncDef)(unsafe.Pointer(pNew)) = *(*TFuncDef)(unsafe.Pointer(pDef)) (*TFuncDef)(unsafe.Pointer(pNew)).FzName = pNew + 1*40 - libc.Xmemcpy(tls, pNew+1*40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uint32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName)+int32(1))) + libc.Xmemcpy(tls, pNew+1*40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, libc.Uint32FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName)+int32(1))) (*TFuncDef)(unsafe.Pointer(pNew)).FxSFunc = *(*uintptr)(unsafe.Pointer(bp)) (*TFuncDef)(unsafe.Pointer(pNew)).FpUserData = *(*uintptr)(unsafe.Pointer(bp + 4)) *(*Tu32)(unsafe.Pointer(pNew + 4)) |= uint32(SQLITE_FUNC_EPHEM) @@ -136715,7 +131252,6 @@ func _sqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { v1 = pParse } pToplevel = v1 - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TParse)(unsafe.Pointer(pToplevel)).FnVtabLock) { @@ -136729,8 +131265,8 @@ func _sqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - n = int32(uint32((*TParse)(unsafe.Pointer(pToplevel)).FnVtabLock+libc.Int32FromInt32(1)) * uint32(4)) - apVtabLock = _sqlite3Realloc(tls, (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock, uint64(n)) + n = libc.Int32FromUint32(libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnVtabLock+libc.Int32FromInt32(1)) * uint32(4)) + apVtabLock = _sqlite3Realloc(tls, (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock, libc.Uint64FromInt32(n)) if apVtabLock != 0 { (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock = apVtabLock v4 = pToplevel + 224 @@ -136788,7 +131324,6 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) (*TTable)(unsafe.Pointer(pTab)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pTab)).FeTabType = uint8(TABTYP_VTAB) (*TTable)(unsafe.Pointer(pTab)).FpSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema - _ = libc.Int32FromInt32(0) (*TTable)(unsafe.Pointer(pTab)).FiPKey = int16(-int32(1)) *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_Eponymous) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) @@ -136833,10 +131368,7 @@ func _sqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { // ** within an xUpdate method. // */ func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - return int32(_aMap[int32((*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict)-int32(1)]) + return libc.Int32FromUint8(_aMap[libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict)-int32(1)]) } var _aMap = [5]uint8{ @@ -136863,13 +131395,12 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(156723)) + rc = _sqlite3MisuseError(tls, int32(156732)) } else { - _ = libc.Int32FromInt32(0) ap = va switch op { case int32(SQLITE_VTAB_CONSTRAINT_SUPPORT): - (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbConstraint = uint8(libc.VaInt32(&ap)) + (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbConstraint = libc.Uint8FromInt32(libc.VaInt32(&ap)) case int32(SQLITE_VTAB_INNOCUOUS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = uint8(SQLITE_VTABRISK_Low) case int32(SQLITE_VTAB_DIRECTONLY): @@ -136877,7 +131408,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(156745)) + rc = _sqlite3MisuseError(tls, int32(156754)) break } _ = ap @@ -137620,7 +132151,6 @@ func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) { var i int32 _ = i - _ = libc.Int32FromInt32(0) if bAnd != 0 { Xsqlite3_str_append(tls, pStr, __ccgo_ts+22158, int32(5)) } @@ -137693,20 +132223,20 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { pIndex = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex nEq = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq nSkip = (*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip - if int32(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { + if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } Xsqlite3_str_append(tls, pStr, __ccgo_ts+22166, int32(2)) i = 0 for { - if !(i < int32(nEq)) { + if !(i < libc.Int32FromUint16(nEq)) { break } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { Xsqlite3_str_append(tls, pStr, __ccgo_ts+22158, int32(5)) } - if i >= int32(nSkip) { + if i >= libc.Int32FromUint16(nSkip) { v2 = __ccgo_ts + 22169 } else { v2 = __ccgo_ts + 22174 @@ -137719,11 +132249,11 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } j = i if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BTM_LIMIT) != 0 { - _explainAppendTerm(tls, pStr, pIndex, int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm), j, i, __ccgo_ts+22182) + _explainAppendTerm(tls, pStr, pIndex, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm), j, i, __ccgo_ts+22182) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { - _explainAppendTerm(tls, pStr, pIndex, int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop), j, i, __ccgo_ts+22184) + _explainAppendTerm(tls, pStr, pIndex, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop), j, i, __ccgo_ts+22184) } Xsqlite3_str_append(tls, pStr, __ccgo_ts+5170, int32(1)) } @@ -137755,16 +132285,16 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr } else { v1 = pParse } - if int32((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { pItem = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*68 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* VM being constructed */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop flags = (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags - if flags&uint32(WHERE_MULTI_OR) != 0 || int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { + if flags&uint32(WHERE_MULTI_OR) != 0 || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { return 0 } - isSearch = libc.BoolInt32(flags&uint32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) != uint32(0) || flags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) > 0 || int32(wctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_MIN)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)) != 0) + isSearch = libc.BoolInt32(flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) != uint32(0) || flags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) > 0 || libc.Int32FromUint16(wctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_MIN)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)) != 0) _sqlite3StrAccumInit(tls, bp, db, bp+24, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { @@ -137773,11 +132303,9 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v2 = __ccgo_ts + 22193 } Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22198, libc.VaList(bp+136, v2, pItem)) - if flags&uint32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { + if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) - _ = libc.Int32FromInt32(0) pIdx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - _ = libc.Int32FromInt32(0) if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { zFmt = __ccgo_ts + 11378 @@ -137806,7 +132334,7 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { zRowid = __ccgo_ts + 16781 Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22297, libc.VaList(bp+136, zRowid)) - if flags&uint32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { + if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = int8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { @@ -137816,7 +132344,6 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr if flags&uint32(WHERE_BTM_LIMIT) != 0 { cRangeOp = int8('>') } else { - _ = libc.Int32FromInt32(0) cRangeOp = int8('<') } } @@ -137842,7 +132369,7 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr } } } - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22370, 0) } zMsg = _sqlite3StrAccumFinish(tls, bp) @@ -137887,13 +132414,13 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22402, 0) } } else { - i = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) + i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) for { - if !(i < int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) { + if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) { break } z = _explainIndexColumnName(tls, (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex, i) - if i > int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { + if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { Xsqlite3_str_append(tls, bp, __ccgo_ts+22158, int32(5)) } Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22169, libc.VaList(bp+136, z)) @@ -137958,9 +132485,8 @@ func _disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { var p1, p2 uintptr _, _, _ = nLoop, p1, p2 nLoop = 0 - _ = libc.Int32FromInt32(0) - for int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_CODED) == 0 && ((*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 || (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && (*TWhereLevel)(unsafe.Pointer(pLevel)).FnotReady&(*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll == uint64(0) { - if nLoop != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKE) != 0 { + for libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_CODED) == 0 && ((*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 || (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && (*TWhereLevel)(unsafe.Pointer(pLevel)).FnotReady&(*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll == uint64(0) { + if nLoop != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKE) != 0 { p1 = pTerm + 10 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(TERM_LIKECOND)) } else { @@ -137971,9 +132497,8 @@ func _disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { break } pTerm = (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).Fa + uintptr((*TWhereTerm)(unsafe.Pointer(pTerm)).FiParent)*48 - _ = libc.Int32FromInt32(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FnChild-- - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FnChild) != 0 { + if libc.Int32FromUint8((*TWhereTerm)(unsafe.Pointer(pTerm)).FnChild) != 0 { break } nLoop++ @@ -137998,14 +132523,11 @@ func _codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff _ = v v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe if zAff == uintptr(0) { - _ = libc.Int32FromInt32(0) return } - _ = libc.Int32FromInt32(0) /* Adjust base and n to skip over SQLITE_AFF_BLOB and SQLITE_AFF_NONE ** entries at the beginning and end of the affinity string. */ - _ = libc.Int32FromInt32(0) for n > 0 && int32(*(*int8)(unsafe.Pointer(zAff))) <= int32(SQLITE_AFF_BLOB) { n-- base++ @@ -138089,7 +132611,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p _, _, _, _, _, _, _, _, _, _, _ = db, i, iField, p, pLhs, pNew, pOrderBy, pOrigLhs, pOrigRhs, pRhs, pSelect db = (*TParse)(unsafe.Pointer(pParse)).Fdb pNew = _sqlite3ExprDup(tls, db, pX, 0) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { pSelect = *(*uintptr)(unsafe.Pointer(pNew + 20)) for { if !(pSelect != 0) { @@ -138098,20 +132620,16 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p pOrigLhs = uintptr(0) /* Original unmodified LHS */ pRhs = uintptr(0) /* New RHS after modifications */ pLhs = uintptr(0) /* Loop counter */ - _ = libc.Int32FromInt32(0) pOrigRhs = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pSelect == *(*uintptr)(unsafe.Pointer(pNew + 20)) { pOrigLhs = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 20)) } i = iEq for { - if !(i < int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { + if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { break } if (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)))).FpExpr == pX { - _ = libc.Int32FromInt32(0) iField = (*(*struct { FleftColumn int32 FiField int32 @@ -138122,7 +132640,6 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr = uintptr(0) if pOrigLhs != 0 { - _ = libc.Int32FromInt32(0) pLhs = _sqlite3ExprListAppend(tls, pParse, pLhs, (*(*TExprList_item)(unsafe.Pointer(pOrigLhs + 8 + uintptr(iField)*20))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigLhs + 8 + uintptr(iField)*20))).FpExpr = uintptr(0) } @@ -138203,12 +132720,10 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, iReg, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Register holding results */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_EQ) || int32((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_IS) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_EQ) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_IS) { iReg = _sqlite3ExprCodeTarget(tls, pParse, (*TExpr)(unsafe.Pointer(pX)).FpRight, iTarget) } else { - if int32((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_ISNULL) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_ISNULL) { iReg = iTarget _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, iReg) } else { @@ -138219,7 +132734,6 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex != uintptr(0) && *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex)).FaSortOrder + uintptr(iEq))) != 0 { bRev = libc.BoolInt32(!(bRev != 0)) } - _ = libc.Int32FromInt32(0) iReg = iTarget i = 0 for { @@ -138237,10 +132751,9 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint } i = iEq for { - if !(i < int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { + if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { break } - _ = libc.Int32FromInt32(0) if (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)))).FpExpr == pX { nEq++ } @@ -138254,11 +132767,11 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*uint32(nEq))) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*libc.Uint32FromInt32(nEq))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) } @@ -138270,7 +132783,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*uint32(v3))) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*libc.Uint32FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -138284,7 +132797,6 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint v4 = int32(OP_Rewind) } _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(pLoop + 40)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -138309,7 +132821,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint })(unsafe.Pointer(pLevel + 64))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 64))).FaInLoop, uint64(uint32(20)*uint32((*(*struct { + })(unsafe.Pointer(pLevel + 64))).FaInLoop, uint64(uint32(20)*libc.Uint32FromInt32((*(*struct { FnIn int32 FaInLoop uintptr })(unsafe.Pointer(pLevel + 64))).FnIn))) @@ -138322,7 +132834,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint pIn += uintptr(i) * 20 i = iEq for { - if !(i < int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { + if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { break } if (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)))).FpExpr == pX { @@ -138348,7 +132860,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint } else { v8 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = uint8(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iReg - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -138365,7 +132877,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ; i++ } - if iEq > 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_IN_SEEKSCAN)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { + if iEq > 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IN_SEEKSCAN)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { _sqlite3VdbeAddOp3(tls, v, int32(OP_SeekHit), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, 0, iEq) } } else { @@ -138386,7 +132898,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -138447,21 +132959,18 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Affinity string to return */ /* This module is only called on query plans that use an index. */ pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - _ = libc.Int32FromInt32(0) nEq = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq nSkip = (*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip pIdx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - _ = libc.Int32FromInt32(0) /* Figure out how many memory cells we will need then allocate them. */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - nReg = int32(nEq) + nExtraReg + nReg = libc.Int32FromUint16(nEq) + nExtraReg *(*int32)(unsafe.Pointer(pParse + 44)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) - _ = libc.Int32FromInt32(0) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur - _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, regBase, regBase+int32(nSkip)-int32(1)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, regBase, regBase+libc.Int32FromUint16(nSkip)-int32(1)) if bRev != 0 { v1 = int32(OP_Last) } else { @@ -138469,17 +132978,16 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i } _sqlite3VdbeAddOp1(tls, v, v1, iIdxCur) j = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) - _ = libc.Int32FromInt32(0) if bRev != 0 { v2 = int32(OP_SeekLT) } else { v2 = int32(OP_SeekGT) } - (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip = _sqlite3VdbeAddOp4Int(tls, v, v2, iIdxCur, 0, regBase, int32(nSkip)) + (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip = _sqlite3VdbeAddOp4Int(tls, v, v2, iIdxCur, 0, regBase, libc.Int32FromUint16(nSkip)) _sqlite3VdbeJumpHere(tls, v, j) j = 0 for { - if !(j < int32(nSkip)) { + if !(j < libc.Int32FromUint16(nSkip)) { break } _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, j, regBase+j) @@ -138491,14 +132999,12 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i } /* Evaluate the equality constraints */ - _ = libc.Int32FromInt32(0) - j = int32(nSkip) + j = libc.Int32FromUint16(nSkip) for { - if !(j < int32(nEq)) { + if !(j < libc.Int32FromUint16(nEq)) { break } pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4)) - _ = libc.Int32FromInt32(0) /* The following testcase is true for indices with redundant columns. ** Ex: CREATE INDEX i1 ON t1(a,b,a); SELECT * FROM t1 WHERE a=0 AND b=0; */ r1 = _codeEqualityTerm(tls, pParse, pTerm, pLevel, j, bRev, regBase+j) @@ -138510,7 +133016,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i _sqlite3VdbeAddOp2(tls, v, int32(OP_Copy), r1, regBase+j) } } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_IN) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_IN) != 0 { if (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(EP_xIsSelect) != 0 { /* No affinity ever needs to be (or should be) applied to a value ** from the RHS of an "? IN (SELECT ...)" expression. The @@ -138521,13 +133027,12 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i } } } else { - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_ISNULL) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_ISNULL) == 0 { pRight = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_IS) == 0 && _sqlite3ExprCanBeNull(tls, pRight) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_IS) == 0 && _sqlite3ExprCanBeNull(tls, pRight) != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), regBase+j, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk) } if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - _ = libc.Int32FromInt32(0) if int32(_sqlite3CompareAffinity(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j))))) == int32(SQLITE_AFF_BLOB) { *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } @@ -138581,11 +133086,9 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, _, _, _, _, _, _, _, _, _ = ai, i, pParse, pTab, v, x1, x2, v1, v2 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse /* Parse context */ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Vdbe to generate code within */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) libc.SetBitFieldPtr8Uint32(pWInfo+48, libc.Uint32FromInt32(1), 0, 0x1) _sqlite3VdbeAddOp3(tls, v, int32(OP_DeferredSeek), iIdxCur, 0, iCur) - if v2 = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_OR_SUBCLAUSE)|libc.Int32FromInt32(WHERE_RIGHT_JOIN)) != 0; v2 { + if v2 = libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_OR_SUBCLAUSE)|libc.Int32FromInt32(WHERE_RIGHT_JOIN)) != 0; v2 { if (*TParse)(unsafe.Pointer(pParse)).FpToplevel != 0 { v1 = (*TParse)(unsafe.Pointer(pParse)).FpToplevel } else { @@ -138594,19 +133097,18 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*uint32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*libc.Uint32FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { - *(*Tu32)(unsafe.Pointer(ai)) = uint32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)-int32(1)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)-int32(1)) { break } - _ = libc.Int32FromInt32(0) x1 = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) x2 = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(x1))) if x1 >= 0 { - *(*Tu32)(unsafe.Pointer(ai + uintptr(x2+int32(1))*4)) = uint32(i + int32(1)) + *(*Tu32)(unsafe.Pointer(ai + uintptr(x2+int32(1))*4)) = libc.Uint32FromInt32(i + int32(1)) } goto _3 _3: @@ -138633,17 +133135,13 @@ func _codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nRe var i, iSelect int32 var pList, v uintptr _, _, _, _ = i, iSelect, pList, v - _ = libc.Int32FromInt32(0) if p != 0 && _sqlite3ExprIsVector(tls, p) != 0 { if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_xIsSelect) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) iSelect = _sqlite3CodeSubselect(tls, pParse, p) _sqlite3VdbeAddOp3(tls, v, int32(OP_Copy), iSelect, iReg, nReg-int32(1)) } else { - _ = libc.Int32FromInt32(0) pList = *(*uintptr)(unsafe.Pointer(p + 20)) - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < nReg) { @@ -138657,7 +133155,6 @@ func _codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nRe } } } else { - _ = libc.Int32FromInt32(0) _sqlite3ExprCode(tls, pParse, p, iReg) } } @@ -138675,7 +133172,7 @@ func _whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur i var i int32 var pExpr, pTerm, p2 uintptr _, _, _, _ = i, pExpr, pTerm, p2 - for int32((*TExpr)(unsafe.Pointer(pTruth)).Fop) == int32(TK_AND) { + for libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pTruth)).Fop) == int32(TK_AND) { _whereApplyPartialIndexConstraints(tls, (*TExpr)(unsafe.Pointer(pTruth)).FpLeft, iTabCur, pWC) pTruth = (*TExpr)(unsafe.Pointer(pTruth)).FpRight } @@ -138685,7 +133182,7 @@ func _whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur i if !(i < (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm) { break } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_CODED) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_CODED) != 0 { goto _1 } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr @@ -138729,7 +133226,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 for { iLevel++ v1 = iLevel - if !(v1 < int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { + if !(v1 < libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { break } pLevel = pWInfo + 752 + uintptr(iLevel)*84 @@ -138745,24 +133242,19 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLoop)(unsafe.Pointer(pLoop)).Fprereq¬Ready != 0 { continue } - _ = libc.Int32FromInt32(0) (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk = addrNxt if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) regRowid = _sqlite3GetTempReg(tls, pParse) regRowid = _codeEqualityTerm(tls, pParse, pTerm, pLevel, 0, 0, regRowid) _sqlite3VdbeAddOp2(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_MustBeInt), regRowid, addrNxt) _sqlite3VdbeAddOp4Int(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, regRowid, int32(1)) } else { nEq = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) r1 = _codeAllEqualityTerms(tls, pParse, pLevel, 0, 0, bp) - _codeApplyAffinity(tls, pParse, r1, int32(nEq), *(*uintptr)(unsafe.Pointer(bp))) + _codeApplyAffinity(tls, pParse, r1, libc.Int32FromUint16(nEq), *(*uintptr)(unsafe.Pointer(bp))) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(bp))) - _sqlite3VdbeAddOp4Int(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, r1, int32(nEq)) + _sqlite3VdbeAddOp4Int(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, r1, libc.Int32FromUint16(nEq)) } (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter = 0 (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk = 0 @@ -138779,13 +133271,13 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 func _whereLoopIsOneRow(tls *libc.TLS, pLoop uintptr) (r int32) { var ii int32 _ = ii - if (*TIndex)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex)).FonError != 0 && int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) == 0 && int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) == int32((*TIndex)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex)).FnKeyCol) { + if (*TIndex)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex)).FonError != 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) == 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) == libc.Int32FromUint16((*TIndex)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex)).FnKeyCol) { ii = 0 for { - if !(ii < int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) { + if !(ii < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) { break } - if int32((*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(ii)*4)))).FeOperator)&(libc.Int32FromInt32(WO_IS)|libc.Int32FromInt32(WO_ISNULL)) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(ii)*4)))).FeOperator)&(libc.Int32FromInt32(WO_IS)|libc.Int32FromInt32(WO_ISNULL)) != 0 { return 0 } goto _1 @@ -138828,7 +133320,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*68 iCur = (*TSrcItem)(unsafe.Pointer(pTabItem)).FiCursor (*TWhereLevel)(unsafe.Pointer(pLevel)).FnotReady = notReady & ^_sqlite3WhereGetMask(tls, pWInfo+488, iCur) - bRev = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FrevMask >> iLevel & uint64(1)) + bRev = libc.Int32FromUint64((*TWhereInfo)(unsafe.Pointer(pWInfo)).FrevMask >> iLevel & uint64(1)) /* Create labels for the "break" and "continue" instructions ** for the current loop. Jump to addrBrk to break out of a loop. ** Jump to cont to go immediately to the next iteration of the @@ -138851,8 +133343,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** initialize a memory cell that records if this table matches any ** row of the left table of the join. */ - _ = libc.Int32FromInt32(0) - if int32((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && int32((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { + if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { v5 = pParse + 44 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) @@ -138886,7 +133377,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = uint8(OP_Goto) } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - nConstraint = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) + nConstraint = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) iReg = _sqlite3GetTempRange(tls, pParse, nConstraint+int32(2)) addrNotFound = (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk j = 0 @@ -138899,7 +133390,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pTerm == uintptr(0) { goto _7 } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_IN) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_IN) != 0 { if j <= int32(31) { v8 = libc.Uint32FromInt32(1) << j } else { @@ -138930,10 +133421,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { pRight = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight _codeExprOrVector(tls, pParse, pRight, iTarget, int32(1)) - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) == int32(SQLITE_INDEX_CONSTRAINT_OFFSET) && int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x2>>1)) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) == int32(SQLITE_INDEX_CONSTRAINT_OFFSET) && int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x2>>1)) != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FiOffset) } } @@ -138983,16 +133471,15 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { v14 = int32(OP_VNext) } - (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = uint8(v14) + (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = libc.Uint8FromInt32(v14) (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = _sqlite3VdbeCurrentAddr(tls, v) - _ = libc.Int32FromInt32(0) j = 0 for { if !(j < nConstraint) { break } pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4)) - if j < int32(16) && int32((*(*struct { + if j < int32(16) && libc.Int32FromUint16((*(*struct { FidxNum int32 F__ccgo4 uint8 FisOrdered Ti8 @@ -139003,7 +133490,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI _disableTerm(tls, pLevel, pTerm) goto _15 } - if v17 = int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_IN) != 0; v17 { + if v17 = libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_IN) != 0; v17 { if j <= int32(31) { v16 = libc.Uint32FromInt32(1) << j } else { @@ -139035,8 +133522,8 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FnIn int32 FaInLoop uintptr })(unsafe.Pointer(pLevel + 64))).FaInLoop + uintptr(iIn)*20))).FaddrInTop) - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 == iReg+j+int32(2) || int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Rowid) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 == iReg+j+int32(2) { - _sqlite3VdbeAddOp3(tls, v, int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1, (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2, (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3) + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 == iReg+j+int32(2) || libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Rowid) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 == iReg+j+int32(2) { + _sqlite3VdbeAddOp3(tls, v, libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1, (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2, (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3) break } goto _18 @@ -139054,11 +133541,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FiField int32 })(unsafe.Pointer(pTerm + 24))).FiField pLeft = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft - _ = libc.Int32FromInt32(0) if iFld > 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pCompare)).FpLeft = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 20)) + 8 + uintptr(iFld-int32(1))*20))).FpExpr } else { (*TExpr)(unsafe.Pointer(pCompare)).FpLeft = pLeft @@ -139087,16 +133570,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); */ } else { - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_COLUMN_IN)|libc.Int32FromInt32(WHERE_COLUMN_EQ)) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_IN)|libc.Int32FromInt32(WHERE_COLUMN_EQ)) != uint32(0) { /* Case 2: We can directly reference a single row using an ** equality comparison against the ROWID field. Or ** we reference multiple rows using a "rowid IN (...)" ** construct. */ - _ = libc.Int32FromInt32(0) pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v21 = pParse + 44 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) @@ -139133,7 +133613,6 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI j++ pEnd = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(v24)*4)) } - _ = libc.Int32FromInt32(0) if bRev != 0 { pTerm = pStart pStart = pEnd @@ -139149,27 +133628,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI 2: uint8(OP_SeekLT), 3: uint8(OP_SeekGE), } - _ = libc.Int32FromInt32(0) /* Make sure the ordering.. */ - _ = libc.Int32FromInt32(0) /* ... of the TK_xx values... */ - _ = libc.Int32FromInt32(0) /* ... is correct. */ - _ = libc.Int32FromInt32(0) + /* Make sure the ordering.. */ + /* ... of the TK_xx values... */ + /* ... is correct. */ pX = (*TWhereTerm)(unsafe.Pointer(pStart)).FpExpr - _ = libc.Int32FromInt32(0) /* transitive constraints */ if _sqlite3ExprIsVector(tls, (*TExpr)(unsafe.Pointer(pX)).FpRight) != 0 { v25 = _sqlite3GetTempReg(tls, pParse) *(*int32)(unsafe.Pointer(bp)) = v25 r11 = v25 _codeExprOrVector(tls, pParse, (*TExpr)(unsafe.Pointer(pX)).FpRight, r11, int32(1)) - op = int32(aMoveOp[(int32((*TExpr)(unsafe.Pointer(pX)).Fop)-int32(TK_GT)-int32(1))&int32(0x3)|int32(0x1)]) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + op = libc.Int32FromUint8(aMoveOp[(libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop)-int32(TK_GT)-int32(1))&int32(0x3)|int32(0x1)]) } else { r11 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pX)).FpRight, bp) _disableTerm(tls, pLevel, pStart) - op = int32(aMoveOp[int32((*TExpr)(unsafe.Pointer(pX)).Fop)-int32(TK_GT)]) + op = libc.Int32FromUint8(aMoveOp[libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop)-int32(TK_GT)]) } _sqlite3VdbeAddOp3(tls, v, op, iCur, addrBrk, r11) _sqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp))) @@ -139183,15 +133656,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Transitive constraints */ v28 = pParse + 44 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 _codeExprOrVector(tls, pParse, (*TExpr)(unsafe.Pointer(pX1)).FpRight, memEndValue, int32(1)) - if 0 == _sqlite3ExprIsVector(tls, (*TExpr)(unsafe.Pointer(pX1)).FpRight) && (int32((*TExpr)(unsafe.Pointer(pX1)).Fop) == int32(TK_LT) || int32((*TExpr)(unsafe.Pointer(pX1)).Fop) == int32(TK_GT)) { + if 0 == _sqlite3ExprIsVector(tls, (*TExpr)(unsafe.Pointer(pX1)).FpRight) && (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX1)).Fop) == int32(TK_LT) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX1)).Fop) == int32(TK_GT)) { if bRev != 0 { v29 = int32(OP_Le) } else { @@ -139216,10 +133687,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { v31 = int32(OP_Next) } - (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = uint8(v31) + (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = libc.Uint8FromInt32(v31) (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start - _ = libc.Int32FromInt32(0) if testOp != int32(OP_Noop) { v33 = pParse + 44 *(*int32)(unsafe.Pointer(v33))++ @@ -139227,7 +133697,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI iRowidReg = v32 _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, iRowidReg) _sqlite3VdbeAddOp3(tls, v, testOp, memEndValue, addrBrk, iRowidReg) - _sqlite3VdbeChangeP5(tls, v, uint16(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_INDEXED) != 0 { @@ -139244,32 +133714,30 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI addrSeekScan = 0 /* Opcode of the OP_SeekScan, if any */ pIdx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur - _ = libc.Int32FromInt32(0) /* Find any inequality constraint terms for the start and end ** of the range. */ - j = int32(nEq) + j = libc.Int32FromUint16(nEq) if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BTM_LIMIT) != 0 { v34 = j j++ pRangeStart = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(v34)*4)) - if nExtraReg > int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm) { + if nExtraReg > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm) { v35 = nExtraReg } else { - v35 = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm) + v35 = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm) } nExtraReg = v35 /* Like optimization range constraints always occur in pairs */ - _ = libc.Int32FromInt32(0) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { v36 = j j++ pRangeEnd = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(v36)*4)) - if nExtraReg > int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop) { + if nExtraReg > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop) { v37 = nExtraReg } else { - v37 = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop) + v37 = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop) } nExtraReg = v37 if pRangeStart == uintptr(0) { @@ -139279,7 +133747,6 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } } } - _ = libc.Int32FromInt32(0) /* If the WHERE_BIGNULL_SORT flag is set, then index column nEq uses ** a non-default "big-null" sort (either ASC NULLS LAST or DESC NULLS ** FIRST). In both cases separate ordered scans are made of those @@ -139287,9 +133754,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** it is not. For an ASC sort, the non-NULL entries are scanned first. ** For DESC, NULL entries are scanned first. */ - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) v40 = pParse + 44 @@ -139307,7 +133772,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** a forward order scan on a descending index, interchange the ** start and end terms (pRangeStart and pRangeEnd). */ - if int32(nEq) < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) && bRev == libc.BoolInt32(int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) == SQLITE_SO_ASC) { + if libc.Int32FromUint16(nEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) && bRev == libc.BoolInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) == SQLITE_SO_ASC) { t = pRangeEnd pRangeEnd = pRangeStart pRangeStart = t @@ -139328,7 +133793,6 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** starting at regBase. */ regBase = _codeAllEqualityTerms(tls, pParse, pLevel, bRev, nExtraReg, bp+4) - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 && nTop != 0 { zEndAff = _sqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 4))+uintptr(nEq)) } @@ -139338,21 +133802,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI v41 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt } addrNxt = v41 - startEq = libc.BoolInt32(!(pRangeStart != 0) || int32((*TWhereTerm)(unsafe.Pointer(pRangeStart)).FeOperator)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0) - endEq = libc.BoolInt32(!(pRangeEnd != 0) || int32((*TWhereTerm)(unsafe.Pointer(pRangeEnd)).FeOperator)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0) - start_constraints = libc.BoolInt32(pRangeStart != 0 || int32(nEq) > 0) + startEq = libc.BoolInt32(!(pRangeStart != 0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pRangeStart)).FeOperator)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0) + endEq = libc.BoolInt32(!(pRangeEnd != 0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pRangeEnd)).FeOperator)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0) + start_constraints = libc.BoolInt32(pRangeStart != 0 || libc.Int32FromUint16(nEq) > 0) /* Seek the index cursor to the start of the range. */ - nConstraint1 = int32(nEq) + nConstraint1 = libc.Int32FromUint16(nEq) if pRangeStart != 0 { pRight2 = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pRangeStart)).FpExpr)).FpRight - _codeExprOrVector(tls, pParse, pRight2, regBase+int32(nEq), int32(nBtm)) - if int32((*TWhereTerm)(unsafe.Pointer(pRangeStart)).FwtFlags)&int32(TERM_VNULL) == 0 && _sqlite3ExprCanBeNull(tls, pRight2) != 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), regBase+int32(nEq), addrNxt) + _codeExprOrVector(tls, pParse, pRight2, regBase+libc.Int32FromUint16(nEq), libc.Int32FromUint16(nBtm)) + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pRangeStart)).FwtFlags)&int32(TERM_VNULL) == 0 && _sqlite3ExprCanBeNull(tls, pRight2) != 0 { + _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), regBase+libc.Int32FromUint16(nEq), addrNxt) } if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { - _updateRangeAffinityStr(tls, pRight2, int32(nBtm), *(*uintptr)(unsafe.Pointer(bp + 4))+uintptr(nEq)) + _updateRangeAffinityStr(tls, pRight2, libc.Int32FromUint16(nBtm), *(*uintptr)(unsafe.Pointer(bp + 4))+uintptr(nEq)) } - nConstraint1 += int32(nBtm) + nConstraint1 += libc.Int32FromUint16(nBtm) if _sqlite3ExprIsVector(tls, pRight2) == 0 { _disableTerm(tls, pLevel, pRangeStart) } else { @@ -139362,19 +133826,19 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if bSeekPastNull != 0 { startEq = 0 - _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+int32(nEq)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+libc.Int32FromUint16(nEq)) start_constraints = int32(1) nConstraint1++ } else { if regBignull != 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+int32(nEq)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+libc.Int32FromUint16(nEq)) start_constraints = int32(1) nConstraint1++ } } } - _codeApplyAffinity(tls, pParse, regBase, nConstraint1-int32(bSeekPastNull), *(*uintptr)(unsafe.Pointer(bp + 4))) - if int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) > 0 && nConstraint1 == int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { + _codeApplyAffinity(tls, pParse, regBase, nConstraint1-libc.Int32FromUint8(bSeekPastNull), *(*uintptr)(unsafe.Pointer(bp + 4))) + if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) > 0 && nConstraint1 == libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { /* The skip-scan logic inside the call to codeAllEqualityConstraints() ** above has already left the cursor sitting on the correct row, ** so no further seeking is needed */ @@ -139383,13 +133847,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), regBignull) } if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter != 0 { - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, regBase, int32(nEq)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, regBase, libc.Int32FromUint16(nEq)) _filterPullDown(tls, pParse, pWInfo, iLevel, addrNxt, notReady) } - op1 = int32(_aStartOp[start_constraints<<int32(2)+startEq<<int32(1)+bRev]) - _ = libc.Int32FromInt32(0) + op1 = libc.Int32FromUint8(_aStartOp[start_constraints<<int32(2)+startEq<<int32(1)+bRev]) if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IN_SEEKSCAN) != uint32(0) && op1 == int32(OP_SeekGE) { - _ = libc.Int32FromInt32(0) /* TUNING: The OP_SeekScan opcode seeks to reduce the number ** of expensive seek operations by replacing a single seek with ** 1 or more step operations. The question is, how many steps @@ -139406,36 +133868,28 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } } _sqlite3VdbeAddOp4Int(tls, v, op1, iIdxCur, addrNxt, regBase, nConstraint1) - _ = libc.Int32FromInt32(0) if regBignull != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, _sqlite3VdbeCurrentAddr(tls, v)+int32(2)) - op1 = int32(_aStartOp[libc.BoolInt32(nConstraint1 > int32(1))*int32(4)+int32(2)+bRev]) + op1 = libc.Int32FromUint8(_aStartOp[libc.BoolInt32(nConstraint1 > int32(1))*int32(4)+int32(2)+bRev]) _sqlite3VdbeAddOp4Int(tls, v, op1, iIdxCur, addrNxt, regBase, nConstraint1-startEq) - _ = libc.Int32FromInt32(0) } } /* Load the value for the inequality constraint at the end of the ** range (if any). */ - nConstraint1 = int32(nEq) - _ = libc.Int32FromInt32(0) + nConstraint1 = libc.Int32FromUint16(nEq) if pRangeEnd != 0 { pRight3 = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pRangeEnd)).FpExpr)).FpRight - _ = libc.Int32FromInt32(0) - _codeExprOrVector(tls, pParse, pRight3, regBase+int32(nEq), int32(nTop)) - if int32((*TWhereTerm)(unsafe.Pointer(pRangeEnd)).FwtFlags)&int32(TERM_VNULL) == 0 && _sqlite3ExprCanBeNull(tls, pRight3) != 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), regBase+int32(nEq), addrNxt) + _codeExprOrVector(tls, pParse, pRight3, regBase+libc.Int32FromUint16(nEq), libc.Int32FromUint16(nTop)) + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pRangeEnd)).FwtFlags)&int32(TERM_VNULL) == 0 && _sqlite3ExprCanBeNull(tls, pRight3) != 0 { + _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), regBase+libc.Int32FromUint16(nEq), addrNxt) } if zEndAff != 0 { - _updateRangeAffinityStr(tls, pRight3, int32(nTop), zEndAff) - _codeApplyAffinity(tls, pParse, regBase+int32(nEq), int32(nTop), zEndAff) + _updateRangeAffinityStr(tls, pRight3, libc.Int32FromUint16(nTop), zEndAff) + _codeApplyAffinity(tls, pParse, regBase+libc.Int32FromUint16(nEq), libc.Int32FromUint16(nTop), zEndAff) } else { - _ = libc.Int32FromInt32(0) } - nConstraint1 += int32(nTop) + nConstraint1 += libc.Int32FromUint16(nTop) if _sqlite3ExprIsVector(tls, pRight3) == 0 { _disableTerm(tls, pLevel, pRangeEnd) } else { @@ -139444,7 +133898,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if bStopAtNull != 0 { if regBignull == 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+int32(nEq)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+libc.Int32FromUint16(nEq)) endEq = 0 } nConstraint1++ @@ -139464,7 +133918,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI /* Except, skip the end-of-range check while doing the NULL-scan */ _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), regBignull, _sqlite3VdbeCurrentAddr(tls, v)+int32(3)) } - op1 = int32(_aEndOp[bRev*int32(2)+endEq]) + op1 = libc.Int32FromUint8(_aEndOp[bRev*int32(2)+endEq]) _sqlite3VdbeAddOp4Int(tls, v, op1, iIdxCur, addrNxt, regBase, nConstraint1) if addrSeekScan != 0 { _sqlite3VdbeJumpHere(tls, v, addrSeekScan) @@ -139473,18 +133927,15 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if regBignull != 0 { /* During a NULL-scan, check to see if we have reached the end of ** the NULLs */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_If), regBignull, _sqlite3VdbeCurrentAddr(tls, v)+int32(2)) - op1 = int32(_aEndOp[bRev*int32(2)+int32(bSeekPastNull)]) - _sqlite3VdbeAddOp4Int(tls, v, op1, iIdxCur, addrNxt, regBase, nConstraint1+int32(bSeekPastNull)) + op1 = libc.Int32FromUint8(_aEndOp[bRev*int32(2)+libc.Int32FromUint8(bSeekPastNull)]) + _sqlite3VdbeAddOp4Int(tls, v, op1, iIdxCur, addrNxt, regBase, nConstraint1+libc.Int32FromUint8(bSeekPastNull)) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IN_EARLYOUT) != uint32(0) { - _sqlite3VdbeAddOp3(tls, v, int32(OP_SeekHit), iIdxCur, int32(nEq), int32(nEq)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_SeekHit), iIdxCur, libc.Int32FromUint16(nEq), libc.Int32FromUint16(nEq)) } /* Seek the table cursor, if required */ - omitTable = libc.BoolInt32((*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IDX_ONLY) != uint32(0) && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_OR_SUBCLAUSE)|libc.Int32FromInt32(WHERE_RIGHT_JOIN)) == 0) + omitTable = libc.BoolInt32((*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IDX_ONLY) != uint32(0) && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_OR_SUBCLAUSE)|libc.Int32FromInt32(WHERE_RIGHT_JOIN)) == 0) if omitTable != 0 { /* pIdx is a covering index. No need to access the main table. */ } else { @@ -139493,10 +133944,10 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if iCur != iIdxCur { pPk = _sqlite3PrimaryKeyIndex(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpTable) - iRowidReg = _sqlite3GetTempRange(tls, pParse, int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) + iRowidReg = _sqlite3GetTempRange(tls, pParse, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) j = 0 for { - if !(j < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { + if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) @@ -139506,7 +133957,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ; j++ } - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NotFound), iCur, addrCont, iRowidReg, int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NotFound), iCur, addrCont, iRowidReg, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) } } } @@ -139525,7 +133976,6 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI /* The following assert() is not a requirement, merely an observation: ** The OR-optimization doesn't work for the right hand table of ** a LEFT JOIN: */ - _ = libc.Int32FromInt32(0) } /* Record the instruction used to terminate the loop. */ if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_ONEROW) != 0 || (*(*struct { @@ -139546,11 +133996,10 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { v43 = 0 } - (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp3 = uint8(v43) + (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp3 = libc.Uint8FromInt32(v43) if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_CONSTRAINT) == uint32(0) { (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp5 = uint8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } else { - _ = libc.Int32FromInt32(0) } if omitTable != 0 { pIdx = uintptr(0) @@ -139573,9 +134022,6 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pAndExpr = uintptr(0) /* An ".. AND (...)" expression */ pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pOrWc = *(*uintptr)(unsafe.Pointer(&(*TWhereTerm)(unsafe.Pointer(pTerm)).Fu)) (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = uint8(OP_Return) (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = regReturn @@ -139583,14 +134029,14 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** by this loop in the a[0] slot and all notReady tables in a[1..] slots. ** This becomes the SrcList in the recursive call to sqlite3WhereBegin(). */ - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ - nNotReady = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(76)+uint32(nNotReady)*uint32(68))) + if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ + nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(76)+libc.Uint32FromInt32(nNotReady)*uint32(68))) if pOrTab == uintptr(0) { return notReady } - (*TSrcList)(unsafe.Pointer(pOrTab)).FnAlloc = uint32(uint8(nNotReady + libc.Int32FromInt32(1))) - (*TSrcList)(unsafe.Pointer(pOrTab)).FnSrc = int32((*TSrcList)(unsafe.Pointer(pOrTab)).FnAlloc) + (*TSrcList)(unsafe.Pointer(pOrTab)).FnAlloc = uint32(libc.Uint8FromInt32(nNotReady + libc.Int32FromInt32(1))) + (*TSrcList)(unsafe.Pointer(pOrTab)).FnSrc = libc.Int32FromUint32((*TSrcList)(unsafe.Pointer(pOrTab)).FnAlloc) libc.Xmemcpy(tls, pOrTab+8, pTabItem, uint32(68)) origSrc = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 k = int32(1) @@ -139619,7 +134065,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** fall through to the next instruction, just as an OP_Next does if ** called on an uninitialized cursor. */ - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { v50 = pParse + 44 *(*int32)(unsafe.Pointer(v50))++ @@ -139632,7 +134078,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 - _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } v54 = pParse + 44 @@ -139679,13 +134125,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*48 == pTerm { goto _55 } - if int32((*(*TWhereTerm)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*48))).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_CODED)|libc.Int32FromInt32(TERM_SLICE)) != 0 { + if libc.Int32FromUint16((*(*TWhereTerm)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*48))).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_CODED)|libc.Int32FromInt32(TERM_SLICE)) != 0 { goto _55 } - if int32((*(*TWhereTerm)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*48))).FeOperator)&int32(WO_ALL) == 0 { + if libc.Int32FromUint16((*(*TWhereTerm)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*48))).FeOperator)&int32(WO_ALL) == 0 { goto _55 } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { goto _55 } /* tag-20220303a */ pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) @@ -139715,7 +134161,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI break } pOrTerm = (*TWhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr(ii)*48 - if (*TWhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur || int32((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&int32(WO_AND) != 0 { /* Info for single OR-term scan */ + if (*TWhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&int32(WO_AND) != 0 { /* Info for single OR-term scan */ pOrExpr = (*TWhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr /* Local copy of OR clause term */ jmp1 = 0 /* Address of jump operation */ /* See TH3 vtab25.400 and ticket 614b25314c766238 */ @@ -139733,7 +134179,6 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI /* Loop through table entries that match term pOrTerm. */ _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22425, libc.VaList(bp+72, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) - _ = libc.Int32FromInt32(0) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+752, uint16(0)) _ = addrExplain @@ -139742,7 +134187,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** rowid (or PRIMARY KEY) for the current row so that the same ** row will be skipped in subsequent sub-WHERE clauses. */ - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if ii == (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm-int32(1) { v58 = -int32(1) } else { @@ -139754,7 +134199,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI jmp1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_RowSetTest), regRowset, 0, regRowid, iSet) } else { pPk2 = _sqlite3PrimaryKeyIndex(tls, pTab) - nPk = int32((*TIndex)(unsafe.Pointer(pPk2)).FnKeyCol) + nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk2)).FnKeyCol) /* Read the PK into an array of temp registers. */ r = _sqlite3GetTempRange(tls, pParse, nPk) iPk = 0 @@ -139822,9 +134267,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** be available. */ pSubLoop = (*(*TWhereLevel)(unsafe.Pointer(pSubWInfo + 752))).FpWLoop - _ = libc.Int32FromInt32(0) if (*TWhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags&uint32(WHERE_INDEXED) != uint32(0) && (ii == 0 || (*TWhereLoop)(unsafe.Pointer(pSubLoop)).Fu.Fbtree.FpIndex == pCov) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pSubLoop)).Fu.Fbtree.FpIndex + 56))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY))) { - _ = libc.Int32FromInt32(0) pCov = (*TWhereLoop)(unsafe.Pointer(pSubLoop)).Fu.Fbtree.FpIndex } else { pCov = uintptr(0) @@ -139844,9 +134287,6 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ii++ } _sqlite3VdbeExplainPop(tls, pParse) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(&(*TWhereLevel)(unsafe.Pointer(pLevel)).Fu)) = pCov if pCov != 0 { (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = iCovCur @@ -139863,16 +134303,14 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** loop. The byte-code formatter will use that P2 value as a hint to ** indent everything in between the this point and the final OP_Return. ** See tag-20220407a in vdbe.c and shell.c */ - _ = libc.Int32FromInt32(0) (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = _sqlite3VdbeCurrentAddr(tls, v) - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { + if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { _sqlite3DbFreeNN(tls, db, pOrTab) } if !(untestedTerms != 0) { _disableTerm(tls, pLevel, pTerm) } } else { - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pTabItem + 36 + 4))&0x40>>6)) != 0 { /* Tables marked isRecursive have only a single row that is stored in ** a pseudo-cursor. No need to Rewind or Next such cursors. */ @@ -139880,7 +134318,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = _aStep[bRev] (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur - (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = int32(1) + _sqlite3VdbeAddOp2(tls, v, int32(_aStart[bRev]), iCur, addrHalt) + (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = int32(1) + _sqlite3VdbeAddOp2(tls, v, libc.Int32FromUint8(_aStart[bRev]), iCur, addrHalt) (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp5 = uint8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } } @@ -139924,7 +134362,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI break } skipLikeAddr = 0 - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_CODED)) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_CODED)) != 0 { goto _61 } if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*TWhereLevel)(unsafe.Pointer(pLevel)).FnotReady != uint64(0) { @@ -139932,14 +134370,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI goto _61 } pE = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - _ = libc.Int32FromInt32(0) - if int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { - if !((*TExpr)(unsafe.Pointer(pE)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != libc.Uint32FromInt32(0)) { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { + if !((*TExpr)(unsafe.Pointer(pE)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != libc.Uint32FromInt32(0)) { /* Defer processing WHERE clause constraints until after outer ** join processing. tag-20220513a */ goto _61 } else { - if int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_LEFT) == int32(JT_LEFT) && !((*TExpr)(unsafe.Pointer(pE)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_LEFT) == int32(JT_LEFT) && !((*TExpr)(unsafe.Pointer(pE)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) { goto _61 } else { m = _sqlite3WhereGetMask(tls, pWInfo+488, *(*int32)(unsafe.Pointer(pE + 36))) @@ -139954,13 +134391,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI iNext = int32(2) goto _61 } - if iLoop < int32(3) && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VARSELECT) != 0 { + if iLoop < int32(3) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VARSELECT) != 0 { if iNext == 0 { iNext = int32(3) } goto _61 } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKECOND) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKECOND) != 0 { /* If the TERM_LIKECOND flag is set, that means that the range search ** is sufficient to guarantee that the LIKE operator is true, so we ** can skip the call to the like(A,B) function. But this only works @@ -139996,36 +134433,33 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j > 0) { break } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_CODED)) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_CODED)) != 0 { goto _63 } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) == 0 { goto _63 } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { goto _63 } if (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != iCur { goto _63 } - if int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { goto _63 } pE1 = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pAlt = _sqlite3WhereFindTerm(tls, pWC, iCur, (*(*struct { FleftColumn int32 FiField int32 - })(unsafe.Pointer(pTerm + 24))).FleftColumn, notReady, uint32(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IN)|libc.Int32FromInt32(WO_IS)), uintptr(0)) + })(unsafe.Pointer(pTerm + 24))).FleftColumn, notReady, libc.Uint32FromInt32(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IN)|libc.Int32FromInt32(WO_IS)), uintptr(0)) if pAlt == uintptr(0) { goto _63 } - if int32((*TWhereTerm)(unsafe.Pointer(pAlt)).FwtFlags)&int32(TERM_CODED) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pAlt)).FwtFlags)&int32(TERM_CODED) != 0 { goto _63 } - if int32((*TWhereTerm)(unsafe.Pointer(pAlt)).FeOperator)&int32(WO_IN) != 0 && (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) && (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pAlt)).FpExpr + 20)))).FpEList)).FnExpr > int32(1) { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pAlt)).FeOperator)&int32(WO_IN) != 0 && (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) && (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pAlt)).FpExpr + 20)))).FpEList)).FnExpr > int32(1) { goto _63 } *(*TExpr)(unsafe.Pointer(bp + 8)) = *(*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pAlt)).FpExpr)) @@ -140057,7 +134491,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI nPk1 = int32(1) } else { pPk3 = _sqlite3PrimaryKeyIndex(tls, pTab1) - nPk1 = int32((*TIndex)(unsafe.Pointer(pPk3)).FnKeyCol) + nPk1 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk3)).FnKeyCol) r1 = _sqlite3GetTempRange(tls, pParse, nPk1+int32(1)) iPk1 = 0 for { @@ -140102,7 +134536,6 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pRJ1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ _sqlite3VdbeAddOp2(tls, v, int32(OP_BeginSubrtn), 0, (*TWhereRightJoin)(unsafe.Pointer(pRJ1)).FregReturn) (*TWhereRightJoin)(unsafe.Pointer(pRJ1)).FaddrSubrtn = _sqlite3VdbeCurrentAddr(tls, v) - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ /* WHERE clause constraints must be deferred until after outer join ** row elimination has completed, since WHERE clause constraints apply @@ -140118,17 +134551,15 @@ code_outer_join_constraints: if !(j < (*TWhereClause)(unsafe.Pointer(pWC)).FnBase) { break } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_CODED)) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_CODED)) != 0 { goto _67 } if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*TWhereLevel)(unsafe.Pointer(pLevel)).FnotReady != uint64(0) { - _ = libc.Int32FromInt32(0) goto _67 } - if int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { goto _67 } - _ = libc.Int32FromInt32(0) _sqlite3ExprIfFalse(tls, pParse, (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr, addrCont, int32(SQLITE_JUMPIFNULL)) p68 = pTerm + 10 *(*Tu16)(unsafe.Pointer(p68)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p68))) | libc.Int32FromInt32(TERM_CODED)) @@ -140231,7 +134662,6 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe if !(k < iLevel) { break } - _ = libc.Int32FromInt32(0) pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(k)*84))).FiFrom)*68 mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(k)*84))).FpWLoop)).FmaskSelf if int32(uint32(*(*uint16)(unsafe.Pointer(pRight + 36 + 4))&0x20>>5)) != 0 { @@ -140247,7 +134677,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe ; k++ } - if int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_LTORJ) == 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_LTORJ) == 0 { mAll |= (*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf k = 0 for { @@ -140255,13 +134685,13 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe break } pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*48 - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_SLICE)) != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != int32(WO_ROWVAL) { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_SLICE)) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != int32(WO_ROWVAL) { break } if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & ^mAll != 0 { goto _2 } - if (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { + if (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { goto _2 } pSubWhere = _sqlite3ExprAnd(tls, pParse, pSubWhere, _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr, 0)) @@ -140275,7 +134705,6 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) libc.Xmemcpy(tls, bp+8, pTabItem, uint32(68)) (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { @@ -140291,7 +134720,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe nPk = int32(1) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - nPk = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) + nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) *(*int32)(unsafe.Pointer(pParse + 44)) += nPk - int32(1) iPk = 0 for { @@ -140314,7 +134743,6 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSubWhere) _sqlite3VdbeExplainPop(tls, pParse) - _ = libc.Int32FromInt32(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn-- } @@ -140366,15 +134794,15 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint32(48)*uint32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint32(2))) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint32(48)*libc.Uint32FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint32(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { - if int32(wtFlags)&int32(TERM_DYNAMIC) != 0 { + if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) } (*TWhereClause)(unsafe.Pointer(pWC)).Fa = pOld return 0 } - libc.Xmemcpy(tls, (*TWhereClause)(unsafe.Pointer(pWC)).Fa, pOld, uint32(48)*uint32((*TWhereClause)(unsafe.Pointer(pWC)).FnTerm)) + libc.Xmemcpy(tls, (*TWhereClause)(unsafe.Pointer(pWC)).Fa, pOld, uint32(48)*libc.Uint32FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnTerm)) (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot = (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot * int32(2) } v3 = pWC + 12 @@ -140383,11 +134811,11 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r v1 = v2 idx = v1 pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(v1)*48 - if int32(wtFlags)&int32(TERM_VIRTUAL) == 0 { + if libc.Int32FromUint16(wtFlags)&int32(TERM_VIRTUAL) == 0 { (*TWhereClause)(unsafe.Pointer(pWC)).FnBase = (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm } - if p != 0 && (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_Unlikely)) != uint32(0) { - (*TWhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = int16(int32(_sqlite3LogEst(tls, uint64((*TExpr)(unsafe.Pointer(p)).FiTable))) - int32(270)) + if p != 0 && (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Unlikely)) != uint32(0) { + (*TWhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = int16(int32(_sqlite3LogEst(tls, libc.Uint64FromInt32((*TExpr)(unsafe.Pointer(p)).FiTable))) - int32(270)) } else { (*TWhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = int16(1) } @@ -140407,10 +134835,6 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r // ** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL" // */ func _allowedOp(tls *libc.TLS, op int32) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return libc.BoolInt32(op == int32(TK_IN) || op >= int32(TK_EQ) && op <= int32(TK_GE) || op == int32(TK_ISNULL) || op == int32(TK_IS)) } @@ -140423,19 +134847,14 @@ func _allowedOp(tls *libc.TLS, op int32) (r int32) { func _exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r Tu16) { var t uintptr _ = t - if int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == int32(TK_VECTOR) || int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == int32(TK_VECTOR) || _sqlite3BinaryCompareCollSeq(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != _sqlite3BinaryCompareCollSeq(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == int32(TK_VECTOR) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == int32(TK_VECTOR) || _sqlite3BinaryCompareCollSeq(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != _sqlite3BinaryCompareCollSeq(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) { *(*Tu32)(unsafe.Pointer(pExpr + 4)) ^= uint32(EP_Commuted) } t = (*TExpr)(unsafe.Pointer(pExpr)).FpRight (*TExpr)(unsafe.Pointer(pExpr)).FpRight = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = t - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) >= int32(TK_GT) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) - int32(TK_GT) ^ int32(2) + int32(TK_GT)) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) >= int32(TK_GT) { + (*TExpr)(unsafe.Pointer(pExpr)).Fop = libc.Uint8FromInt32(libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) - int32(TK_GT) ^ int32(2) + int32(TK_GT)) } return uint16(0) } @@ -140448,7 +134867,6 @@ func _exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r Tu16) { func _operatorMask(tls *libc.TLS, op int32) (r Tu16) { var c Tu16 _ = c - _ = libc.Int32FromInt32(0) if op == int32(TK_IN) { c = uint16(WO_IN) } else { @@ -140458,19 +134876,10 @@ func _operatorMask(tls *libc.TLS, op int32) (r Tu16) { if op == int32(TK_IS) { c = uint16(WO_IS) } else { - _ = libc.Int32FromInt32(0) - c = uint16(libc.Int32FromInt32(WO_EQ) << (op - libc.Int32FromInt32(TK_EQ))) + c = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ) << (op - libc.Int32FromInt32(TK_EQ))) } } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return c } @@ -140503,11 +134912,10 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt if !(_sqlite3IsLikeFunction(tls, db, pExpr, pnoCase, bp) != 0) { return 0 } - _ = libc.Int32FromInt32(0) pList = *(*uintptr)(unsafe.Pointer(pExpr + 20)) pLeft = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*20))).FpExpr pRight = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8))).FpExpr) - op = int32((*TExpr)(unsafe.Pointer(pRight)).Fop) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) if op == int32(TK_VARIABLE) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableQPSG) == uint64(0) { pReprepare = (*TParse)(unsafe.Pointer(pParse)).FpReprepare iCol = int32((*TExpr)(unsafe.Pointer(pRight)).FiColumn) @@ -140516,10 +134924,8 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt z = Xsqlite3_value_text(tls, pVal) } _sqlite3VdbeSetVarmask(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, iCol) - _ = libc.Int32FromInt32(0) } else { if op == int32(TK_STRING) { - _ = libc.Int32FromInt32(0) z = *(*uintptr)(unsafe.Pointer(pRight + 8)) } } @@ -140529,11 +134935,11 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt for { v1 = *(*Tu8)(unsafe.Pointer(z + uintptr(cnt))) c = v1 - if !(int32(v1) != 0 && int32(c) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && int32(c) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(1)]) && int32(c) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(2)])) { + if !(libc.Int32FromUint8(v1) != 0 && libc.Int32FromUint8(c) != libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && libc.Int32FromUint8(c) != libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(1)]) && libc.Int32FromUint8(c) != libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(2)])) { break } cnt++ - if int32(c) == int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)]) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt)))) != 0 { + if libc.Int32FromUint8(c) == libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)]) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt)))) != 0 { cnt++ } } @@ -140545,13 +134951,12 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt ** range search. The third is because the caller assumes that the pattern ** consists of at least one character after all escapes have been ** removed. */ - if (cnt > int32(1) || cnt > 0 && int32(*(*Tu8)(unsafe.Pointer(z))) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)])) && int32(255) != int32(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt-int32(1))))) { + if (cnt > int32(1) || cnt > 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z))) != libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)])) && int32(255) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt-int32(1))))) { /* A "complete" match if the pattern ends with "*" or "%" */ - *(*int32)(unsafe.Pointer(pisComplete)) = libc.BoolInt32(int32(c) == int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt+int32(1))))) == 0) + *(*int32)(unsafe.Pointer(pisComplete)) = libc.BoolInt32(libc.Int32FromUint8(c) == libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt+int32(1))))) == 0) /* Get the pattern prefix. Remove all escapes from the prefix. */ pPrefix = _sqlite3Expr(tls, db, int32(TK_STRING), z) if pPrefix != 0 { - _ = libc.Int32FromInt32(0) zNew = *(*uintptr)(unsafe.Pointer(pPrefix + 8)) *(*int8)(unsafe.Pointer(zNew + uintptr(cnt))) = 0 v3 = libc.Int32FromInt32(0) @@ -140561,7 +134966,7 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt if !(iFrom < cnt) { break } - if int32(*(*int8)(unsafe.Pointer(zNew + uintptr(iFrom)))) == int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)]) { + if int32(*(*int8)(unsafe.Pointer(zNew + uintptr(iFrom)))) == libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)]) { iFrom++ } v4 = iTo @@ -140573,7 +134978,6 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt iFrom++ } *(*int8)(unsafe.Pointer(zNew + uintptr(iTo))) = 0 - _ = libc.Int32FromInt32(0) /* If the LHS is not an ordinary column with TEXT affinity, then the ** pattern prefix boundaries (both the start and end boundaries) must ** not look like a number. Otherwise the pattern might be treated as @@ -140587,7 +134991,7 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt ** 2019-06-14 https://sqlite.org/src/info/ce8717f0885af975 ** 2019-09-03 https://sqlite.org/src/info/0f0428096f17252a */ - if int32((*TExpr)(unsafe.Pointer(pLeft)).Fop) != int32(TK_COLUMN) || int32(_sqlite3ExprAffinity(tls, pLeft)) != int32(SQLITE_AFF_TEXT) || (*TExpr)(unsafe.Pointer(pLeft)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) && (*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab != 0 && int32((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) != int32(TK_COLUMN) || int32(_sqlite3ExprAffinity(tls, pLeft)) != int32(SQLITE_AFF_TEXT) || (*TExpr)(unsafe.Pointer(pLeft)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) && (*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { isNum = _sqlite3AtoF(tls, zNew, bp+8, iTo, uint8(SQLITE_UTF8)) if isNum <= 0 { if iTo == int32(1) && int32(*(*int8)(unsafe.Pointer(zNew))) == int32('-') { @@ -140611,7 +135015,6 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt if op == int32(TK_VARIABLE) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe _sqlite3VdbeSetVarmask(tls, v, int32((*TExpr)(unsafe.Pointer(pRight)).FiColumn)) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(pisComplete)) != 0 && *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 8)) + 1)) != 0 { /* If the rhs of the LIKE expression is a variable, and the current ** value of the variable means there is no need to invoke the LIKE @@ -140670,8 +135073,7 @@ func _isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 ui var _ /* pNotUsed at bp+4 */ uintptr var _ /* xNotUsed at bp+0 */ uintptr _, _, _, _, _, _, _, _, _ = i, pCol, pLeft, pList, pMod, pRight, pVtab, res, t - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) { pList = *(*uintptr)(unsafe.Pointer(pExpr + 20)) if pList == uintptr(0) || (*TExprList)(unsafe.Pointer(pList)).FnExpr != int32(2) { return 0 @@ -140684,14 +135086,12 @@ func _isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 ui ** MATCH(expression,vtab_column) */ pCol = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*20))).FpExpr - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pCol)).Fop) == int32(TK_COLUMN) && int32((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pCol)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCol)).Fop) == int32(TK_COLUMN) && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pCol)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { i = 0 for { - if !(i < int32(libc.Uint32FromInt64(32)/libc.Uint32FromInt64(8))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(32)/libc.Uint32FromInt64(8))) { break } - _ = libc.Int32FromInt32(0) if _sqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), _aOp[i].FzOp) == 0 { *(*uint8)(unsafe.Pointer(peOp2)) = _aOp[i].FeOp2 *(*uintptr)(unsafe.Pointer(ppRight)) = (*(*TExprList_item)(unsafe.Pointer(pList + 8))).FpExpr @@ -140715,18 +135115,13 @@ func _isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 ui ** with function names in an arbitrary case. */ pCol = (*(*TExprList_item)(unsafe.Pointer(pList + 8))).FpExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pCol)).Fop) == int32(TK_COLUMN) && int32((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pCol)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCol)).Fop) == int32(TK_COLUMN) && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pCol)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { pVtab = (*TVTable)(unsafe.Pointer(_sqlite3GetVTable(tls, db, (*TExpr)(unsafe.Pointer(pCol)).Fy.FpTab))).FpVtab - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pMod = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule if (*Tsqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction != uintptr(0) { i = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction})))(tls, pVtab, int32(2), *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp, bp+4) if i >= int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) { - *(*uint8)(unsafe.Pointer(peOp2)) = uint8(i) + *(*uint8)(unsafe.Pointer(peOp2)) = libc.Uint8FromInt32(i) *(*uintptr)(unsafe.Pointer(ppRight)) = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*20))).FpExpr *(*uintptr)(unsafe.Pointer(ppLeft)) = pCol return int32(1) @@ -140734,16 +135129,14 @@ func _isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 ui } } } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NE) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ISNOT) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NE) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ISNOT) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { res = 0 pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_COLUMN) && int32((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_COLUMN) && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pLeft)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB) { res++ } - _ = libc.Int32FromInt32(0) - if pRight != 0 && (int32((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_COLUMN) && int32((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pRight)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB)) { + if pRight != 0 && (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_COLUMN) && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pRight)).Fy.FpTab)).FeTabType) == int32(TABTYP_VTAB)) { res++ t = pLeft pLeft = pRight @@ -140751,13 +135144,13 @@ func _isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 ui } *(*uintptr)(unsafe.Pointer(ppLeft)) = pLeft *(*uintptr)(unsafe.Pointer(ppRight)) = pRight - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NE) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NE) { *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_NE) } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ISNOT) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ISNOT) { *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOT) } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOTNULL) } return res @@ -140795,8 +135188,8 @@ var _aOp = [4]struct { // ** a join, then transfer the appropriate markings over to derived. // */ func _transferJoinMarkings(tls *libc.TLS, pDerived uintptr, pBase uintptr) { - if pDerived != 0 && (*TExpr)(unsafe.Pointer(pBase)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pDerived + 4)) |= (*TExpr)(unsafe.Pointer(pBase)).Fflags & uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) + if pDerived != 0 && (*TExpr)(unsafe.Pointer(pBase)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { + *(*Tu32)(unsafe.Pointer(pDerived + 4)) |= (*TExpr)(unsafe.Pointer(pBase)).Fflags & libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) *(*int32)(unsafe.Pointer(pDerived + 36)) = *(*int32)(unsafe.Pointer(pBase + 36)) } } @@ -140822,7 +135215,7 @@ func _markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) { func _whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) (r uintptr) { var v1 uintptr _ = v1 - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != int32(WO_AND) { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != int32(WO_AND) { if N == 0 { v1 = pTerm } else { @@ -140863,21 +135256,19 @@ func _whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintp var eOp Tu16 var idxNew, op int32 _, _, _, _, _ = db, eOp, idxNew, op, pNew - eOp = uint16(int32((*TWhereTerm)(unsafe.Pointer(pOne)).FeOperator) | int32((*TWhereTerm)(unsafe.Pointer(pTwo)).FeOperator)) /* Index in pWC of the next virtual term */ - if (int32((*TWhereTerm)(unsafe.Pointer(pOne)).FwtFlags)|int32((*TWhereTerm)(unsafe.Pointer(pTwo)).FwtFlags))&int32(TERM_VNULL) != 0 { + eOp = libc.Uint16FromInt32(libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOne)).FeOperator) | libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTwo)).FeOperator)) /* Index in pWC of the next virtual term */ + if (libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOne)).FwtFlags)|libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTwo)).FwtFlags))&int32(TERM_VNULL) != 0 { return } - if int32((*TWhereTerm)(unsafe.Pointer(pOne)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOne)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) == 0 { return } - if int32((*TWhereTerm)(unsafe.Pointer(pTwo)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTwo)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) == 0 { return } - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) != int32(eOp) && int32(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != int32(eOp) { + if libc.Int32FromUint16(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) != libc.Int32FromUint16(eOp) && libc.Int32FromUint16(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != libc.Int32FromUint16(eOp) { return } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _sqlite3ExprCompare(tls, uintptr(0), (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pOne)).FpExpr)).FpLeft, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTwo)).FpExpr)).FpLeft, -int32(1)) != 0 { return } @@ -140885,12 +135276,11 @@ func _whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintp return } /* If we reach this point, it means the two subterms can be combined */ - if int32(eOp)&(int32(eOp)-int32(1)) != 0 { - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) != 0 { - eOp = uint16(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_LE) - libc.Int32FromInt32(TK_EQ))) + if libc.Int32FromUint16(eOp)&(libc.Int32FromUint16(eOp)-int32(1)) != 0 { + if libc.Int32FromUint16(eOp)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) != 0 { + eOp = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_LE) - libc.Int32FromInt32(TK_EQ))) } else { - _ = libc.Int32FromInt32(0) - eOp = uint16(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_GE) - libc.Int32FromInt32(TK_EQ))) + eOp = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_GE) - libc.Int32FromInt32(TK_EQ))) } } db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb @@ -140900,17 +135290,16 @@ func _whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintp } op = int32(TK_EQ) for { - if !(int32(eOp) != int32(WO_EQ)<<(op-int32(TK_EQ))) { + if !(libc.Int32FromUint16(eOp) != int32(WO_EQ)<<(op-int32(TK_EQ))) { break } - _ = libc.Int32FromInt32(0) goto _1 _1: ; op++ } - (*TExpr)(unsafe.Pointer(pNew)).Fop = uint8(op) - idxNew = _whereClauseInsert(tls, pWC, pNew, uint16(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) + (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) + idxNew = _whereClauseInsert(tls, pWC, pNew, libc.Uint16FromInt32(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) _exprAnalyze(tls, pSrc, pWC, idxNew) } @@ -141018,8 +135407,6 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) ** stored in a WhereClause structure containing within the WhereOrInfo ** object that is attached to the original OR clause term. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v1 = _sqlite3DbMallocZero(tls, db, uint64(420)) pOrInfo = v1 *(*uintptr)(unsafe.Pointer(&(*TWhereTerm)(unsafe.Pointer(pTerm)).Fu)) = v1 @@ -141036,7 +135423,6 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - _ = libc.Int32FromInt32(0) /* ** Compute the set of tables that might satisfy cases 1 or 3. */ @@ -141048,8 +135434,7 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) if !(i >= 0 && indexable != 0) { break } - if int32((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&int32(WO_SINGLE) == 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&int32(WO_SINGLE) == 0 { chngToIN = uint64(0) pAndInfo = _sqlite3DbMallocRawNN(tls, db, uint64(412)) if pAndInfo != 0 { @@ -141072,8 +135457,7 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) if !(j < (*TWhereClause)(unsafe.Pointer(pAndWC)).FnTerm) { break } - _ = libc.Int32FromInt32(0) - if _allowedOp(tls, int32((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pAndTerm)).FpExpr)).Fop)) != 0 || int32((*TWhereTerm)(unsafe.Pointer(pAndTerm)).FeOperator) == int32(WO_AUX) { + if _allowedOp(tls, libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pAndTerm)).FpExpr)).Fop)) != 0 || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pAndTerm)).FeOperator) == int32(WO_AUX) { b |= _sqlite3WhereGetMask(tls, pWInfo+488, (*TWhereTerm)(unsafe.Pointer(pAndTerm)).FleftCursor) } goto _5 @@ -141086,17 +135470,17 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) indexable &= b } } else { - if int32((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&int32(TERM_COPIED) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&int32(TERM_COPIED) != 0 { /* Skip this term for now. We revisit it when we process the ** corresponding TERM_VIRTUAL term */ } else { b1 = _sqlite3WhereGetMask(tls, pWInfo+488, (*TWhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor) - if int32((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&int32(TERM_VIRTUAL) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&int32(TERM_VIRTUAL) != 0 { pOther = (*TWhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FiParent)*48 b1 |= _sqlite3WhereGetMask(tls, pWInfo+488, (*TWhereTerm)(unsafe.Pointer(pOther)).FleftCursor) } indexable &= b1 - if int32((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&int32(WO_EQ) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&int32(WO_EQ) == 0 { chngToIN = uint64(0) } else { chngToIN &= b1 @@ -141188,13 +135572,11 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) if !(i >= 0) { break } - _ = libc.Int32FromInt32(0) p12 = pOrTerm + 10 *(*Tu16)(unsafe.Pointer(p12)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p12))) & ^libc.Int32FromInt32(TERM_OK)) if (*TWhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCursor { /* This is the 2-bit case and we are on the second iteration and ** current term is from the first iteration. So skip this term. */ - _ = libc.Int32FromInt32(0) goto _11 } if chngToIN&_sqlite3WhereGetMask(tls, pWInfo+488, (*TWhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor) == uint64(0) { @@ -141202,10 +135584,8 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) ** chngToIN set but t1 is not. This term will be either preceded ** or followed by an inverted copy (t2.b==t1.a). Skip this term ** and use its inversion. */ - _ = libc.Int32FromInt32(0) goto _11 } - _ = libc.Int32FromInt32(0) iColumn = (*(*struct { FleftColumn int32 FiField int32 @@ -141222,9 +135602,6 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) if i < 0 { /* No candidate table+column was found. This can only occur ** on the second iteration */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) break } /* We have found a candidate table and column. Check to see if that @@ -141234,8 +135611,6 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) if !(i >= 0 && okToChngToIN != 0) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TWhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor != iCursor { p14 = pOrTerm + 10 *(*Tu16)(unsafe.Pointer(p14)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p14))) & ^libc.Int32FromInt32(TERM_OK)) @@ -141284,13 +135659,9 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) if !(i >= 0) { break } - if int32((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&int32(TERM_OK) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&int32(TERM_OK) == 0 { goto _16 } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pDup = _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpRight, 0) pList = _sqlite3ExprListAppend(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pList, pDup) pLeft1 = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft @@ -141300,14 +135671,12 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) i-- pOrTerm += 48 } - _ = libc.Int32FromInt32(0) pDup = _sqlite3ExprDup(tls, db, pLeft1, 0) pNew = _sqlite3PExpr(tls, pParse, int32(TK_IN), pDup, uintptr(0)) if pNew != 0 { _transferJoinMarkings(tls, pNew, pExpr) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pNew + 20)) = pList - idxNew = _whereClauseInsert(tls, pWC, pNew, uint16(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) + idxNew = _whereClauseInsert(tls, pWC, pNew, libc.Uint16FromInt32(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) _exprAnalyze(tls, pSrc, pWC, idxNew) /* pTerm = &pWC->a[idxTerm]; // would be needed if pTerm where reused */ _markTermAsChild(tls, pWC, idxNew, idxTerm) @@ -141339,13 +135708,13 @@ func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) var aff1, aff2 int8 var pColl uintptr _, _, _ = aff1, aff2, pColl - if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { + if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) @@ -141435,13 +135804,12 @@ func _exprMightBeIndexed2(tls *libc.TLS, pFrom uintptr, aiCurCol uintptr, pExpr } i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) != -int32(2) { goto _4 } - _ = libc.Int32FromInt32(0) if _sqlite3ExprCompareSkip(tls, pExpr, (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(i)*20))).FpExpr, iCur) == 0 && !(_sqlite3ExprIsConstant(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(i)*20))).FpExpr) != 0) { *(*int32)(unsafe.Pointer(aiCurCol)) = iCur *(*int32)(unsafe.Pointer(aiCurCol + 1*4)) = -int32(2) @@ -141476,14 +135844,10 @@ func _exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, aiCurCol uintptr, pExpr u /* If this expression is a vector to the left or right of a ** inequality constraint (>, <, >= or <=), perform the processing ** on the first element of the vector. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_VECTOR) && (op >= int32(TK_GT) && op <= int32(TK_GE)) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_VECTOR) && (op >= int32(TK_GT) && op <= int32(TK_GE)) { pExpr = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) { *(*int32)(unsafe.Pointer(aiCurCol)) = (*TExpr)(unsafe.Pointer(pExpr)).FiTable *(*int32)(unsafe.Pointer(aiCurCol + 1*4)) = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) return int32(1) @@ -141563,17 +135927,14 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - _ = libc.Int32FromInt32(0) pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48 pMaskSet = pWInfo + 488 pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - _ = libc.Int32FromInt32(0) /* Because malloc() has not failed */ - _ = libc.Int32FromInt32(0) + /* Because malloc() has not failed */ (*TWhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = 0 prereqLeft = _sqlite3WhereExprUsage(tls, pMaskSet, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) if op == int32(TK_IN) { - _ = libc.Int32FromInt32(0) if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } @@ -141585,7 +135946,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { prereqAll = prereqLeft | (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight } else { (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = _sqlite3WhereExprUsage(tls, pMaskSet, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft == uintptr(0) || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_xIsSelect)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) || *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft == uintptr(0) || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_xIsSelect)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) || *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) { prereqAll = _sqlite3WhereExprUsageNN(tls, pMaskSet, pExpr) } else { prereqAll = prereqLeft | (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight @@ -141595,9 +135956,9 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { p1 = pTerm + 10 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(TERM_VARSELECT)) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { x = _sqlite3WhereGetMask(tls, pMaskSet, *(*int32)(unsafe.Pointer(pExpr + 36))) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { prereqAll |= x extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ @@ -141613,11 +135974,11 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** clause and carried on. Beginning with 3.39, raise an error only ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ - if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22455, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) } } } @@ -141633,14 +135994,11 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { v2 = int32(WO_EQUIV) } - opMask = uint16(v2) + opMask = libc.Uint16FromInt32(v2) if (*(*struct { FleftColumn int32 FiField int32 })(unsafe.Pointer(pTerm + 24))).FiField > 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pLeft = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 20)) + 8 + uintptr((*(*struct { FleftColumn int32 FiField int32 @@ -141648,27 +136006,25 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } if _exprMightBeIndexed(tls, pSrc, bp+16, pLeft, op) != 0 { (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = (*(*[2]int32)(unsafe.Pointer(bp + 16)))[0] - _ = libc.Int32FromInt32(0) (*(*struct { FleftColumn int32 FiField int32 })(unsafe.Pointer(pTerm + 24))).FleftColumn = (*(*[2]int32)(unsafe.Pointer(bp + 16)))[int32(1)] - (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(int32(_operatorMask(tls, op)) & int32(opMask)) + (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = libc.Uint16FromInt32(libc.Int32FromUint16(_operatorMask(tls, op)) & libc.Int32FromUint16(opMask)) } if op == int32(TK_IS) { p3 = pTerm + 10 *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(TERM_IS)) } - if pRight != 0 && _exprMightBeIndexed(tls, pSrc, bp+16, pRight, op) != 0 && !((*TExpr)(unsafe.Pointer(pRight)).Fflags&uint32(libc.Int32FromInt32(EP_FixedCol)) != libc.Uint32FromInt32(0)) { + if pRight != 0 && _exprMightBeIndexed(tls, pSrc, bp+16, pRight, op) != 0 && !((*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) != libc.Uint32FromInt32(0)) { eExtraOp = uint16(0) /* Extra bits for pNew->eOperator */ - _ = libc.Int32FromInt32(0) if (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor >= 0 { pDup = _sqlite3ExprDup(tls, db, pExpr, 0) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3ExprDelete(tls, db, pDup) return } - idxNew = _whereClauseInsert(tls, pWC, pDup, uint16(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) + idxNew = _whereClauseInsert(tls, pWC, pDup, libc.Uint16FromInt32(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) if idxNew == 0 { return } @@ -141691,40 +136047,35 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pNew = pTerm } p7 = pNew + 10 - *(*Tu16)(unsafe.Pointer(p7)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p7))) | int32(_exprCommute(tls, pParse, pDup))) + *(*Tu16)(unsafe.Pointer(p7)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p7))) | libc.Int32FromUint16(_exprCommute(tls, pParse, pDup))) (*TWhereTerm)(unsafe.Pointer(pNew)).FleftCursor = (*(*[2]int32)(unsafe.Pointer(bp + 16)))[0] - _ = libc.Int32FromInt32(0) (*(*struct { FleftColumn int32 FiField int32 })(unsafe.Pointer(pNew + 24))).FleftColumn = (*(*[2]int32)(unsafe.Pointer(bp + 16)))[int32(1)] (*TWhereTerm)(unsafe.Pointer(pNew)).FprereqRight = prereqLeft | extraRight (*TWhereTerm)(unsafe.Pointer(pNew)).FprereqAll = prereqAll - (*TWhereTerm)(unsafe.Pointer(pNew)).FeOperator = uint16((int32(_operatorMask(tls, int32((*TExpr)(unsafe.Pointer(pDup)).Fop))) + int32(eExtraOp)) & int32(opMask)) + (*TWhereTerm)(unsafe.Pointer(pNew)).FeOperator = libc.Uint16FromInt32((libc.Int32FromUint16(_operatorMask(tls, libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop))) + libc.Int32FromUint16(eExtraOp)) & libc.Int32FromUint16(opMask)) } else { - if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { - _ = libc.Int32FromInt32(0) + if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8016 - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_IsFalse)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) } } } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_BETWEEN) && int32((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_BETWEEN) && libc.Int32FromUint8((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) { pList = *(*uintptr)(unsafe.Pointer(pExpr + 20)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < int32(2)) { break } - pNewExpr = _sqlite3PExpr(tls, pParse, int32(_ops[i]), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, 0), _sqlite3ExprDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr, 0)) + pNewExpr = _sqlite3PExpr(tls, pParse, libc.Int32FromUint8(_ops[i]), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, 0), _sqlite3ExprDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr, 0)) _transferJoinMarkings(tls, pNewExpr, pExpr) - idxNew1 = _whereClauseInsert(tls, pWC, pNewExpr, uint16(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) + idxNew1 = _whereClauseInsert(tls, pWC, pNewExpr, libc.Uint16FromInt32(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) _exprAnalyze(tls, pSrc, pWC, idxNew1) pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48 _markTermAsChild(tls, pWC, idxNew1, idxTerm) @@ -141734,16 +136085,15 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { i++ } } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_OR) { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_OR) { _exprAnalyzeOrTerm(tls, pSrc, pWC, idxTerm) pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48 } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { - if int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0 && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0 && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) { pLeft1 = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft pNewExpr1 = _sqlite3PExpr(tls, pParse, int32(TK_GT), _sqlite3ExprDup(tls, db, pLeft1, 0), _sqlite3ExprAlloc(tls, db, int32(TK_NULL), uintptr(0), 0)) - idxNew2 = _whereClauseInsert(tls, pWC, pNewExpr1, uint16(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC)|libc.Int32FromInt32(TERM_VNULL))) + idxNew2 = _whereClauseInsert(tls, pWC, pNewExpr1, libc.Uint16FromInt32(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC)|libc.Int32FromInt32(TERM_VNULL))) if idxNew2 != 0 { pNewTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew2)*48 (*TWhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = uint64(0) @@ -141752,7 +136102,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { FleftColumn int32 FiField int32 })(unsafe.Pointer(pNewTerm + 24))).FleftColumn = int32((*TExpr)(unsafe.Pointer(pLeft1)).FiColumn) - (*TWhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = uint16(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_GT) - libc.Int32FromInt32(TK_EQ))) + (*TWhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_GT) - libc.Int32FromInt32(TK_EQ))) _markTermAsChild(tls, pWC, idxNew2, idxTerm) pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48 p9 = pTerm + 10 @@ -141761,13 +136111,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } } } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) && int32((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) && _isLikeOrGlob(tls, pParse, pExpr, bp, bp+4, bp+8) != 0 { /* Name of collating sequence */ - wtFlags = uint16(libc.Int32FromInt32(TERM_LIKEOPT) | libc.Int32FromInt32(TERM_VIRTUAL) | libc.Int32FromInt32(TERM_DYNAMIC)) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) && libc.Int32FromUint8((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) && _isLikeOrGlob(tls, pParse, pExpr, bp, bp+4, bp+8) != 0 { /* Name of collating sequence */ + wtFlags = libc.Uint16FromInt32(libc.Int32FromInt32(TERM_LIKEOPT) | libc.Int32FromInt32(TERM_VIRTUAL) | libc.Int32FromInt32(TERM_DYNAMIC)) pLeft2 = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 1*20))).FpExpr pStr2 = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp)), 0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Convert the lower bound to upper-case and the upper bound to ** lower-case (upper-case is less than lower-case in ASCII) so that ** the range constraints also work for BLOBs @@ -141782,8 +136129,8 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { if !(int32(v12) != 0) { break } - *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) + uintptr(i1))) = int8(int32(c) & ^(int32(_sqlite3CtypeMap[uint8(c)]) & libc.Int32FromInt32(0x20))) - *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pStr2 + 8)) + uintptr(i1))) = int8(_sqlite3UpperToLower[uint8(c)]) + *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) + uintptr(i1))) = int8(int32(c) & ^(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(c)]) & libc.Int32FromInt32(0x20))) + *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pStr2 + 8)) + uintptr(i1))) = libc.Int8FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(c)]) goto _11 _11: ; @@ -141800,12 +136147,12 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** inequality. To avoid this, make sure to also run the full ** LIKE on all candidate expressions by clearing the isComplete flag */ - if int32(c1) == libc.Int32FromUint8('A')-libc.Int32FromInt32(1) { + if libc.Int32FromUint8(c1) == libc.Int32FromUint8('A')-libc.Int32FromInt32(1) { *(*int32)(unsafe.Pointer(bp + 4)) = 0 } c1 = _sqlite3UpperToLower[c1] } - *(*Tu8)(unsafe.Pointer(pC)) = uint8(int32(c1) + int32(1)) + *(*Tu8)(unsafe.Pointer(pC)) = libc.Uint8FromInt32(libc.Int32FromUint8(c1) + int32(1)) } if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { v13 = __ccgo_ts + 22496 @@ -141843,11 +136190,11 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** ** tag-20220128a */ - if v15 = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_EQ) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS); v15 { + if v15 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_EQ) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS); v15 { v14 = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) nLeft = v14 } - if v15 && v14 > int32(1) && _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) == nLeft && ((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags&uint32(EP_xIsSelect) == uint32(0) || (*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpRight)).Fflags&uint32(EP_xIsSelect) == uint32(0)) && int32((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) { + if v15 && v14 > int32(1) && _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) == nLeft && ((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags&uint32(EP_xIsSelect) == uint32(0) || (*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpRight)).Fflags&uint32(EP_xIsSelect) == uint32(0)) && libc.Int32FromUint8((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) { i2 = 0 for { if !(i2 < nLeft) { @@ -141855,9 +136202,9 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } pLeft3 = _sqlite3ExprForVectorField(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, i2, nLeft) pRight1 = _sqlite3ExprForVectorField(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, i2, nLeft) - pNew1 = _sqlite3PExpr(tls, pParse, int32((*TExpr)(unsafe.Pointer(pExpr)).Fop), pLeft3, pRight1) + pNew1 = _sqlite3PExpr(tls, pParse, libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop), pLeft3, pRight1) _transferJoinMarkings(tls, pNew1, pExpr) - idxNew3 = _whereClauseInsert(tls, pWC, pNew1, uint16(libc.Int32FromInt32(TERM_DYNAMIC)|libc.Int32FromInt32(TERM_SLICE))) + idxNew3 = _whereClauseInsert(tls, pWC, pNew1, libc.Uint16FromInt32(libc.Int32FromInt32(TERM_DYNAMIC)|libc.Int32FromInt32(TERM_SLICE))) _exprAnalyze(tls, pSrc, pWC, idxNew3) goto _16 _16: @@ -141869,16 +136216,16 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu16)(unsafe.Pointer(p17)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p17))) | (libc.Int32FromInt32(TERM_CODED) | libc.Int32FromInt32(TERM_VIRTUAL))) /* Disable the original */ (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(WO_ROWVAL) } else { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IN) && (*(*struct { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IN) && (*(*struct { FleftColumn int32 FiField int32 - })(unsafe.Pointer(pTerm + 24))).FiField == 0 && int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == int32(TK_VECTOR) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) && ((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpPrior == uintptr(0) || (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FselFlags&uint32(SF_Values) != 0) && (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpWin == uintptr(0) && int32((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) { + })(unsafe.Pointer(pTerm + 24))).FiField == 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == int32(TK_VECTOR) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) && ((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpPrior == uintptr(0) || (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FselFlags&uint32(SF_Values) != 0) && (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpWin == uintptr(0) && libc.Int32FromUint8((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) { i3 = 0 for { if !(i3 < _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft)) { break } - idxNew4 = _whereClauseInsert(tls, pWC, pExpr, uint16(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_SLICE))) + idxNew4 = _whereClauseInsert(tls, pWC, pExpr, libc.Uint16FromInt32(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_SLICE))) *(*int32)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew4)*48 + 24 + 4)) = i3 + int32(1) _exprAnalyze(tls, pSrc, pWC, idxNew4) _markTermAsChild(tls, pWC, idxNew4, idxTerm) @@ -141888,7 +136235,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { i3++ } } else { - if int32((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) { + if libc.Int32FromUint8((*TWhereClause)(unsafe.Pointer(pWC)).Fop) == int32(TK_AND) { *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 28)) = uintptr(0) res = _isAuxiliaryVtabOperator(tls, db, pExpr, bp+12, bp+28, bp+24) @@ -141902,11 +136249,11 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { prereqColumn = _sqlite3WhereExprUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(bp + 28))) if prereqExpr&prereqColumn == uint64(0) { pNewExpr2 = _sqlite3PExpr(tls, pParse, int32(TK_MATCH), uintptr(0), _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24)), 0)) - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && pNewExpr2 != 0 { - *(*Tu32)(unsafe.Pointer(pNewExpr2 + 4)) |= uint32(libc.Int32FromInt32(EP_OuterON)) + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && pNewExpr2 != 0 { + *(*Tu32)(unsafe.Pointer(pNewExpr2 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) *(*int32)(unsafe.Pointer(pNewExpr2 + 36)) = *(*int32)(unsafe.Pointer(pExpr + 36)) } - idxNew5 = _whereClauseInsert(tls, pWC, pNewExpr2, uint16(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) + idxNew5 = _whereClauseInsert(tls, pWC, pNewExpr2, libc.Uint16FromInt32(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) pNewTerm1 = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew5)*48 (*TWhereTerm)(unsafe.Pointer(pNewTerm1)).FprereqRight = prereqExpr (*TWhereTerm)(unsafe.Pointer(pNewTerm1)).FleftCursor = (*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).FiTable @@ -141970,11 +136317,10 @@ func _sqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op Tu8) { _ = pE2 pE2 = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) (*TWhereClause)(unsafe.Pointer(pWC)).Fop = op - _ = libc.Int32FromInt32(0) if pE2 == uintptr(0) { return } - if int32((*TExpr)(unsafe.Pointer(pE2)).Fop) != int32(op) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE2)).Fop) != libc.Int32FromUint8(op) { _whereClauseInsert(tls, pWC, pExpr, uint16(0)) } else { _sqlite3WhereSplit(tls, pWC, (*TExpr)(unsafe.Pointer(pE2)).FpLeft, op) @@ -142010,7 +136356,7 @@ func _whereAddLimitExpr(tls *libc.TLS, pWC uintptr, iReg int32, pExpr uintptr, i if pVal == uintptr(0) { return } - *(*Tu32)(unsafe.Pointer(pVal + 4)) |= uint32(libc.Int32FromInt32(EP_IntValue)) + *(*Tu32)(unsafe.Pointer(pVal + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) *(*int32)(unsafe.Pointer(pVal + 8)) = *(*int32)(unsafe.Pointer(bp)) pNew = _sqlite3PExpr(tls, pParse, int32(TK_MATCH), uintptr(0), pVal) } else { @@ -142022,11 +136368,11 @@ func _whereAddLimitExpr(tls *libc.TLS, pWC uintptr, iReg int32, pExpr uintptr, i pNew = _sqlite3PExpr(tls, pParse, int32(TK_MATCH), uintptr(0), pVal1) } if pNew != 0 { - idx = _whereClauseInsert(tls, pWC, pNew, uint16(libc.Int32FromInt32(TERM_DYNAMIC)|libc.Int32FromInt32(TERM_VIRTUAL))) + idx = _whereClauseInsert(tls, pWC, pNew, libc.Uint16FromInt32(libc.Int32FromInt32(TERM_DYNAMIC)|libc.Int32FromInt32(TERM_VIRTUAL))) pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idx)*48 (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = iCsr (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(WO_AUX) - (*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp = uint8(eMatchOp) + (*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp = libc.Uint8FromInt32(eMatchOp) } } @@ -142054,8 +136400,8 @@ func _sqlite3WhereAddLimit(tls *libc.TLS, pWC uintptr, p uintptr) { var iCsr, ii int32 var pExpr, pOrderBy uintptr _, _, _, _ = iCsr, ii, pExpr, pOrderBy - _ = libc.Int32FromInt32(0) /* 1 -- checked by caller */ - if (*TSelect)(unsafe.Pointer(p)).FpGroupBy == uintptr(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(0) && ((*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc == int32(1) && int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpTab)).FeTabType) == int32(TABTYP_VTAB)) { + /* 1 -- checked by caller */ + if (*TSelect)(unsafe.Pointer(p)).FpGroupBy == uintptr(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(0) && ((*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc == int32(1) && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpTab)).FeTabType) == int32(TABTYP_VTAB)) { pOrderBy = (*TSelect)(unsafe.Pointer(p)).FpOrderBy iCsr = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FiCursor /* Check condition (4). Return early if it is not met. */ @@ -142064,11 +136410,9 @@ func _sqlite3WhereAddLimit(tls *libc.TLS, pWC uintptr, p uintptr) { if !(ii < (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm) { break } - if int32((*(*TWhereTerm)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(ii)*48))).FwtFlags)&int32(TERM_CODED) != 0 { + if libc.Int32FromUint16((*(*TWhereTerm)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(ii)*48))).FwtFlags)&int32(TERM_CODED) != 0 { /* This term is a vector operation that has been decomposed into ** other, subsequent terms. It can be ignored. See tag-20220128a */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto _1 } if (*(*TWhereTerm)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(ii)*48))).FnChild != 0 { @@ -142097,13 +136441,13 @@ func _sqlite3WhereAddLimit(tls *libc.TLS, pWC uintptr, p uintptr) { break } pExpr = (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(ii)*20))).FpExpr - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return } if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != iCsr { return } - if int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(ii)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_BIGNULL) != 0 { + if libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(ii)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_BIGNULL) != 0 { return } goto _2 @@ -142113,7 +136457,6 @@ func _sqlite3WhereAddLimit(tls *libc.TLS, pWC uintptr, p uintptr) { } } /* All conditions are met. Add the terms to the where-clause object. */ - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer(p)).FiOffset != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Compound) == uint32(0) { _whereAddLimitExpr(tls, pWC, (*TSelect)(unsafe.Pointer(p)).FiOffset, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpLimit)).FpRight, iCsr, int32(SQLITE_INDEX_CONSTRAINT_OFFSET)) } @@ -142134,7 +136477,7 @@ func _sqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { (*TWhereClause)(unsafe.Pointer(pWC)).FpOuter = uintptr(0) (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm = 0 (*TWhereClause)(unsafe.Pointer(pWC)).FnBase = 0 - (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot = int32(libc.Uint32FromInt64(384) / libc.Uint32FromInt64(48)) + (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot = libc.Int32FromUint32(libc.Uint32FromInt64(384) / libc.Uint32FromInt64(48)) (*TWhereClause)(unsafe.Pointer(pWC)).Fa = pWC + 28 } @@ -142149,21 +136492,17 @@ func _sqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr) { var a, aLast, db uintptr _, _, _ = a, aLast, db db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - _ = libc.Int32FromInt32(0) if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm > 0 { a = (*TWhereClause)(unsafe.Pointer(pWC)).Fa aLast = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*TWhereClause)(unsafe.Pointer(pWC)).FnTerm-int32(1))*48 for int32(1) != 0 { - _ = libc.Int32FromInt32(0) - if int32((*TWhereTerm)(unsafe.Pointer(a)).FwtFlags)&int32(TERM_DYNAMIC) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(a)).FwtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, (*TWhereTerm)(unsafe.Pointer(a)).FpExpr) } - if int32((*TWhereTerm)(unsafe.Pointer(a)).FwtFlags)&(libc.Int32FromInt32(TERM_ORINFO)|libc.Int32FromInt32(TERM_ANDINFO)) != 0 { - if int32((*TWhereTerm)(unsafe.Pointer(a)).FwtFlags)&int32(TERM_ORINFO) != 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(a)).FwtFlags)&(libc.Int32FromInt32(TERM_ORINFO)|libc.Int32FromInt32(TERM_ANDINFO)) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(a)).FwtFlags)&int32(TERM_ORINFO) != 0 { _whereOrInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(&(*TWhereTerm)(unsafe.Pointer(a)).Fu))) } else { - _ = libc.Int32FromInt32(0) _whereAndInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(&(*TWhereTerm)(unsafe.Pointer(a)).Fu))) } } @@ -142212,7 +136551,7 @@ func _sqlite3WhereExprUsageFull(tls *libc.TLS, pMaskSet uintptr, p uintptr) (r T var mask TBitmask var v1 uint64 _, _ = mask, v1 - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_IF_NULL_ROW) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_IF_NULL_ROW) { v1 = _sqlite3WhereGetMask(tls, pMaskSet, (*TExpr)(unsafe.Pointer(p)).FiTable) } else { v1 = uint64(0) @@ -142223,10 +136562,9 @@ func _sqlite3WhereExprUsageFull(tls *libc.TLS, pMaskSet uintptr, p uintptr) (r T } if (*TExpr)(unsafe.Pointer(p)).FpRight != 0 { mask |= _sqlite3WhereExprUsageNN(tls, pMaskSet, (*TExpr)(unsafe.Pointer(p)).FpRight) - _ = libc.Int32FromInt32(0) } else { if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_xIsSelect) != uint32(0) { - if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_VarSelect)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_VarSelect)) != uint32(0) { (*TWhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = int32(1) } mask |= _exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 20))) @@ -142236,8 +136574,7 @@ func _sqlite3WhereExprUsageFull(tls *libc.TLS, pMaskSet uintptr, p uintptr) (r T } } } - if (int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) || int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_AGG_FUNCTION)) && (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_WinFunc) != uint32(0) { - _ = libc.Int32FromInt32(0) + if (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_AGG_FUNCTION)) && (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_WinFunc) != uint32(0) { mask |= _sqlite3WhereExprListUsage(tls, pMaskSet, (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(p)).Fy)))).FpPartition) mask |= _sqlite3WhereExprListUsage(tls, pMaskSet, (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(p)).Fy)))).FpOrderBy) mask |= _sqlite3WhereExprUsage(tls, pMaskSet, (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(p)).Fy)))).FpFilter) @@ -142246,11 +136583,10 @@ func _sqlite3WhereExprUsageFull(tls *libc.TLS, pMaskSet uintptr, p uintptr) (r T } func _sqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) (r TBitmask) { - if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && !((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_FixedCol)) != libc.Uint32FromInt32(0)) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && !((*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) != libc.Uint32FromInt32(0)) { return _sqlite3WhereGetMask(tls, pMaskSet, (*TExpr)(unsafe.Pointer(p)).FiTable) } else { - if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - _ = libc.Int32FromInt32(0) + if (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_TokenOnly)|libc.Int32FromInt32(EP_Leaf)) != uint32(0) { return uint64(0) } } @@ -142335,7 +136671,6 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC return } pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab - _ = libc.Int32FromInt32(0) pArgs = *(*uintptr)(unsafe.Pointer(pItem + 60)) if pArgs == uintptr(0) { return @@ -142347,7 +136682,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC if !(j < (*TExprList)(unsafe.Pointer(pArgs)).FnExpr) { break } - for k < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(k)*12))).FcolFlags)&int32(COLFLAG_HIDDEN) == 0 { + for k < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(k)*12))).FcolFlags)&int32(COLFLAG_HIDDEN) == 0 { k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { @@ -142362,12 +136697,11 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC v3 = k k++ (*TExpr)(unsafe.Pointer(pColRef)).FiColumn = int16(v3) - _ = libc.Int32FromInt32(0) (*TExpr)(unsafe.Pointer(pColRef)).Fy.FpTab = pTab *(*TBitmask)(unsafe.Pointer(pItem + 52)) |= _sqlite3ExprColUsed(tls, pColRef) pRhs = _sqlite3PExpr(tls, pParse, int32(TK_UPLUS), _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*(*TExprList_item)(unsafe.Pointer(pArgs + 8 + uintptr(j)*20))).FpExpr, 0), uintptr(0)) pTerm = _sqlite3PExpr(tls, pParse, int32(TK_EQ), pColRef, pRhs) - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) != 0 { /* testtag-20230227a */ /* testtag-20230227b */ joinType = uint32(EP_OuterON) @@ -142456,7 +136790,7 @@ func _sqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) (r TLogEst) { // ** WHERE clause returns outputs for DISTINCT processing. // */ func _sqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) (r int32) { - return int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) + return libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) } // C documentation @@ -142514,8 +136848,7 @@ func _sqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) (r int32) ** continuation of the inner-most loop. */ return (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiContinue } - pInner = pWInfo + 752 + uintptr(int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-int32(1))*84 - _ = libc.Int32FromInt32(0) + pInner = pWInfo + 752 + uintptr(libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-int32(1))*84 if (*TWhereLevel)(unsafe.Pointer(pInner)).FpRJ != 0 { v1 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiContinue } else { @@ -142547,7 +136880,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == 0 { return } - i = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - int32(1) + i = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - int32(1) for { if !(i >= 0) { break @@ -142572,7 +136905,6 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { // ** immediately with the next row of a WHERE clause. // */ func _sqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiContinue } @@ -142607,7 +136939,7 @@ func _sqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) (r int32) { // */ func _sqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) (r int32) { libc.Xmemcpy(tls, aiCur, pWInfo+20, libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2)) - return int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) + return libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) } // C documentation @@ -142646,7 +136978,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, i = (*TWhereOrSet)(unsafe.Pointer(pSet)).Fn p = pSet + 4 for { - if !(int32(i) > 0) { + if !(libc.Int32FromUint16(i) > 0) { break } if int32(rRun) <= int32((*TWhereOrCost)(unsafe.Pointer(p)).FrRun) && prereq&(*TWhereOrCost)(unsafe.Pointer(p)).Fprereq == prereq { @@ -142661,7 +136993,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, i-- p += 12 } - if int32((*TWhereOrSet)(unsafe.Pointer(pSet)).Fn) < int32(N_OR_COST) { + if libc.Int32FromUint16((*TWhereOrSet)(unsafe.Pointer(pSet)).Fn) < int32(N_OR_COST) { v3 = pSet v2 = *(*Tu16)(unsafe.Pointer(v3)) *(*Tu16)(unsafe.Pointer(v3))++ @@ -142671,7 +137003,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, p = pSet + 4 i = uint16(1) for { - if !(int32(i) < int32((*TWhereOrSet)(unsafe.Pointer(pSet)).Fn)) { + if !(libc.Int32FromUint16(i) < libc.Int32FromUint16((*TWhereOrSet)(unsafe.Pointer(pSet)).Fn)) { break } if int32((*TWhereOrCost)(unsafe.Pointer(p)).FrRun) > int32((*(*TWhereOrCost)(unsafe.Pointer(pSet + 4 + uintptr(i)*12))).FrRun) { @@ -142706,9 +137038,6 @@ whereOrInsert_done: func _sqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) (r TBitmask) { var i int32 _ = i - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(pMaskSet + 8)) == iCursor { return uint64(1) } @@ -142752,7 +137081,6 @@ func _sqlite3WhereRealloc(tls *libc.TLS, pWInfo uintptr, pOld uintptr, nByte Tu6 if pNew != 0 && pOld != 0 { pOldBlk = pOld pOldBlk -= 12 - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, pNew, pOld, uint32((*TWhereMemBlock)(unsafe.Pointer(pOldBlk)).Fsz)) } return pNew @@ -142772,7 +137100,6 @@ func _createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - _ = libc.Int32FromInt32(0) v2 = pMaskSet + 4 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ @@ -142787,7 +137114,7 @@ func _createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) { // */ func _whereRightSubexprIsColumn(tls *libc.TLS, p uintptr) (r uintptr) { p = _sqlite3ExprSkipCollateAndLikely(tls, (*TExpr)(unsafe.Pointer(p)).FpRight) - if p != uintptr(0) && int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && !((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_FixedCol)) != libc.Uint32FromInt32(0)) { + if p != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && !((*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) != libc.Uint32FromInt32(0)) { return p } return uintptr(0) @@ -142812,7 +137139,6 @@ func _indexInAffinityOk(tls *libc.TLS, pParse uintptr, pTerm uintptr, idxaff Tu8 var _ /* inexpr at bp+0 */ TExpr _, _, _, _ = iField, pRet, pX, v1 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - _ = libc.Int32FromInt32(0) if _sqlite3ExprIsVector(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) != 0 { iField = (*(*struct { FleftColumn int32 @@ -142821,11 +137147,10 @@ func _indexInAffinityOk(tls *libc.TLS, pParse uintptr, pTerm uintptr, idxaff Tu8 (*(*TExpr)(unsafe.Pointer(bp))).Fflags = uint32(0) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_EQ) (*(*TExpr)(unsafe.Pointer(bp))).FpLeft = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pX)).FpLeft + 20)) + 8 + uintptr(iField)*20))).FpExpr - _ = libc.Int32FromInt32(0) (*(*TExpr)(unsafe.Pointer(bp))).FpRight = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20)))).FpEList + 8 + uintptr(iField)*20))).FpExpr pX = bp } - if _sqlite3IndexAffinityOk(tls, pX, int8(idxaff)) != 0 { + if _sqlite3IndexAffinityOk(tls, pX, libc.Int8FromUint8(idxaff)) != 0 { pRet = _sqlite3ExprCompareCollSeq(tls, pParse, pX) if pRet != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pRet)).FzName @@ -142851,32 +137176,28 @@ func _whereScanNext(tls *libc.TLS, pScan uintptr) (r uintptr) { var v3, v6 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _ = iColumn, iCur, j, k, pColl, pParse, pTerm, pWC, pX, zCollName, v2, v3, v5, v6 /* The term being tested */ k = (*TWhereScan)(unsafe.Pointer(pScan)).Fk /* Where to start scanning */ - _ = libc.Int32FromInt32(0) pWC = (*TWhereScan)(unsafe.Pointer(pScan)).FpWC for int32(1) != 0 { - iColumn = *(*Ti16)(unsafe.Pointer(pScan + 72 + uintptr(int32((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv)-int32(1))*2)) - iCur = *(*int32)(unsafe.Pointer(pScan + 28 + uintptr(int32((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv)-int32(1))*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + iColumn = *(*Ti16)(unsafe.Pointer(pScan + 72 + uintptr(libc.Int32FromUint8((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv)-int32(1))*2)) + iCur = *(*int32)(unsafe.Pointer(pScan + 28 + uintptr(libc.Int32FromUint8((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv)-int32(1))*4)) for cond := true; cond; cond = pWC != uintptr(0) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*48 for { if !(k < (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm) { break } - _ = libc.Int32FromInt32(0) if (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor == iCur && (*(*struct { FleftColumn int32 FiField int32 - })(unsafe.Pointer(pTerm + 24))).FleftColumn == int32(iColumn) && (int32(iColumn) != -int32(2) || _sqlite3ExprCompareSkip(tls, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft, (*TWhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0) && (int32((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= int32(1) || !((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0))) { - if v3 = int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) != 0 && int32((*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv) < int32(libc.Uint32FromInt64(44)/libc.Uint32FromInt64(4)); v3 { + })(unsafe.Pointer(pTerm + 24))).FleftColumn == int32(iColumn) && (int32(iColumn) != -int32(2) || _sqlite3ExprCompareSkip(tls, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft, (*TWhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0) && (libc.Int32FromUint8((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= int32(1) || !((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0))) { + if v3 = libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) != 0 && libc.Int32FromUint8((*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv) < libc.Int32FromUint32(libc.Uint32FromInt64(44)/libc.Uint32FromInt64(4)); v3 { v2 = _whereRightSubexprIsColumn(tls, (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr) pX = v2 } if v3 && v2 != uintptr(0) { j = 0 for { - if !(j < int32((*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv)) { + if !(j < libc.Int32FromUint8((*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv)) { break } if *(*int32)(unsafe.Pointer(pScan + 28 + uintptr(j)*4)) == (*TExpr)(unsafe.Pointer(pX)).FiTable && int32(*(*Ti16)(unsafe.Pointer(pScan + 72 + uintptr(j)*2))) == int32((*TExpr)(unsafe.Pointer(pX)).FiColumn) { @@ -142887,7 +137208,7 @@ func _whereScanNext(tls *libc.TLS, pScan uintptr) (r uintptr) { ; j++ } - if j == int32((*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv) { + if j == libc.Int32FromUint8((*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv) { *(*int32)(unsafe.Pointer(pScan + 28 + uintptr(j)*4)) = (*TExpr)(unsafe.Pointer(pX)).FiTable *(*Ti16)(unsafe.Pointer(pScan + 72 + uintptr(j)*2)) = (*TExpr)(unsafe.Pointer(pX)).FiColumn (*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv++ @@ -142895,11 +137216,11 @@ func _whereScanNext(tls *libc.TLS, pScan uintptr) (r uintptr) { } if uint32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(*TWhereScan)(unsafe.Pointer(pScan)).FopMask != uint32(0) { /* Verify the affinity and collating sequence match */ - if (*TWhereScan)(unsafe.Pointer(pScan)).FzCollName != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_ISNULL) == 0 { + if (*TWhereScan)(unsafe.Pointer(pScan)).FzCollName != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_ISNULL) == 0 { pParse = (*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_IN) != 0 { - zCollName = _indexInAffinityOk(tls, pParse, pTerm, uint8((*TWhereScan)(unsafe.Pointer(pScan)).Fidxaff)) + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_IN) != 0 { + zCollName = _indexInAffinityOk(tls, pParse, pTerm, libc.Uint8FromInt8((*TWhereScan)(unsafe.Pointer(pScan)).Fidxaff)) if !(zCollName != 0) { goto _1 } @@ -142907,7 +137228,6 @@ func _whereScanNext(tls *libc.TLS, pScan uintptr) (r uintptr) { if !(_sqlite3IndexAffinityOk(tls, pX, (*TWhereScan)(unsafe.Pointer(pScan)).Fidxaff) != 0) { goto _1 } - _ = libc.Int32FromInt32(0) pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pX) if pColl != 0 { v5 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName @@ -142920,10 +137240,10 @@ func _whereScanNext(tls *libc.TLS, pScan uintptr) (r uintptr) { goto _1 } } - if v6 = int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0; v6 { + if v6 = libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0; v6 { pX = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight } - if v6 && pX != libc.UintptrFromInt32(0) && int32((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pX)).FiTable == *(*int32)(unsafe.Pointer(pScan + 28)) && int32((*TExpr)(unsafe.Pointer(pX)).FiColumn) == int32(*(*Ti16)(unsafe.Pointer(pScan + 72))) { + if v6 && pX != libc.UintptrFromInt32(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pX)).FiTable == *(*int32)(unsafe.Pointer(pScan + 28)) && int32((*TExpr)(unsafe.Pointer(pX)).FiColumn) == int32(*(*Ti16)(unsafe.Pointer(pScan + 72))) { goto _1 } (*TWhereScan)(unsafe.Pointer(pScan)).FpWC = pWC @@ -142940,7 +137260,7 @@ func _whereScanNext(tls *libc.TLS, pScan uintptr) (r uintptr) { pWC = (*TWhereClause)(unsafe.Pointer(pWC)).FpOuter k = 0 } - if int32((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv) >= int32((*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv) { + if libc.Int32FromUint8((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv) >= libc.Int32FromUint8((*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv) { break } pWC = (*TWhereScan)(unsafe.Pointer(pScan)).FpOrigWC @@ -143059,7 +137379,7 @@ func _sqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32 _, _ = p, pResult pResult = uintptr(0) p = _whereScanInit(tls, bp, pWC, iCur, iColumn, op, pIdx) - op &= uint32(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IS)) + op &= libc.Uint32FromInt32(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IS)) for p != 0 { if (*TWhereTerm)(unsafe.Pointer(p)).FprereqRight¬Ready == uint64(0) { if (*TWhereTerm)(unsafe.Pointer(p)).FprereqRight == uint64(0) && uint32((*TWhereTerm)(unsafe.Pointer(p)).FeOperator)&op != uint32(0) { @@ -143094,7 +137414,7 @@ func _findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pI break } p = _sqlite3ExprSkipCollateAndLikely(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr) - if p != uintptr(0) && (int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) || int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_AGG_COLUMN)) && int32((*TExpr)(unsafe.Pointer(p)).FiColumn) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))) && (*TExpr)(unsafe.Pointer(p)).FiTable == iBase { + if p != uintptr(0) && (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_AGG_COLUMN)) && int32((*TExpr)(unsafe.Pointer(p)).FiColumn) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))) && (*TExpr)(unsafe.Pointer(p)).FiTable == iBase { pColl = _sqlite3ExprNNCollSeq(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr) if 0 == _sqlite3StrICmp(tls, (*TCollSeq)(unsafe.Pointer(pColl)).FzName, zColl) { return i @@ -143116,8 +137436,6 @@ func _findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pI func _indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var j int32 _ = j - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) j = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))) if j >= 0 { return int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(j)*12 + 4)) & 0xf >> 0)) @@ -143125,7 +137443,6 @@ func _indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { if j == -int32(1) { return int32(1) } else { - _ = libc.Int32FromInt32(0) return 0 /* Assume an indexed expression can always yield a NULL */ } } @@ -143166,7 +137483,7 @@ func _isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC u if p == uintptr(0) { goto _1 } - if int32((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_AGG_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) != int32(TK_AGG_COLUMN) { goto _1 } if (*TExpr)(unsafe.Pointer(p)).FiTable == iBase && int32((*TExpr)(unsafe.Pointer(p)).FiColumn) < 0 { @@ -143195,7 +137512,7 @@ func _isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC u if !(pIdx != 0) { break } - if !(int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) != libc.Int32FromInt32(OE_None)) { + if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) != libc.Int32FromInt32(OE_None)) { goto _2 } if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { @@ -143203,7 +137520,7 @@ func _isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC u } i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } if uintptr(0) == _sqlite3WhereFindTerm(tls, pWC, iBase, i, ^libc.Uint64FromInt32(0), uint32(WO_EQ), pIdx) { @@ -143219,7 +137536,7 @@ func _isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC u ; i++ } - if i == int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { + if i == libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { /* This index implies that the DISTINCT qualifier is redundant. */ return int32(1) } @@ -143242,7 +137559,7 @@ func _estLog(tls *libc.TLS, N TLogEst) (r TLogEst) { if int32(N) <= int32(10) { v1 = 0 } else { - v1 = int32(_sqlite3LogEst(tls, uint64(N))) - int32(33) + v1 = int32(_sqlite3LogEst(tls, libc.Uint64FromInt16(N))) - int32(33) } return int16(v1) } @@ -143278,14 +137595,14 @@ func _translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur if (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 != iTabCur { goto _1 } - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) { (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = uint8(OP_Copy) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 + iRegister (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0 (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(2) /* Cause the MEM_Subtype flag to be cleared */ } else { - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Rowid) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Rowid) { (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = uint8(OP_Sequence) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = iAutoidxCur } @@ -143321,11 +137638,11 @@ func _translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur // ** not-NULL condition on the left table of the RIGHT JOIN. // */ func _constraintCompatibleWithOuterJoin(tls *libc.TLS, pTerm uintptr, pSrc uintptr) (r int32) { - _ = libc.Int32FromInt32(0) /* By caller */ - if !((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr + 36)) != (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { + /* By caller */ + if !((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr + 36)) != (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { return 0 } - if int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) != 0 && (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_InnerON)) != uint32(0) { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) != 0 && (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) != uint32(0) { return 0 } return int32(1) @@ -143344,17 +137661,15 @@ func _termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady TBi if (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { return 0 } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) == 0 { return 0 } - _ = libc.Int32FromInt32(0) - if int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 && !(_constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 && !(_constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) { return 0 /* See https://sqlite.org/forum/forumpost/51e6959f61 */ } if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight¬Ready != uint64(0) { return 0 } - _ = libc.Int32FromInt32(0) if (*(*struct { FleftColumn int32 FiField int32 @@ -143397,7 +137712,6 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea /* Generate code to skip over the creation and initialization of the ** transient index on 2nd and subsequent iterations of the loop. */ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - _ = libc.Int32FromInt32(0) addrInit = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) /* Count the number of columns that will be added to the index ** and used to match WHERE clause constraints */ @@ -143417,17 +137731,16 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea /* Make the automatic index a partial index if there are terms in the ** WHERE clause (or the ON clause of a LEFT join) that constrain which ** rows of the target table (pSrc) that can be used. */ - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VIRTUAL) == 0 && _sqlite3ExprIsSingleTableConstraint(tls, pExpr, pTabList, int32((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom), 0) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VIRTUAL) == 0 && _sqlite3ExprIsSingleTableConstraint(tls, pExpr, pTabList, libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom), 0) != 0 { pPartial = _sqlite3ExprAnd(tls, pParse, pPartial, _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0)) } if _termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0 { - _ = libc.Int32FromInt32(0) iCol = (*(*struct { FleftColumn int32 FiField int32 })(unsafe.Pointer(pTerm + 24))).FleftColumn - if iCol >= int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - v2 = libc.Uint64FromInt32(1) << (int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1)) + if iCol >= libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { + v2 = libc.Uint64FromInt32(1) << (libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1)) } else { v2 = libc.Uint64FromInt32(1) << iCol } @@ -143451,11 +137764,10 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea ; pTerm += 48 } - _ = libc.Int32FromInt32(0) - v4 = uint16(nKeyCol) + v4 = libc.Uint16FromInt32(nKeyCol) (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = v4 (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = v4 - (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = uint32(libc.Int32FromInt32(WHERE_COLUMN_EQ) | libc.Int32FromInt32(WHERE_IDX_ONLY) | libc.Int32FromInt32(WHERE_INDEXED) | libc.Int32FromInt32(WHERE_AUTO_INDEX)) + (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ) | libc.Int32FromInt32(WHERE_IDX_ONLY) | libc.Int32FromInt32(WHERE_INDEXED) | libc.Int32FromInt32(WHERE_AUTO_INDEX)) /* Count the number of additional columns needed to create a ** covering index. A "covering index" is an index that contains all ** columns that are needed by the query. With a covering index, the @@ -143464,13 +137776,13 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea ** original table changes and the index and table cannot both be used ** if they go out of sync. */ - if int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - extraCols = uint64(-libc.Int32FromInt32(1)) & ^idxCols + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { + extraCols = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) & ^idxCols } else { - extraCols = (*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | libc.Uint64FromInt32(1)<<(int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1))) + extraCols = (*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | libc.Uint64FromInt32(1)<<(libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1))) } - if int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) < int32((*TTable)(unsafe.Pointer(pTable)).FnCol) { - v5 = int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) + if libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) < int32((*TTable)(unsafe.Pointer(pTable)).FnCol) { + v5 = libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) } else { v5 = int32((*TTable)(unsafe.Pointer(pTable)).FnCol) } @@ -143488,8 +137800,8 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea ; i++ } - if (*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed&(libc.Uint64FromInt32(1)<<(int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1))) != 0 { - nKeyCol += int32((*TTable)(unsafe.Pointer(pTable)).FnCol) - int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) + int32(1) + if (*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed&(libc.Uint64FromInt32(1)<<(libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1))) != 0 { + nKeyCol += int32((*TTable)(unsafe.Pointer(pTable)).FnCol) - libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) + int32(1) } /* Construct the Index object to describe this index */ pIdx = _sqlite3AllocateIndexObject(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int16(nKeyCol+int32(1)), 0, bp) @@ -143507,13 +137819,12 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea break } if _termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0 { - _ = libc.Int32FromInt32(0) iCol1 = (*(*struct { FleftColumn int32 FiField int32 })(unsafe.Pointer(pTerm + 24))).FleftColumn - if iCol1 >= int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - v8 = libc.Uint64FromInt32(1) << (int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1)) + if iCol1 >= libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { + v8 = libc.Uint64FromInt32(1) << (libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1)) } else { v8 = libc.Uint64FromInt32(1) << iCol1 } @@ -143526,7 +137837,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea FiField int32 })(unsafe.Pointer(pTerm + 24))).FleftColumn) pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pX) - _ = libc.Int32FromInt32(0) /* TH3 collate01.800 */ + /* TH3 collate01.800 */ if pColl != 0 { v9 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { @@ -143549,7 +137860,6 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea ; pTerm += 48 } - _ = libc.Int32FromInt32(0) /* Add additional columns needed to make the automatic index into ** a covering index */ i = 0 @@ -143567,8 +137877,8 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea ; i++ } - if (*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed&(libc.Uint64FromInt32(1)<<(int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1))) != 0 { - i = int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) + if (*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed&(libc.Uint64FromInt32(1)<<(libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1))) != 0 { + i = libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) - libc.Int32FromInt32(1) for { if !(i < int32((*TTable)(unsafe.Pointer(pTable)).FnCol)) { break @@ -143582,18 +137892,16 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea i++ } } - _ = libc.Int32FromInt32(0) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = int16(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*4)) = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) /* Create the automatic index */ - _ = libc.Int32FromInt32(0) v13 = pParse + 40 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = v12 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenAutoindex), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, nKeyCol+int32(1)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) - if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) && useBloomFilter != 0 { + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) && useBloomFilter != 0 { _sqlite3WhereExplainBloomFilter(tls, pParse, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, pLevel) v15 = pParse + 44 *(*int32)(unsafe.Pointer(v15))++ @@ -143602,7 +137910,6 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(10000), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter) } /* Fill the automatic index with content */ - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x20>>5)) != 0 { regYield = (*TSrcItem)(unsafe.Pointer(pSrc)).FregReturn addrCounter = _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, 0) @@ -143619,7 +137926,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea regRecord = _sqlite3GetTempReg(tls, pParse) regBase = _sqlite3GenerateIndexKey(tls, pParse, pIdx, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, regRecord, 0, uintptr(0), uintptr(0), 0) if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter != 0 { - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, 0, regBase, int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, 0, regBase, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) } _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxInsert), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, regRecord) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) @@ -143628,7 +137935,6 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x20>>5)) != 0 { _sqlite3VdbeChangeP2(tls, v, addrCounter, regBase+n) - _ = libc.Int32FromInt32(0) _translateColumnToCopy(tls, pParse, addrTop, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (*TSrcItem)(unsafe.Pointer(pSrc)).FregResult, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur) _sqlite3VdbeGoto(tls, v, addrTop) libc.SetBitFieldPtr16Uint32(pSrc+36+4, libc.Uint32FromInt32(0), 5, 0x20) @@ -143680,12 +137986,8 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p saved_pIdxPartExpr = (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = uintptr(0) (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) addrOnce = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - for cond := true; cond; cond = iLevel < int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) { + for cond := true; cond; cond = iLevel < libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) { _sqlite3WhereExplainBloomFilter(tls, pParse, pWInfo, pLevel) addrCont = _sqlite3VdbeMakeLabel(tls, pParse) iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur @@ -143702,11 +138004,9 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p ** sqlite_stat1 table, testing is much easier. */ pTabList = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList - iSrc = int32((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) + iSrc = libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) pItem = pTabList + 8 + uintptr(iSrc)*68 - _ = libc.Int32FromInt32(0) pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab - _ = libc.Int32FromInt32(0) sz = _sqlite3LogEstToInt(tls, (*TTable)(unsafe.Pointer(pTab)).FnRowLogEst) if sz < uint64(10000) { sz = uint64(10000) @@ -143715,7 +138015,7 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p sz = uint64(10000000) } } - _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(sz), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), libc.Int32FromUint64(sz), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter) addrTop = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) pWCEnd = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FsWC.Fa + uintptr((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsWC.FnTerm)*48 pTerm = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FsWC.Fa @@ -143724,7 +138024,7 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VIRTUAL) == 0 && _sqlite3ExprIsSingleTableConstraint(tls, pExpr, pTabList, iSrc, 0) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VIRTUAL) == 0 && _sqlite3ExprIsSingleTableConstraint(tls, pExpr, pTabList, iSrc, 0) != 0 { _sqlite3ExprIfFalse(tls, pParse, (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr, addrCont, int32(SQLITE_JUMPIFNULL)) } goto _3 @@ -143739,14 +138039,13 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p _sqlite3ReleaseTempReg(tls, pParse, r1) } else { pIdx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - n = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) + n = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) r11 = _sqlite3GetTempRange(tls, pParse, n) jj = 0 for { if !(jj < n) { break } - _ = libc.Int32FromInt32(0) _sqlite3ExprCodeLoadIndexColumn(tls, pParse, pIdx, iCur, jj, r11+jj) goto _4 _4: @@ -143759,19 +138058,19 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p _sqlite3VdbeResolveLabel(tls, v, addrCont) _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, addrTop+int32(1)) _sqlite3VdbeJumpHere(tls, v, addrTop) - *(*Tu32)(unsafe.Pointer(pLoop + 40)) &= uint32(^libc.Int32FromInt32(WHERE_BLOOMFILTER)) - if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_BloomPulldown)) != uint32(0) { + *(*Tu32)(unsafe.Pointer(pLoop + 40)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(WHERE_BLOOMFILTER)) + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomPulldown)) != uint32(0) { break } for { iLevel++ v5 = iLevel - if !(v5 < int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { + if !(v5 < libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { break } pLevel = pWInfo + 752 + uintptr(iLevel)*84 pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*68 - if int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0 { continue } pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -143781,7 +138080,7 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p if (*TWhereLoop)(unsafe.Pointer(pLoop)).Fprereq¬Ready != 0 { continue } - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_BLOOMFILTER)|libc.Int32FromInt32(WHERE_COLUMN_IN)) == uint32(WHERE_BLOOMFILTER) { + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BLOOMFILTER)|libc.Int32FromInt32(WHERE_COLUMN_IN)) == uint32(WHERE_BLOOMFILTER) { /* This is a candidate for bloom-filter pull-down (early evaluation). ** The test that WHERE_COLUMN_IN is omitted is important, as we are ** not able to do early evaluation of bloom filters that make use of @@ -143813,10 +138112,7 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB mNoOmit = uint16(0) eDistinct = 0 pOrderBy = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy - _ = libc.Int32FromInt32(0) pTab = (*TSrcItem)(unsafe.Pointer(pSrc)).FpTab - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Find all WHERE clause constraints referring to this virtual table. ** Mark each term with the TERM_OK flag. Set nTerm to the number of ** terms found. @@ -143837,17 +138133,13 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUnusable != 0 { goto _1 } - _ = libc.Int32FromInt32(0) - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & ^libc.Int32FromInt32(WO_EQUIV) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & ^libc.Int32FromInt32(WO_EQUIV) == 0 { goto _1 } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) != 0 { goto _1 } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 && !(_constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 && !(_constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) { goto _1 } nTerm++ @@ -143877,24 +138169,20 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB goto _5 } /* Virtual tables are unable to deal with NULLS FIRST */ - if int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_BIGNULL) != 0 { + if libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_BIGNULL) != 0 { break } /* First case - a direct column references without a COLLATE operator */ - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { goto _5 } /* 2nd case - a column reference with a COLLATE operator. Only match ** of the COLLATE operator matches the collation of the column. */ - if v7 = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLLATE); v7 { + if v7 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLLATE); v7 { v6 = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft pE2 = v6 } - if v7 && int32((*TExpr)(unsafe.Pointer(v6)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE2)).FiTable == (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { /* The collating sequence name */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if v7 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(v6)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE2)).FiTable == (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { /* The collating sequence name */ (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TExpr)(unsafe.Pointer(pE2)).FiColumn if int32((*TExpr)(unsafe.Pointer(pE2)).FiColumn) < 0 { goto _5 @@ -143916,10 +138204,10 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB } if i == n { nOrderBy = n - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DISTINCTBY) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x4000>>14)) != 0) { - eDistinct = int32(2) + libc.BoolInt32(int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_SORTBYGROUP) != 0) + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DISTINCTBY) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x4000>>14)) != 0) { + eDistinct = int32(2) + libc.BoolInt32(libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_SORTBYGROUP) != 0) } else { - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_GROUPBY) != 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_GROUPBY) != 0 { eDistinct = int32(1) } } @@ -143927,7 +138215,7 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB } /* Allocate the sqlite3_index_info structure */ - pIdxInfo = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(64)+(libc.Uint32FromInt64(12)+libc.Uint32FromInt64(8))*uint32(nTerm)+uint32(8)*uint32(nOrderBy)+uint32(24)+uint32(4)*uint32(nTerm))) + pIdxInfo = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(64)+(libc.Uint32FromInt64(12)+libc.Uint32FromInt64(8))*libc.Uint32FromInt32(nTerm)+uint32(8)*libc.Uint32FromInt32(nOrderBy)+uint32(24)+uint32(4)*libc.Uint32FromInt32(nTerm))) if pIdxInfo == uintptr(0) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1632, 0) return uintptr(0) @@ -143951,7 +138239,7 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB if !(i < (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm) { break } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_OK) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_OK) == 0 { goto _8 } (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).FiColumn = (*(*struct { @@ -143959,9 +138247,9 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB FiField int32 })(unsafe.Pointer(pTerm + 24))).FleftColumn (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).FiTermOffset = i - op = uint16(int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & int32(WO_ALL)) - if int32(op) == int32(WO_IN) { - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_SLICE) == 0 { + op = libc.Uint16FromInt32(libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & int32(WO_ALL)) + if libc.Int32FromUint16(op) == int32(WO_IN) { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_SLICE) == 0 { if j <= int32(31) { v10 = libc.Uint32FromInt32(1) << j } else { @@ -143971,11 +138259,11 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB } op = uint16(WO_EQ) } - if int32(op) == int32(WO_AUX) { + if libc.Int32FromUint16(op) == int32(WO_AUX) { (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = (*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp } else { - if int32(op)&(libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { - if int32(op) == int32(WO_ISNULL) { + if libc.Int32FromUint16(op)&(libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { + if libc.Int32FromUint16(op) == int32(WO_ISNULL) { (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(SQLITE_INDEX_CONSTRAINT_ISNULL) } else { (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(SQLITE_INDEX_CONSTRAINT_IS) @@ -143985,21 +138273,15 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB /* The direct assignment in the previous line is possible only because ** the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical. The ** following asserts verify this fact. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32(op)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0 && _sqlite3ExprIsVector(tls, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight) != 0 { + if libc.Int32FromUint16(op)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0 && _sqlite3ExprIsVector(tls, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight) != 0 { if j < int32(16) { mNoOmit = Tu16(int32(mNoOmit) | libc.Int32FromInt32(1)<<j) } - if int32(op) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) { - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_LE) - libc.Int32FromInt32(TK_EQ))) + if libc.Int32FromUint16(op) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) { + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = libc.Uint8FromInt32(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_LE) - libc.Int32FromInt32(TK_EQ))) } - if int32(op) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) { - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_GE) - libc.Int32FromInt32(TK_EQ))) + if libc.Int32FromUint16(op) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) { + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = libc.Uint8FromInt32(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_GE) - libc.Int32FromInt32(TK_EQ))) } } } @@ -144011,7 +138293,6 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB i++ pTerm += 48 } - _ = libc.Int32FromInt32(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint = j v12 = libc.Int32FromInt32(0) j = v12 @@ -144024,9 +138305,8 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB if _sqlite3ExprIsConstant(tls, uintptr(0), pExpr1) != 0 { goto _11 } - _ = libc.Int32FromInt32(0) (*(*Tsqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(j)*8))).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr1)).FiColumn) - (*(*Tsqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(j)*8))).Fdesc = uint8(int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) + (*(*Tsqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(j)*8))).Fdesc = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) j++ goto _11 _11: @@ -144048,10 +138328,7 @@ func _freeIndexInfo(tls *libc.TLS, db uintptr, pIdxInfo uintptr) { var i int32 var pHidden uintptr _, _ = i, pHidden - _ = libc.Int32FromInt32(0) pHidden = pIdxInfo + 1*64 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) { @@ -144142,9 +138419,6 @@ func _whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, r iMin = 0 /* Number of fields in pRec */ iLower = uint64(0) /* anLt[] + anEq[] of largest sample pRec is > */ _ = pParse - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Do a binary search to find the first sample greater than or equal ** to pRec. If pRec contains a single field, the set of samples to search ** is simply the aSample[] array. If the samples in aSample[] contain more @@ -144190,12 +138464,12 @@ func _whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, r ** cause any problems. */ if !((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { - nField = int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) + nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) } else { - nField = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } - if int32((*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField) < nField { - v1 = int32((*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField) + if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField) < nField { + v1 = libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField) } else { v1 = nField } @@ -144225,7 +138499,7 @@ func _whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, r } else { n = iTest + int32(1) } - (*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField = uint16(n) + (*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField = libc.Uint16FromInt32(n) res = _sqlite3VdbeRecordCompare(tls, (*(*TIndexSample)(unsafe.Pointer(aSample + uintptr(iSamp)*20))).Fn, (*(*TIndexSample)(unsafe.Pointer(aSample + uintptr(iSamp)*20))).Fp, pRec) if res < 0 { iLower = *(*TtRowcnt)(unsafe.Pointer((*(*TIndexSample)(unsafe.Pointer(aSample + uintptr(iSamp)*20))).FanLt + uintptr(n-int32(1))*8)) + *(*TtRowcnt)(unsafe.Pointer((*(*TIndexSample)(unsafe.Pointer(aSample + uintptr(iSamp)*20))).FanEq + uintptr(n-int32(1))*8)) @@ -144244,7 +138518,6 @@ func _whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, r i = iSample / nField if res == 0 { /* Record pRec is equal to sample i */ - _ = libc.Int32FromInt32(0) *(*TtRowcnt)(unsafe.Pointer(aStat)) = *(*TtRowcnt)(unsafe.Pointer((*(*TIndexSample)(unsafe.Pointer(aSample + uintptr(i)*20))).FanLt + uintptr(iCol)*8)) *(*TtRowcnt)(unsafe.Pointer(aStat + 1*8)) = *(*TtRowcnt)(unsafe.Pointer((*(*TIndexSample)(unsafe.Pointer(aSample + uintptr(i)*20))).FanEq + uintptr(iCol)*8)) } else { @@ -144267,7 +138540,7 @@ func _whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, r *(*TtRowcnt)(unsafe.Pointer(aStat + 1*8)) = *(*TtRowcnt)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr(nField-int32(1))*8)) } /* Restore the pRec->nField value before returning. */ - (*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField = uint16(nField) + (*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField = libc.Uint16FromInt32(nField) return i } @@ -144292,9 +138565,8 @@ func _whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew TLogEst) (r TLogEst) { if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 { nRet = TLogEst(int32(nRet) + int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FtruthProb)) } else { - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { nRet = TLogEst(int32(nRet) - libc.Int32FromInt32(20)) - _ = libc.Int32FromInt32(0) } } } @@ -144307,13 +138579,11 @@ func _whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew TLogEst) (r TLogEst) { // ** Return the affinity for a single column of an index. // */ func _sqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) (r int8) { - _ = libc.Int32FromInt32(0) if !((*TIndex)(unsafe.Pointer(pIdx)).FzColAff != 0) { if _sqlite3IndexAffinityStr(tls, db, pIdx) == uintptr(0) { return int8(SQLITE_AFF_BLOB) } } - _ = libc.Int32FromInt32(0) return *(*int8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FzColAff + uintptr(iCol))) } @@ -144365,12 +138635,12 @@ func _whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUppe var _ /* pVal at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aff, db, i, nAdjust, nDiff, nEq, nLower, nUpper, p, pColl, rc, res, res1, v1, p3 p = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - nEq = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) + nEq = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) db = (*TParse)(unsafe.Pointer(pParse)).Fdb nLower = -int32(1) nUpper = (*TIndex)(unsafe.Pointer(p)).FnSample + int32(1) rc = SQLITE_OK - aff = uint8(_sqlite3IndexColumnAffinity(tls, db, p, nEq)) + aff = libc.Uint8FromInt8(_sqlite3IndexColumnAffinity(tls, db, p, nEq)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Value extracted from pLower */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* Value extracted from pUpper */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* Value extracted from record */ @@ -144422,13 +138692,12 @@ func _whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUppe ** the number of rows visited. Otherwise, estimate the number of rows ** using the method described in the header comment for this function. */ if nDiff != int32(1) || pUpper == uintptr(0) || pLower == uintptr(0) { - nAdjust = int32(_sqlite3LogEst(tls, uint64((*TIndex)(unsafe.Pointer(p)).FnSample))) - int32(_sqlite3LogEst(tls, uint64(nDiff))) + nAdjust = int32(_sqlite3LogEst(tls, libc.Uint64FromInt32((*TIndex)(unsafe.Pointer(p)).FnSample))) - int32(_sqlite3LogEst(tls, libc.Uint64FromInt32(nDiff))) p3 = pLoop + 22 *(*TLogEst)(unsafe.Pointer(p3)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p3))) - nAdjust) *(*int32)(unsafe.Pointer(pbDone)) = int32(1) } } else { - _ = libc.Int32FromInt32(0) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -144496,16 +138765,16 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower rc = SQLITE_OK nOut = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut) p = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - nEq = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) - if (*TIndex)(unsafe.Pointer(p)).FnSample > 0 && nEq < (*TIndex)(unsafe.Pointer(p)).FnSampleCol && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { + nEq = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) + if (*TIndex)(unsafe.Pointer(p)).FnSample > 0 && nEq < (*TIndex)(unsafe.Pointer(p)).FnSampleCol && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { if nEq == (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid { *(*uintptr)(unsafe.Pointer(bp)) = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec - nBtm = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm) - nTop = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop) /* Rows less than the upper bound */ - iLwrIdx = -int32(2) /* aSample[] for the lower bound */ - iUprIdx = -int32(1) /* aSample[] for the upper bound */ + nBtm = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm) + nTop = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop) /* Rows less than the upper bound */ + iLwrIdx = -int32(2) /* aSample[] for the lower bound */ + iUprIdx = -int32(1) /* aSample[] for the upper bound */ if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - (*TUnpackedRecord)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnField = uint16((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid) + (*TUnpackedRecord)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnField = libc.Uint16FromInt32((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid) } /* Determine iLower and iUpper using ($P) only. */ if nEq == 0 { @@ -144518,9 +138787,6 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower iLower = (*(*[2]TtRowcnt)(unsafe.Pointer(bp + 4)))[0] iUpper = (*(*[2]TtRowcnt)(unsafe.Pointer(bp + 4)))[0] + (*(*[2]TtRowcnt)(unsafe.Pointer(bp + 4)))[int32(1)] } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(p)).FaSortOrder + uintptr(nEq))) != 0 { /* The roles of pLower and pUpper are swapped for a DESC index */ t = pLower @@ -144535,12 +138801,12 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower pExpr = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pLower)).FpExpr)).FpRight rc = _sqlite3Stat4ProbeSetValue(tls, pParse, p, bp, pExpr, nBtm, nEq, bp+20) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 20)) != 0 { - mask = uint16(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) + mask = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) if _sqlite3ExprVectorSize(tls, pExpr) > *(*int32)(unsafe.Pointer(bp + 20)) { - mask = uint16(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))) + mask = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))) } iLwrIdx = _whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp)), 0, bp+4) - if int32((*TWhereTerm)(unsafe.Pointer(pLower)).FeOperator)&int32(mask) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pLower)).FeOperator)&libc.Int32FromUint16(mask) != 0 { v1 = (*(*[2]TtRowcnt)(unsafe.Pointer(bp + 4)))[int32(1)] } else { v1 = uint64(0) @@ -144558,12 +138824,12 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower pExpr1 = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pUpper)).FpExpr)).FpRight rc = _sqlite3Stat4ProbeSetValue(tls, pParse, p, bp, pExpr1, nTop, nEq, bp+24) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) != 0 { - mask1 = uint16(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) + mask1 = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) if _sqlite3ExprVectorSize(tls, pExpr1) > *(*int32)(unsafe.Pointer(bp + 24)) { - mask1 = uint16(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))) + mask1 = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))) } iUprIdx = _whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp)), int32(1), bp+4) - if int32((*TWhereTerm)(unsafe.Pointer(pUpper)).FeOperator)&int32(mask1) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pUpper)).FeOperator)&libc.Int32FromUint16(mask1) != 0 { v2 = (*(*[2]TtRowcnt)(unsafe.Pointer(bp + 4)))[int32(1)] } else { v2 = uint64(0) @@ -144587,10 +138853,8 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower if iLwrIdx == iUprIdx { nNew = TLogEst(int32(nNew) - libc.Int32FromInt32(20)) } - _ = libc.Int32FromInt32(0) } else { nNew = int16(10) - _ = libc.Int32FromInt32(0) } if int32(nNew) < nOut { nOut = int32(nNew) @@ -144604,7 +138868,6 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower } } } - _ = libc.Int32FromInt32(0) nNew = _whereRangeAdjust(tls, pLower, int16(nOut)) nNew = _whereRangeAdjust(tls, pUpper, nNew) /* TUNING: If there is both an upper and lower limit and neither limit @@ -144656,13 +138919,8 @@ func _whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr u var _ /* pRec at bp+0 */ uintptr _, _, _ = nEq, p, rc p = (*TWhereLoop)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew)).Fu.Fbtree.FpIndex - nEq = int32((*TWhereLoop)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew)).Fu.Fbtree.FnEq) + nEq = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew)).Fu.Fbtree.FnEq) *(*uintptr)(unsafe.Pointer(bp)) = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If values are not available for all fields of the index to the left ** of this one, no estimate can be made. Return SQLITE_NOTFOUND. */ if (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid < nEq-int32(1) { @@ -144670,7 +138928,7 @@ func _whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr u } /* This is an optimization only. The call to sqlite3Stat4ProbeSetValue() ** below would return the same value. */ - if nEq >= int32((*TIndex)(unsafe.Pointer(p)).FnColumn) { + if nEq >= libc.Int32FromUint16((*TIndex)(unsafe.Pointer(p)).FnColumn) { *(*TtRowcnt)(unsafe.Pointer(pnRow)) = uint64(1) return SQLITE_OK } @@ -144716,17 +138974,16 @@ func _whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uint var _ /* nEst at bp+0 */ TtRowcnt _, _, _, _, _, _ = i, nRecValid, nRow0, nRowEst, p, rc p = (*TWhereLoop)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew)).Fu.Fbtree.FpIndex - nRow0 = int64(_sqlite3LogEstToInt(tls, *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(p)).FaiRowLogEst)))) + nRow0 = libc.Int64FromUint64(_sqlite3LogEstToInt(tls, *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(p)).FaiRowLogEst)))) nRecValid = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid rc = SQLITE_OK /* Number of rows for a single term */ nRowEst = uint64(0) /* Loop counter */ - _ = libc.Int32FromInt32(0) i = 0 for { if !(rc == SQLITE_OK && i < (*TExprList)(unsafe.Pointer(pList)).FnExpr) { break } - *(*TtRowcnt)(unsafe.Pointer(bp)) = uint64(nRow0) + *(*TtRowcnt)(unsafe.Pointer(bp)) = libc.Uint64FromInt64(nRow0) rc = _whereEqualScanEst(tls, pParse, pBuilder, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr, bp) nRowEst += *(*TtRowcnt)(unsafe.Pointer(bp)) (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nRecValid @@ -144736,12 +138993,11 @@ func _whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uint i++ } if rc == SQLITE_OK { - if nRowEst > uint64(nRow0) { - nRowEst = uint64(nRow0) + if nRowEst > libc.Uint64FromInt64(nRow0) { + nRowEst = libc.Uint64FromInt64(nRow0) } *(*TtRowcnt)(unsafe.Pointer(pnRow)) = nRowEst } - _ = libc.Int32FromInt32(0) return rc } @@ -144754,7 +139010,7 @@ func _whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uint func _whereLoopInit(tls *libc.TLS, p uintptr) { (*TWhereLoop)(unsafe.Pointer(p)).FaLTerm = p + 60 (*TWhereLoop)(unsafe.Pointer(p)).FnLTerm = uint16(0) - (*TWhereLoop)(unsafe.Pointer(p)).FnLSlot = uint16(int32(libc.Uint32FromInt64(12) / libc.Uint32FromInt64(4))) + (*TWhereLoop)(unsafe.Pointer(p)).FnLSlot = libc.Uint16FromInt32(libc.Int32FromUint32(libc.Uint32FromInt64(12) / libc.Uint32FromInt64(4))) (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags = uint32(0) } @@ -144764,7 +139020,7 @@ func _whereLoopInit(tls *libc.TLS, p uintptr) { // ** Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact. // */ func _whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { - if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_VIRTUALTABLE)|libc.Int32FromInt32(WHERE_AUTO_INDEX)) != 0 { + if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_VIRTUALTABLE)|libc.Int32FromInt32(WHERE_AUTO_INDEX)) != 0 { if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(WHERE_VIRTUALTABLE) != uint32(0) && int32(Tu32(*(*uint8)(unsafe.Pointer(p + 24 + 4))&0x1>>0)) != 0 { Xsqlite3_free(tls, (*(*struct { FidxNum int32 @@ -144803,7 +139059,7 @@ func _whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { if (*TWhereLoop)(unsafe.Pointer(p)).FaLTerm != p+60 { _sqlite3DbFreeNN(tls, db, (*TWhereLoop)(unsafe.Pointer(p)).FaLTerm) (*TWhereLoop)(unsafe.Pointer(p)).FaLTerm = p + 60 - (*TWhereLoop)(unsafe.Pointer(p)).FnLSlot = uint16(int32(libc.Uint32FromInt64(12) / libc.Uint32FromInt64(4))) + (*TWhereLoop)(unsafe.Pointer(p)).FnLSlot = libc.Uint16FromInt32(libc.Int32FromUint32(libc.Uint32FromInt64(12) / libc.Uint32FromInt64(4))) } _whereLoopClearUnion(tls, db, p) (*TWhereLoop)(unsafe.Pointer(p)).FnLTerm = uint16(0) @@ -144818,11 +139074,11 @@ func _whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { func _whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) (r int32) { var paNew uintptr _ = paNew - if int32((*TWhereLoop)(unsafe.Pointer(p)).FnLSlot) >= n { + if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(p)).FnLSlot) >= n { return SQLITE_OK } n = (n + int32(7)) & ^libc.Int32FromInt32(7) - paNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*uint32(n))) + paNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(4)*libc.Uint32FromInt32(n))) if paNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -144831,7 +139087,7 @@ func _whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) (r int32) { _sqlite3DbFreeNN(tls, db, (*TWhereLoop)(unsafe.Pointer(p)).FaLTerm) } (*TWhereLoop)(unsafe.Pointer(p)).FaLTerm = paNew - (*TWhereLoop)(unsafe.Pointer(p)).FnLSlot = uint16(n) + (*TWhereLoop)(unsafe.Pointer(p)).FnLSlot = libc.Uint16FromInt32(n) return SQLITE_OK } @@ -144842,7 +139098,7 @@ func _whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) (r int32) { // */ func _whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) (r int32) { _whereLoopClearUnion(tls, db, pTo) - if int32((*TWhereLoop)(unsafe.Pointer(pFrom)).FnLTerm) > int32((*TWhereLoop)(unsafe.Pointer(pTo)).FnLSlot) && _whereLoopResize(tls, db, pTo, int32((*TWhereLoop)(unsafe.Pointer(pFrom)).FnLTerm)) != 0 { + if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pFrom)).FnLTerm) > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pTo)).FnLSlot) && _whereLoopResize(tls, db, pTo, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pFrom)).FnLTerm)) != 0 { libc.Xmemset(tls, pTo, 0, uint32(libc.UintptrFromInt32(0)+48)) return int32(SQLITE_NOMEM) } @@ -144864,7 +139120,6 @@ func _whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) (r in // ** Delete a WhereLoop object // */ func _whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) { - _ = libc.Int32FromInt32(0) _whereLoopClear(tls, db, p) _sqlite3DbNNFreeNN(tls, db, p) } @@ -144877,8 +139132,6 @@ func _whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) { func _whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { var p, pNext uintptr _, _ = p, pNext - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3WhereClauseClear(tls, pWInfo+76) for (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpLoops != 0 { p = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpLoops @@ -144926,18 +139179,16 @@ func _whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) (r int if int32((*TWhereLoop)(unsafe.Pointer(pX)).FrRun) > int32((*TWhereLoop)(unsafe.Pointer(pY)).FrRun) && int32((*TWhereLoop)(unsafe.Pointer(pX)).FnOut) > int32((*TWhereLoop)(unsafe.Pointer(pY)).FnOut) { return 0 } /* (1d) and (2a) */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TWhereLoop)(unsafe.Pointer(pX)).Fu.Fbtree.FnEq) < int32((*TWhereLoop)(unsafe.Pointer(pY)).Fu.Fbtree.FnEq) && (*TWhereLoop)(unsafe.Pointer(pX)).Fu.Fbtree.FpIndex == (*TWhereLoop)(unsafe.Pointer(pY)).Fu.Fbtree.FpIndex && int32((*TWhereLoop)(unsafe.Pointer(pX)).FnSkip) == 0 && int32((*TWhereLoop)(unsafe.Pointer(pY)).FnSkip) == 0 { + if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).Fu.Fbtree.FnEq) < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).Fu.Fbtree.FnEq) && (*TWhereLoop)(unsafe.Pointer(pX)).Fu.Fbtree.FpIndex == (*TWhereLoop)(unsafe.Pointer(pY)).Fu.Fbtree.FpIndex && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).FnSkip) == 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).FnSkip) == 0 { return int32(1) /* Case 1 is true */ } - if int32((*TWhereLoop)(unsafe.Pointer(pX)).FnLTerm)-int32((*TWhereLoop)(unsafe.Pointer(pX)).FnSkip) >= int32((*TWhereLoop)(unsafe.Pointer(pY)).FnLTerm)-int32((*TWhereLoop)(unsafe.Pointer(pY)).FnSkip) { + if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).FnLTerm)-libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).FnSkip) >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).FnLTerm)-libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).FnSkip) { return 0 /* (2b) */ } - if int32((*TWhereLoop)(unsafe.Pointer(pY)).FnSkip) > int32((*TWhereLoop)(unsafe.Pointer(pX)).FnSkip) { + if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).FnSkip) > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).FnSkip) { return 0 } /* (2d) */ - i = int32((*TWhereLoop)(unsafe.Pointer(pX)).FnLTerm) - int32(1) + i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).FnLTerm) - int32(1) for { if !(i >= 0) { break @@ -144945,7 +139196,7 @@ func _whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) (r int if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pX)).FaLTerm + uintptr(i)*4)) == uintptr(0) { goto _1 } - j = int32((*TWhereLoop)(unsafe.Pointer(pY)).FnLTerm) - int32(1) + j = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).FnLTerm) - int32(1) for { if !(j >= 0) { break @@ -144998,7 +139249,7 @@ func _whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { if !(p != 0) { break } - if int32((*TWhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*TWhereLoop)(unsafe.Pointer(pTemplate)).FiTab) { + if libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(p)).FiTab) != libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(pTemplate)).FiTab) { goto _1 } if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(WHERE_INDEXED) == uint32(0) { @@ -145068,7 +139319,7 @@ func _whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) (r u if !(p != 0) { break } - if int32((*TWhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*TWhereLoop)(unsafe.Pointer(pTemplate)).FiTab) || int32((*TWhereLoop)(unsafe.Pointer(p)).FiSortIdx) != int32((*TWhereLoop)(unsafe.Pointer(pTemplate)).FiSortIdx) { + if libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(p)).FiTab) != libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(pTemplate)).FiTab) || libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(p)).FiSortIdx) != libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(pTemplate)).FiSortIdx) { /* If either the iTab or iSortIdx values for two WhereLoop are different ** then those WhereLoops need to be considered separately. Neither is ** a candidate to replace the other. */ @@ -145077,15 +139328,13 @@ func _whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) (r u /* In the current implementation, the rSetup value is either zero ** or the cost of building an automatic index (NlogN) and the NlogN ** is the same for compatible WhereLoops. */ - _ = libc.Int32FromInt32(0) /* whereLoopAddBtree() always generates and inserts the automatic index ** case first. Hence compatible candidate WhereLoops never have a larger ** rSetup. Call this SETUP-INVARIANT */ - _ = libc.Int32FromInt32(0) /* Any loop using an application-defined index (or PRIMARY KEY or ** UNIQUE constraint) with one or more == constraints is better ** than an automatic index. Unless it is a skip-scan. */ - if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(WHERE_AUTO_INDEX) != uint32(0) && int32((*TWhereLoop)(unsafe.Pointer(pTemplate)).FnSkip) == 0 && (*TWhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&uint32(WHERE_INDEXED) != uint32(0) && (*TWhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&uint32(WHERE_COLUMN_EQ) != uint32(0) && (*TWhereLoop)(unsafe.Pointer(p)).Fprereq&(*TWhereLoop)(unsafe.Pointer(pTemplate)).Fprereq == (*TWhereLoop)(unsafe.Pointer(pTemplate)).Fprereq { + if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(WHERE_AUTO_INDEX) != uint32(0) && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pTemplate)).FnSkip) == 0 && (*TWhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&uint32(WHERE_INDEXED) != uint32(0) && (*TWhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&uint32(WHERE_COLUMN_EQ) != uint32(0) && (*TWhereLoop)(unsafe.Pointer(p)).Fprereq&(*TWhereLoop)(unsafe.Pointer(pTemplate)).Fprereq == (*TWhereLoop)(unsafe.Pointer(pTemplate)).Fprereq { break } /* If existing WhereLoop p is better than pTemplate, pTemplate can be @@ -145102,8 +139351,8 @@ func _whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) (r u ** (2) pTemplate has an equal or lower cost than p. */ if (*TWhereLoop)(unsafe.Pointer(p)).Fprereq&(*TWhereLoop)(unsafe.Pointer(pTemplate)).Fprereq == (*TWhereLoop)(unsafe.Pointer(pTemplate)).Fprereq && int32((*TWhereLoop)(unsafe.Pointer(p)).FrRun) >= int32((*TWhereLoop)(unsafe.Pointer(pTemplate)).FrRun) && int32((*TWhereLoop)(unsafe.Pointer(p)).FnOut) >= int32((*TWhereLoop)(unsafe.Pointer(pTemplate)).FnOut) { - _ = libc.Int32FromInt32(0) /* SETUP-INVARIANT above */ - break /* Cause p to be overwritten by pTemplate */ + /* SETUP-INVARIANT above */ + break /* Cause p to be overwritten by pTemplate */ } goto _1 _1: @@ -145258,24 +139507,22 @@ func _whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow TLog _, _, _, _, _, _, _, _, _ = i, iReduce, j, notAllowed, pRight, pTerm, pX, p3, p4 notAllowed = ^((*TWhereLoop)(unsafe.Pointer(pLoop)).Fprereq | (*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) iReduce = 0 /* pLoop->nOut should not exceed nRow-iReduce */ - _ = libc.Int32FromInt32(0) i = (*TWhereClause)(unsafe.Pointer(pWC)).FnBase pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa for { if !(i > 0) { break } - _ = libc.Int32FromInt32(0) if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll¬Allowed != uint64(0) { goto _1 } if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf == uint64(0) { goto _1 } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VIRTUAL) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VIRTUAL) != 0 { goto _1 } - j = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) - int32(1) + j = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) - int32(1) for { if !(j >= 0) { break @@ -145307,7 +139554,7 @@ func _whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow TLog ** are straight comparison operators that are non-true with NULL ** operand, or if the loop is not an OUTER JOIN. */ - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(0x3f) != 0 || int32((*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*68))).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(0x3f) != 0 || libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*68))).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) == 0 { *(*Tu32)(unsafe.Pointer(pLoop + 40)) |= uint32(WHERE_SELFCULL) } } @@ -145320,7 +139567,7 @@ func _whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow TLog /* In the absence of explicit truth probabilities, use heuristics to ** guess a reasonable truth probability. */ (*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut-- - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_HIGHTRUTH) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_HIGHTRUTH) == 0 { pRight = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight *(*int32)(unsafe.Pointer(bp)) = 0 if _sqlite3ExprIsInteger(tls, pRight, bp) != 0 && *(*int32)(unsafe.Pointer(bp)) >= -int32(1) && *(*int32)(unsafe.Pointer(bp)) <= int32(1) { @@ -145372,10 +139619,10 @@ func _whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintpt var pColl, pLhs, pRhs uintptr _, _, _, _, _, _, _, _ = aff, i, idxaff, nCmp, pColl, pLhs, pRhs, v1 nCmp = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft) - if nCmp < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)-nEq { + if nCmp < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)-nEq { v1 = nCmp } else { - v1 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) - nEq + v1 = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) - nEq } nCmp = v1 i = int32(1) @@ -145384,7 +139631,6 @@ func _whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintpt break } /* Comparison affinity */ idxaff = 0 - _ = libc.Int32FromInt32(0) pLhs = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft + 20)) + 8 + uintptr(i)*20))).FpExpr pRhs = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight if (*TExpr)(unsafe.Pointer(pRhs)).Fflags&uint32(EP_xIsSelect) != uint32(0) { @@ -145396,7 +139642,7 @@ func _whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintpt ** the right column of the right source table. And that the sort ** order of the index column is the same as the sort order of the ** leftmost index column. */ - if int32((*TExpr)(unsafe.Pointer(pLhs)).Fop) != int32(TK_COLUMN) || (*TExpr)(unsafe.Pointer(pLhs)).FiTable != iCur || int32((*TExpr)(unsafe.Pointer(pLhs)).FiColumn) != int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i+nEq)*2))) || int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i+nEq)))) != int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLhs)).Fop) != int32(TK_COLUMN) || (*TExpr)(unsafe.Pointer(pLhs)).FiTable != iCur || int32((*TExpr)(unsafe.Pointer(pLhs)).FiColumn) != int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i+nEq)*2))) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i+nEq)))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) { break } aff = _sqlite3CompareAffinity(tls, pRhs, _sqlite3ExprAffinity(tls, pLhs)) @@ -145458,16 +139704,12 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro pTop = uintptr(0) pBtm = uintptr(0) /* Top and bottom range constraints */ pNew = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return (*TParse)(unsafe.Pointer(pParse)).Frc } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_BTM_LIMIT) != 0 { opMask = libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) } else { - _ = libc.Int32FromInt32(0) opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 { @@ -145478,8 +139720,6 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) } } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) saved_nEq = (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq saved_nBtm = (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm saved_nTop = (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop @@ -145488,7 +139728,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro saved_wsFlags = (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags saved_prereq = (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq saved_nOut = (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut - pTerm = _whereScanInit(tls, bp, (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor, int32(saved_nEq), uint32(opMask), pProbe) + pTerm = _whereScanInit(tls, bp, (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor, libc.Int32FromUint16(saved_nEq), libc.Uint32FromInt32(opMask), pProbe) (*TWhereLoop)(unsafe.Pointer(pNew)).FrSetup = 0 rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) rLogSize = _estLog(tls, rSize) @@ -145499,7 +139739,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro eOp = (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator /* nOut before IN() and WHERE adjustments */ nIn = 0 nRecValid = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid - if (int32(eOp) == int32(WO_ISNULL) || int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) != 0) && _indexColumnNotNull(tls, pProbe, int32(saved_nEq)) != 0 { + if (libc.Int32FromUint16(eOp) == int32(WO_ISNULL) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) != 0) && _indexColumnNotNull(tls, pProbe, libc.Int32FromUint16(saved_nEq)) != 0 { goto _1 /* ignore IS [NOT] NULL constraints on NOT NULL columns */ } if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&(*TWhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != 0 { @@ -145507,13 +139747,13 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } /* Do not allow the upper bound of a LIKE optimization range constraint ** to mix with a lower range bound from some other source */ - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKEOPT) != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKEOPT) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) { goto _1 } - if int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 && !(_constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 && !(_constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) { goto _1 } - if int32((*TIndex)(unsafe.Pointer(pProbe)).FonError) != OE_None && int32(saved_nEq) == int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol)-int32(1) { + if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pProbe)).FonError) != OE_None && libc.Int32FromUint16(saved_nEq) == libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol)-int32(1) { p2 = pBuilder + 24 *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(SQLITE_BLDF1_UNIQUE)) } else { @@ -145525,7 +139765,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm = saved_nBtm (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = saved_nTop (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = saved_nLTerm - if int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm) >= int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLSlot) && _whereLoopResize(tls, db, pNew, int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+int32(1)) != 0 { + if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm) >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLSlot) && _whereLoopResize(tls, db, pNew, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+int32(1)) != 0 { break /* OOM while trying to enlarge the pNew->aLTerm array */ } v5 = pNew + 44 @@ -145533,12 +139773,10 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*Tu16)(unsafe.Pointer(v5))++ *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(v4)*4)) = pTerm (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq = (saved_prereq | (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) & ^(*TWhereLoop)(unsafe.Pointer(pNew)).FmaskSelf - _ = libc.Int32FromInt32(0) - if int32(eOp)&int32(WO_IN) != 0 { + if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nIn = int32(46) - _ = libc.Int32FromInt32(0) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). ** However, the nIn multiplier should only be applied once, not once @@ -145546,7 +139784,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro ** first such term in use, and sets nIn back to 0 if it is not. */ i = 0 for { - if !(i < int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-int32(1)) { + if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-int32(1)) { break } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)))).FpExpr == pExpr { @@ -145560,7 +139798,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ - nIn = int32(_sqlite3LogEst(tls, uint64((*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr))) + nIn = int32(_sqlite3LogEst(tls, libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr))) } } if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x80>>7)) != 0 && int32(rLogSize) >= int32(10) { @@ -145590,7 +139828,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro x = int16(int32(M) + int32(logK) + int32(10) - (nIn + int32(rLogSize))) if int32(x) >= 0 { } else { - if int32(nInMul) < int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_SeekScan)) == uint32(0) { + if int32(nInMul) < int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_SeekScan)) == uint32(0) { *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(WHERE_IN_SEEKSCAN) } else { goto _1 @@ -145599,38 +139837,34 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(WHERE_COLUMN_IN) } else { - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 { + if libc.Int32FromUint16(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 { iCol = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(WHERE_COLUMN_EQ) - _ = libc.Int32FromInt32(0) - if iCol == -int32(1) || iCol >= 0 && int32(nInMul) == 0 && int32(saved_nEq) == int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol)-int32(1) { - if iCol == -int32(1) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x8>>3)) != 0 || int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) == int32(1) && (*TIndex)(unsafe.Pointer(pProbe)).FonError != 0 && int32(eOp) == int32(WO_EQ) { + if iCol == -int32(1) || iCol >= 0 && int32(nInMul) == 0 && libc.Int32FromUint16(saved_nEq) == libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol)-int32(1) { + if iCol == -int32(1) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x8>>3)) != 0 || libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) == int32(1) && (*TIndex)(unsafe.Pointer(pProbe)).FonError != 0 && libc.Int32FromUint16(eOp) == int32(WO_EQ) { *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(WHERE_ONEROW) } else { *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(WHERE_UNQ_WANTED) } } - if int32((*(*TWhereScan)(unsafe.Pointer(bp))).FiEquiv) > int32(1) { + if libc.Int32FromUint8((*(*TWhereScan)(unsafe.Pointer(bp))).FiEquiv) > int32(1) { *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(WHERE_TRANSCONS) } } else { - if int32(eOp)&int32(WO_ISNULL) != 0 { + if libc.Int32FromUint16(eOp)&int32(WO_ISNULL) != 0 { *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(WHERE_COLUMN_NULL) } else { - nVecLen = _whereRangeVectorLen(tls, pParse, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm) - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0 { - *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(libc.Int32FromInt32(WHERE_COLUMN_RANGE) | libc.Int32FromInt32(WHERE_BTM_LIMIT)) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm = uint16(nVecLen) + nVecLen = _whereRangeVectorLen(tls, pParse, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, libc.Int32FromUint16(saved_nEq), pTerm) + if libc.Int32FromUint16(eOp)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0 { + *(*Tu32)(unsafe.Pointer(pNew + 40)) |= libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_RANGE) | libc.Int32FromInt32(WHERE_BTM_LIMIT)) + (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm = libc.Uint16FromInt32(nVecLen) pBtm = pTerm pTop = uintptr(0) - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKEOPT) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKEOPT) != 0 { /* Range constraints that come from the LIKE optimization are ** always used in pairs. */ pTop = pTerm + 1*48 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if _whereLoopResize(tls, db, pNew, int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+int32(1)) != 0 { + if _whereLoopResize(tls, db, pNew, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+int32(1)) != 0 { break } /* OOM */ v8 = pNew + 44 @@ -145641,12 +139875,11 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = uint16(1) } } else { - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(libc.Int32FromInt32(WHERE_COLUMN_RANGE) | libc.Int32FromInt32(WHERE_TOP_LIMIT)) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = uint16(nVecLen) + *(*Tu32)(unsafe.Pointer(pNew + 40)) |= libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_RANGE) | libc.Int32FromInt32(WHERE_TOP_LIMIT)) + (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = libc.Uint16FromInt32(nVecLen) pTop = pTerm if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_BTM_LIMIT) != uint32(0) { - v9 = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-int32(2))*4)) + v9 = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-int32(2))*4)) } else { v9 = uintptr(0) } @@ -145660,7 +139893,6 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro ** values of nIn and nInMul. In other words, assuming that all ** "x IN(...)" terms are replaced with "x = ?". This block updates ** the value of pNew->nOut to account for pTerm (but not nIn/nInMul). */ - _ = libc.Int32FromInt32(0) if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_COLUMN_RANGE) != 0 { /* Adjust nOut using stat4 data. Or, if there is no stat4 ** data, using some other estimate. */ @@ -145669,20 +139901,17 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro v11 = pNew + 24 *(*Tu16)(unsafe.Pointer(v11))++ v10 = *(*Tu16)(unsafe.Pointer(v11)) - nEq = int32(v10) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + nEq = libc.Int32FromUint16(v10) if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 && int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) >= 0 { - _ = libc.Int32FromInt32(0) p12 = pNew + 22 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FtruthProb)) p13 = pNew + 22 *(*TLogEst)(unsafe.Pointer(p13)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p13))) - nIn) } else { *(*TtRowcnt)(unsafe.Pointer(bp + 96)) = uint64(0) - if int32(nInMul) == 0 && (*TIndex)(unsafe.Pointer(pProbe)).FnSample != 0 && int32((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) <= (*TIndex)(unsafe.Pointer(pProbe)).FnSampleCol && (int32(eOp)&int32(WO_IN) == 0 || (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(EP_xIsSelect) == uint32(0)) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { + if int32(nInMul) == 0 && (*TIndex)(unsafe.Pointer(pProbe)).FnSample != 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) <= (*TIndex)(unsafe.Pointer(pProbe)).FnSampleCol && (libc.Int32FromUint16(eOp)&int32(WO_IN) == 0 || (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(EP_xIsSelect) == uint32(0)) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { pExpr1 = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { + if libc.Int32FromUint16(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { rc = _whereEqualScanEst(tls, pParse, pBuilder, (*TExpr)(unsafe.Pointer(pExpr1)).FpRight, bp+96) } else { rc = _whereInScanEst(tls, pParse, pBuilder, *(*uintptr)(unsafe.Pointer(pExpr1 + 20)), bp+96) @@ -145698,7 +139927,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if nEq == int32(1) && int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnOut)+int32(10) > int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst))) { p14 = pTerm + 10 *(*Tu16)(unsafe.Pointer(p14)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p14))) | libc.Int32FromInt32(TERM_HIGHTRUTH)) - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_HEURTRUTH) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_HEURTRUTH) != 0 { /* If the term has previously been used with an assumption of ** higher selectivity, then set the flag to rerun the ** loop computations. */ @@ -145716,7 +139945,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if *(*TtRowcnt)(unsafe.Pointer(bp + 96)) == uint64(0) { p17 = pNew + 22 *(*TLogEst)(unsafe.Pointer(p17)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p17))) + (int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq)*2))) - int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq-int32(1))*2))))) - if int32(eOp)&int32(WO_ISNULL) != 0 { + if libc.Int32FromUint16(eOp)&int32(WO_ISNULL) != 0 { /* TUNING: If there is no likelihood() value, assume that a ** "col IS NULL" expression matches twice as many rows ** as (col=?). */ @@ -145733,7 +139962,6 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro ** 2. Stepping forward in the index pNew->nOut times to find all ** additional matching entries. */ - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_IPK) { /* The pProbe->szIdxRow is low for an IPK table since the interior ** pages are small. Thus szIdxRow gives a good estimate of seek cost. @@ -145751,7 +139979,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro ** locate the row in the main table that corresponds to the index entry. */ (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = rCostIdx - if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_EXPRIDX)) == uint32(0) { + if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_EXPRIDX)) == uint32(0) { (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = _sqlite3LogEstAdd(tls, (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun, int16(int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnOut)+int32(16))) } nOutUnadjusted = (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut @@ -145766,8 +139994,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = nOutUnadjusted } - if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_TOP_LIMIT) == uint32(0) && int32((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) < int32((*TIndex)(unsafe.Pointer(pProbe)).FnColumn) && (int32((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) < int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { - if int32((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) > int32(3) { + if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_TOP_LIMIT) == uint32(0) && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnColumn) && (libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) > int32(3) { _sqlite3ProgressCheck(tls, pParse) } _whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(nInMul)+nIn)) @@ -145797,9 +140025,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro ** the code). And, even if it is not, it should not be too much slower. ** On the other hand, the extra seeks could end up being significantly ** more expensive. */ - _ = libc.Int32FromInt32(0) - if v22 = int32(saved_nEq) == int32(saved_nSkip) && int32(saved_nEq)+int32(1) < int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) && int32(saved_nEq) == int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm) && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x40>>6)) == 0 && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x80>>7)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_SkipScan)) == uint32(0) && int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(saved_nEq)+int32(1))*2))) >= int32(42); v22 { - v21 = _whereLoopResize(tls, db, pNew, int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+int32(1)) + if v22 = libc.Int32FromUint16(saved_nEq) == libc.Int32FromUint16(saved_nSkip) && libc.Int32FromUint16(saved_nEq)+int32(1) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) && libc.Int32FromUint16(saved_nEq) == libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm) && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x40>>6)) == 0 && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x80>>7)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_SkipScan)) == uint32(0) && int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(libc.Int32FromUint16(saved_nEq)+int32(1))*2))) >= int32(42); v22 { + v21 = _whereLoopResize(tls, db, pNew, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+int32(1)) rc = v21 } if v22 && v21 == SQLITE_OK { @@ -145810,7 +140037,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*Tu16)(unsafe.Pointer(v24))++ *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(v23)*4)) = uintptr(0) *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(WHERE_SKIPSCAN) - nIter = int16(int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(saved_nEq)+int32(1))*2)))) + nIter = int16(int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(libc.Int32FromUint16(saved_nEq)+int32(1))*2)))) p25 = pNew + 22 *(*TLogEst)(unsafe.Pointer(p25)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p25))) - int32(nIter)) /* TUNING: Because uncertainties in the estimates for skip-scan queries, @@ -145856,13 +140083,13 @@ func _indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, if pExpr == uintptr(0) { goto _2 } - if (int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_COLUMN)) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == iCursor { + if (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_COLUMN)) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == iCursor { if int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { return int32(1) } jj = 0 for { - if !(jj < int32((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol)) { + if !(jj < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol)) { break } if int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(jj)*2))) { @@ -145879,7 +140106,7 @@ func _indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, if v4 != uintptr(0) { jj = 0 for { - if !(jj < int32((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol)) { + if !(jj < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol)) { break } if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(jj)*2))) != -int32(2) { @@ -145912,11 +140139,11 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp var i int32 var pExpr, pParse, pTerm uintptr _, _, _, _ = i, pExpr, pParse, pTerm - if int32(jointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8(jointype)&int32(JT_LTORJ) != 0 { return 0 } pParse = (*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse - for int32((*TExpr)(unsafe.Pointer(pWhere)).Fop) == int32(TK_AND) { + for libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pWhere)).Fop) == int32(TK_AND) { if !(_whereUsablePartialIndex(tls, iTab, jointype, pWC, (*TExpr)(unsafe.Pointer(pWhere)).FpLeft) != 0) { return 0 } @@ -145932,7 +140159,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 36)) == iTab) && (int32(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 36)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -145955,7 +140182,7 @@ func _exprIsCoveredByIndex(tls *libc.TLS, pExpr uintptr, pIdx uintptr, iTabCur i _ = i i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) == -int32(2) && _sqlite3ExprCompare(tls, uintptr(0), pExpr, (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(i)*20))).FpExpr, iTabCur) == 0 { @@ -146018,7 +140245,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp _, _, _, _, _ = aiColumn, i, nColumn, pCk, pIdx /* Info about this search */ pCk = *(*uintptr)(unsafe.Pointer(pWalk + 24)) pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FpIdx - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) || int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_COLUMN) { /* if( pExpr->iColumn<(BMS-1) && pIdx->bHasExpr==0 ) return WRC_Continue;*/ if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue @@ -146028,7 +140255,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 for { - if !(i < int32(nColumn)) { + if !(i < libc.Int32FromUint16(nColumn)) { break } if int32(*(*Ti16)(unsafe.Pointer(aiColumn + uintptr(i)*2))) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { @@ -146090,10 +140317,10 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x1000>>12)) == 0 { i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) >= int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { + if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) >= libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { break } goto _1 @@ -146101,7 +140328,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ; i++ } - if i >= int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) { + if i >= libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) { /* pIdx does not index any columns greater than 62, but we know from ** colMask that columns greater than 62 are used, so this is not a ** covering index */ @@ -146126,7 +140353,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur rc = int32(WHERE_IDX_ONLY) } } - return uint32(rc) + return libc.Uint32FromInt32(rc) } // C documentation @@ -146181,16 +140408,14 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt var bNullRow int32 var db, p, pArg, pLeft, pRight uintptr _, _, _, _, _, _, _ = aff, bNullRow, db, p, pArg, pLeft, pRight - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TExpr)(unsafe.Pointer(pPart)).Fop) == int32(TK_AND) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pPart)).Fop) == int32(TK_AND) { _wherePartIdxExpr(tls, pParse, pIdx, (*TExpr)(unsafe.Pointer(pPart)).FpRight, pMask, iIdxCur, pItem) pPart = (*TExpr)(unsafe.Pointer(pPart)).FpLeft } - if int32((*TExpr)(unsafe.Pointer(pPart)).Fop) == int32(TK_EQ) || int32((*TExpr)(unsafe.Pointer(pPart)).Fop) == int32(TK_IS) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pPart)).Fop) == int32(TK_EQ) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pPart)).Fop) == int32(TK_IS) { pLeft = (*TExpr)(unsafe.Pointer(pPart)).FpLeft pRight = (*TExpr)(unsafe.Pointer(pPart)).FpRight - if int32((*TExpr)(unsafe.Pointer(pLeft)).Fop) != int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) != int32(TK_COLUMN) { return } if !(_sqlite3ExprIsConstant(tls, uintptr(0), pRight) != 0) { @@ -146202,18 +140427,18 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt if int32((*TExpr)(unsafe.Pointer(pLeft)).FiColumn) < 0 { return } - aff = uint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pLeft)).FiColumn)*12))).Faffinity) - if int32(aff) >= int32(SQLITE_AFF_TEXT) { + aff = libc.Uint8FromInt8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pLeft)).FiColumn)*12))).Faffinity) + if libc.Int32FromUint8(aff) >= int32(SQLITE_AFF_TEXT) { if pItem != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb p = _sqlite3DbMallocRaw(tls, db, uint64(24)) if p != 0 { - bNullRow = libc.BoolInt32(int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0) + bNullRow = libc.BoolInt32(libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0) (*TIndexedExpr)(unsafe.Pointer(p)).FpExpr = _sqlite3ExprDup(tls, db, pRight, 0) (*TIndexedExpr)(unsafe.Pointer(p)).FiDataCur = (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur = iIdxCur (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCol = int32((*TExpr)(unsafe.Pointer(pLeft)).FiColumn) - (*TIndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow = uint8(bNullRow) + (*TIndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow = libc.Uint8FromInt32(bNullRow) (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext = (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p @@ -146223,7 +140448,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt } } } else { - if int32((*TExpr)(unsafe.Pointer(pLeft)).FiColumn) < int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { + if int32((*TExpr)(unsafe.Pointer(pLeft)).FiColumn) < libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { *(*TBitmask)(unsafe.Pointer(pMask)) &= ^(libc.Uint64FromInt32(1) << (*TExpr)(unsafe.Pointer(pLeft)).FiColumn) } } @@ -146290,9 +140515,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in pSrc = pTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*68 pTab = (*TSrcItem)(unsafe.Pointer(pSrc)).FpTab pWC = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x2>>1)) != 0 { - _ = libc.Int32FromInt32(0) /* An INDEXED BY clause specifies a particular index to use */ pProbe = *(*uintptr)(unsafe.Pointer(pSrc + 64)) } else { @@ -146321,7 +140544,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in } rSize = (*TTable)(unsafe.Pointer(pTab)).FnRowLogEst /* Automatic indexes */ - if !((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet != 0) && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_RIGHT_JOIN)|libc.Int32FromInt32(WHERE_OR_SUBCLAUSE)) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags&uint64(SQLITE_AutoIndex) != uint64(0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x2>>1)) != 0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x1>>0)) != 0) && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x8>>3)) != 0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x40>>6)) != 0) && int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + if !((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet != 0) && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_RIGHT_JOIN)|libc.Int32FromInt32(WHERE_OR_SUBCLAUSE)) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags&uint64(SQLITE_AutoIndex) != uint64(0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x2>>1)) != 0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x1>>0)) != 0) && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x8>>3)) != 0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x40>>6)) != 0) && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { pWCEnd = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*TWhereClause)(unsafe.Pointer(pWC)).FnTerm)*48 rLogSize = _estLog(tls, rSize) pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -146347,7 +140570,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in ** those objects, since there is no opportunity to add schema ** indexes on subqueries and views. */ (*TWhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(int32(rLogSize) + int32(rSize)) - if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Ephemeral) == uint32(0) { + if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Ephemeral) == uint32(0) { p2 = pNew + 18 *(*TLogEst)(unsafe.Pointer(p2)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p2))) + libc.Int32FromInt32(28)) } else { @@ -146363,7 +140586,6 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in ** of knowing how selective the index will ultimately be. It would ** not be unreasonable to make this value much larger. */ (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = int16(43) - _ = libc.Int32FromInt32(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = _sqlite3LogEstAdd(tls, rLogSize, (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut) (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_AUTO_INDEX) (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq | (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight @@ -146401,7 +140623,6 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FpIndex = pProbe b = _indexMightHelpWithOrderBy(tls, pBuilder, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) /* The ONEPASS_DESIRED flags never occurs together with ORDER BY */ - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_IPK) { /* Integer primary key index */ (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_IPK) @@ -146411,7 +140632,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in } else { v5 = 0 } - (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(v5) + (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = libc.Uint8FromInt32(v5) /* TUNING: Cost of full table scan is 3.0*N. The 3.0 factor is an ** extra cost designed to discourage the use of full table scans, ** since index lookups have better worst-case performance if our @@ -146434,39 +140655,37 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in } else { if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x20>>5)) != 0 { *(*TBitmask)(unsafe.Pointer(bp + 112)) = uint64(0) - (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(libc.Int32FromInt32(WHERE_IDX_ONLY) | libc.Int32FromInt32(WHERE_INDEXED)) + (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY) | libc.Int32FromInt32(WHERE_INDEXED)) } else { *(*TBitmask)(unsafe.Pointer(bp + 112)) = (*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (*TIndex)(unsafe.Pointer(pProbe)).FcolNotIdxed if (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere != 0 { _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+112, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 112)) == libc.Uint64FromInt32(1)<<(int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 112)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 112)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 112)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { - _ = libc.Int32FromInt32(0) } else { *(*TBitmask)(unsafe.Pointer(bp + 112)) = uint64(0) *(*Tu32)(unsafe.Pointer(pNew + 40)) |= isCov if isCov&uint32(WHERE_IDX_ONLY) != 0 { } else { - _ = libc.Int32FromInt32(0) } } } else { - if *(*TBitmask)(unsafe.Pointer(bp + 112)) == uint64(0) { - (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(libc.Int32FromInt32(WHERE_IDX_ONLY) | libc.Int32FromInt32(WHERE_INDEXED)) + if *(*TBitmask)(unsafe.Pointer(bp + 112)) == uint64(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != uintptr(0) || _sqlite3FaultSim(tls, int32(700)) != 0) { + (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY) | libc.Int32FromInt32(WHERE_INDEXED)) } } } /* Full scan via index */ - if b != 0 || !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) || (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0) || int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x2>>1)) != 0 || *(*TBitmask)(unsafe.Pointer(bp + 112)) == uint64(0) && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab)).FszTabRow) && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_ONEPASS_DESIRED) == 0 && _sqlite3Config.FbUseCis != 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_CoverIdxScan)) == uint32(0) { + if b != 0 || !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) || (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0) || int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x2>>1)) != 0 || *(*TBitmask)(unsafe.Pointer(bp + 112)) == uint64(0) && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab)).FszTabRow) && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_ONEPASS_DESIRED) == 0 && _sqlite3Config.FbUseCis != 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_CoverIdxScan)) == uint32(0) { if b != 0 { v6 = iSortIdx } else { v6 = 0 } - (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(v6) + (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = libc.Uint8FromInt32(v6) /* The cost of visiting the index rows is N*K, where K is ** between 1.1 and 3.0, depending on the relative sizes of the ** index and table rows. */ @@ -146495,7 +140714,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in nLookup = TLogEst(int32(nLookup) + int32((*TWhereTerm)(unsafe.Pointer(pTerm1)).FtruthProb)) } else { nLookup-- - if int32((*TWhereTerm)(unsafe.Pointer(pTerm1)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm1)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 { nLookup = TLogEst(int32(nLookup) - libc.Int32FromInt32(19)) } } @@ -146507,7 +140726,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = _sqlite3LogEstAdd(tls, (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun, nLookup) } _whereLoopOutputAdjust(tls, pWC, pNew, rSize) - if int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 && (*TIndex)(unsafe.Pointer(pProbe)).FaColExpr != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 && (*TIndex)(unsafe.Pointer(pProbe)).FaColExpr != 0 { /* Do not do an SCAN of a index-on-expression in a RIGHT JOIN ** because the cursor used to access the index might not be ** positioned to the correct row during the right-join no-match @@ -146523,7 +140742,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in } (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FbldFlags1 = uint8(0) rc = _whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, 0) - if int32((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FbldFlags1) == int32(SQLITE_BLDF1_INDEXED) { + if libc.Int32FromUint8((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FbldFlags1) == int32(SQLITE_BLDF1_INDEXED) { /* If a non-unique index is used, or if a prefix of the key for ** unique index is used (making the index functionally non-unique) ** then the sqlite_stat1 data becomes important for scoring the @@ -146553,8 +140772,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in // ** Return true if pTerm is a virtual table LIMIT or OFFSET term. // */ func _isLimitTerm(tls *libc.TLS, pTerm uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - return libc.BoolInt32(int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) >= int32(SQLITE_INDEX_CONSTRAINT_LIMIT) && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) <= int32(SQLITE_INDEX_CONSTRAINT_OFFSET)) + return libc.BoolInt32(libc.Int32FromUint8((*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) >= int32(SQLITE_INDEX_CONSTRAINT_LIMIT) && libc.Int32FromUint8((*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) <= int32(SQLITE_INDEX_CONSTRAINT_OFFSET)) } // C documentation @@ -146619,7 +140837,6 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pParse = (*TWhereInfo)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpParse pSrc = (*TWhereInfo)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*68 nConstraint = (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pbIn)) = 0 (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq /* Set the usable flag on the subset of constraints identified by @@ -146632,7 +140849,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, } pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*48 (*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(0) - if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUsable == (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(mExclude) == 0 && (pbRetryLimit != 0 || !(_isLimitTerm(tls, pTerm) != 0)) { + if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUsable == (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&libc.Int32FromUint16(mExclude) == 0 && (pbRetryLimit != 0 || !(_isLimitTerm(tls, pTerm) != 0)) { (*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(1) } goto _1 @@ -146642,15 +140859,14 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pIdxCons += 12 } /* Initialize the output fields of the sqlite3_index_info structure */ - libc.Xmemset(tls, pUsage, 0, uint32(8)*uint32(nConstraint)) - _ = libc.Int32FromInt32(0) + libc.Xmemset(tls, pUsage, 0, uint32(8)*libc.Uint32FromInt32(nConstraint)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = uintptr(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 0 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 0 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(1e+99) / libc.Float64FromInt32(2) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(25) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = 0 - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = uint64(int64((*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed)) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = libc.Uint64FromInt64(libc.Int64FromUint64((*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed)) (*THiddenIndexInfo)(unsafe.Pointer(pHidden)).FmHandleIn = uint32(0) /* Invoke the virtual table xBestIndex() method */ rc = _vtabBestIndex(tls, pParse, (*TSrcItem)(unsafe.Pointer(pSrc)).FpTab, pIdxInfo) @@ -146665,8 +140881,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, return rc } mxTerm = -int32(1) - _ = libc.Int32FromInt32(0) - libc.Xmemset(tls, (*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm, 0, uint32(4)*uint32(nConstraint)) + libc.Xmemset(tls, (*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm, 0, uint32(4)*libc.Uint32FromInt32(nConstraint)) libc.Xmemset(tls, pNew+24, 0, uint32(16)) pIdxCons = *(*uintptr)(unsafe.Pointer(pIdxInfo + 4)) i = 0 @@ -146678,24 +140893,23 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, iTerm = v3 if v3 >= 0 { j = (*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset - if iTerm >= nConstraint || j < 0 || j >= (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*4)) != uintptr(0) || int32((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { + if iTerm >= nConstraint || j < 0 || j >= (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*4)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22576, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName)) return int32(SQLITE_ERROR) } pTerm1 = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(j)*48 *(*TBitmask)(unsafe.Pointer(pNew)) |= (*TWhereTerm)(unsafe.Pointer(pTerm1)).FprereqRight - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*4)) = pTerm1 if iTerm > mxTerm { mxTerm = iTerm } if (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer(pUsage + uintptr(i)*8))).Fomit != 0 { - if i < int32(16) && int32(1)<<i&int32(mNoOmit) == 0 { + if i < int32(16) && int32(1)<<i&libc.Int32FromUint16(mNoOmit) == 0 { p4 = pNew + 24 + 6 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(1)<<iTerm) } else { } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm1)).FeMatchOp) == int32(SQLITE_INDEX_CONSTRAINT_OFFSET) { + if libc.Int32FromUint8((*TWhereTerm)(unsafe.Pointer(pTerm1)).FeMatchOp) == int32(SQLITE_INDEX_CONSTRAINT_OFFSET) { libc.SetBitFieldPtr8Uint32(pNew+24+4, libc.Uint32FromInt32(1), 1, 0x2) } } @@ -146714,7 +140928,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, FmHandleIn Tu32 })(unsafe.Pointer(pNew + 24))).FmHandleIn |= libc.Uint32FromInt32(1) << iTerm } else { - if int32((*TWhereTerm)(unsafe.Pointer(pTerm1)).FeOperator)&int32(WO_IN) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm1)).FeOperator)&int32(WO_IN) != 0 { /* A virtual table that is constrained by an IN clause may not ** consume the ORDER BY clause because (1) the order of IN terms ** is not necessarily related to the order of output terms and @@ -146723,14 +140937,10 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 0 *(*int32)(unsafe.Pointer(pIdxInfo + 52)) &= ^libc.Int32FromInt32(SQLITE_INDEX_SCAN_UNIQUE) *(*int32)(unsafe.Pointer(pbIn)) = int32(1) - _ = libc.Int32FromInt32(0) } } /* Unless pbRetryLimit is non-NULL, there should be no LIMIT/OFFSET ** terms. And if there are any, they should follow all other terms. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _isLimitTerm(tls, pTerm1) != 0 && (*(*int32)(unsafe.Pointer(pbIn)) != 0 || !(_allConstraintsUsed(tls, pUsage, i) != 0)) { /* If there is an IN(...) term handled as an == (separate call to ** xFilter for each value on the RHS of the IN) and a LIMIT or @@ -146754,7 +140964,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, i++ pIdxCons += 12 } - (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(mxTerm + int32(1)) + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = libc.Uint16FromInt32(mxTerm + int32(1)) i = 0 for { if !(i <= mxTerm) { @@ -146771,7 +140981,6 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, ; i++ } - _ = libc.Int32FromInt32(0) (*(*struct { FidxNum int32 F__ccgo4 uint8 @@ -146780,7 +140989,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pNew + 24))).FidxNum = (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum - libc.SetBitFieldPtr8Uint32(pNew+24+4, uint32((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr), 0, 0x1) + libc.SetBitFieldPtr8Uint32(pNew+24+4, libc.Uint32FromInt32((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr), 0, 0x1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 0 (*(*struct { FidxNum int32 @@ -146805,13 +141014,13 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, })(unsafe.Pointer(pNew + 24))).FisOrdered = int8(v7) (*TWhereLoop)(unsafe.Pointer(pNew)).FrSetup = 0 (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = _sqlite3LogEstFromDouble(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost) - (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = _sqlite3LogEst(tls, uint64((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows)) + (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = _sqlite3LogEst(tls, libc.Uint64FromInt64((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows)) /* Set the WHERE_ONEROW flag if the xBestIndex() method indicated ** that the scan will visit at most one row. Clear it otherwise. */ if (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags&int32(SQLITE_INDEX_SCAN_UNIQUE) != 0 { *(*Tu32)(unsafe.Pointer(pNew + 40)) |= uint32(WHERE_ONEROW) } else { - *(*Tu32)(unsafe.Pointer(pNew + 40)) &= uint32(^libc.Int32FromInt32(WHERE_ONEROW)) + *(*Tu32)(unsafe.Pointer(pNew + 40)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(WHERE_ONEROW)) } rc = _whereLoopInsert(tls, pBuilder, pNew) if int32(Tu32(*(*uint8)(unsafe.Pointer(pNew + 24 + 4))&0x1>>0)) != 0 { @@ -146916,7 +141125,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(166453)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(166464)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 20 + uintptr(iCons)*4)) == uintptr(0) { pTerm = (*TWhereClause)(unsafe.Pointer((*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC)).Fa + uintptr((*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset)*48 @@ -146940,7 +141149,6 @@ func Xsqlite3_vtab_distinct(tls *libc.TLS, pIdxInfo uintptr) (r int32) { var pHidden uintptr _ = pHidden pHidden = pIdxInfo + 1*64 - _ = libc.Int32FromInt32(0) return (*THiddenIndexInfo)(unsafe.Pointer(pHidden)).FeDistinct } @@ -147025,13 +141233,11 @@ func _whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUn _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, mBest, mBestNoIn, mNext, mPrev, mThis, nConstraint, p, pNew, pParse, pSrc, pWC, pWInfo, rc, seenZero, seenZeroNoIN, v1, v2 rc = SQLITE_OK *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* True to retry with LIMIT/OFFSET disabled */ - _ = libc.Int32FromInt32(0) pWInfo = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse pWC = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC pNew = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew pSrc = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*68 - _ = libc.Int32FromInt32(0) p = _allocateIndexInfo(tls, pWInfo, pWC, mUnusable, pSrc, bp+4) if p == uintptr(0) { return int32(SQLITE_NOMEM) @@ -147046,10 +141252,9 @@ func _whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUn return int32(SQLITE_NOMEM) } /* First call xBestIndex() with all constraints usable. */ - rc = _whereLoopAddVirtualOne(tls, pBuilder, mPrereq, uint64(-libc.Int32FromInt32(1)), uint16(0), p, *(*Tu16)(unsafe.Pointer(bp + 4)), bp, bp+8) + rc = _whereLoopAddVirtualOne(tls, pBuilder, mPrereq, libc.Uint64FromInt32(-libc.Int32FromInt32(1)), uint16(0), p, *(*Tu16)(unsafe.Pointer(bp + 4)), bp, bp+8) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { - _ = libc.Int32FromInt32(0) - rc = _whereLoopAddVirtualOne(tls, pBuilder, mPrereq, uint64(-libc.Int32FromInt32(1)), uint16(0), p, *(*Tu16)(unsafe.Pointer(bp + 4)), bp, uintptr(0)) + rc = _whereLoopAddVirtualOne(tls, pBuilder, mPrereq, libc.Uint64FromInt32(-libc.Int32FromInt32(1)), uint16(0), p, *(*Tu16)(unsafe.Pointer(bp + 4)), bp, uintptr(0)) } /* If the call to xBestIndex() with all terms enabled produced a plan ** that does not require any source tables (IOW: a plan with mBest==0) @@ -147068,8 +141273,7 @@ func _whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUn /* If the plan produced by the earlier call uses an IN(...) term, call ** xBestIndex again, this time with IN(...) terms disabled. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = _whereLoopAddVirtualOne(tls, pBuilder, mPrereq, uint64(-libc.Int32FromInt32(1)), uint16(WO_IN), p, *(*Tu16)(unsafe.Pointer(bp + 4)), bp, uintptr(0)) - _ = libc.Int32FromInt32(0) + rc = _whereLoopAddVirtualOne(tls, pBuilder, mPrereq, libc.Uint64FromInt32(-libc.Int32FromInt32(1)), uint16(WO_IN), p, *(*Tu16)(unsafe.Pointer(bp + 4)), bp, uintptr(0)) mBestNoIn = (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq if mBestNoIn == uint64(0) { seenZero = int32(1) @@ -147079,8 +141283,7 @@ func _whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUn /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq) ** in the set of terms that apply to the current virtual table. */ for rc == SQLITE_OK { - mNext = uint64(-libc.Int32FromInt32(1)) - _ = libc.Int32FromInt32(0) + mNext = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) i = 0 for { if !(i < nConstraint) { @@ -147096,7 +141299,7 @@ func _whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUn i++ } mPrev = mNext - if mNext == uint64(-libc.Int32FromInt32(1)) { + if mNext == libc.Uint64FromInt32(-libc.Int32FromInt32(1)) { break } if mNext == mBest || mNext == mBestNoIn { @@ -147159,7 +141362,7 @@ func _whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusabl pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*68 iCur = (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor /* The multi-index OR optimization does not work for RIGHT and FULL JOIN */ - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return SQLITE_OK } pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -147167,7 +141370,7 @@ func _whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusabl if !(pTerm < pWCEnd && rc == SQLITE_OK) { break } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_OR) != 0 && (*TWhereOrInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TWhereTerm)(unsafe.Pointer(pTerm)).Fu)))).Findexable&(*TWhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != uint64(0) { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_OR) != 0 && (*TWhereOrInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TWhereTerm)(unsafe.Pointer(pTerm)).Fu)))).Findexable&(*TWhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != uint64(0) { pOrWC = *(*uintptr)(unsafe.Pointer(&(*TWhereTerm)(unsafe.Pointer(pTerm)).Fu)) pOrWCEnd = (*TWhereClause)(unsafe.Pointer(pOrWC)).Fa + uintptr((*TWhereClause)(unsafe.Pointer(pOrWC)).FnTerm)*48 once = int32(1) @@ -147178,7 +141381,7 @@ func _whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusabl if !(pOrTerm < pOrWCEnd) { break } - if int32((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&int32(WO_AND) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&int32(WO_AND) != 0 { (*(*TWhereLoopBuilder)(unsafe.Pointer(bp + 412))).FpWC = *(*uintptr)(unsafe.Pointer(&(*TWhereTerm)(unsafe.Pointer(pOrTerm)).Fu)) } else { if (*TWhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur { @@ -147194,7 +141397,7 @@ func _whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusabl } } (*(*TWhereOrSet)(unsafe.Pointer(bp + 484))).Fn = uint16(0) - if int32((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == int32(TABTYP_VTAB) { rc = _whereLoopAddVirtual(tls, bp+412, mPrereq, mUnusable) } else { rc = _whereLoopAddBtree(tls, bp+412, mPrereq) @@ -147202,7 +141405,7 @@ func _whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusabl if rc == SQLITE_OK { rc = _whereLoopAddOr(tls, bp+412, mPrereq, mUnusable) } - if int32((*(*TWhereOrSet)(unsafe.Pointer(bp + 484))).Fn) == 0 { + if libc.Int32FromUint16((*(*TWhereOrSet)(unsafe.Pointer(bp + 484))).Fn) == 0 { (*(*TWhereOrSet)(unsafe.Pointer(bp + 444))).Fn = uint16(0) break } else { @@ -147214,12 +141417,12 @@ func _whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusabl (*(*TWhereOrSet)(unsafe.Pointer(bp + 444))).Fn = uint16(0) i = 0 for { - if !(i < int32((*(*TWhereOrSet)(unsafe.Pointer(bp + 524))).Fn)) { + if !(i < libc.Int32FromUint16((*(*TWhereOrSet)(unsafe.Pointer(bp + 524))).Fn)) { break } j = 0 for { - if !(j < int32((*(*TWhereOrSet)(unsafe.Pointer(bp + 484))).Fn)) { + if !(j < libc.Int32FromUint16((*(*TWhereOrSet)(unsafe.Pointer(bp + 484))).Fn)) { break } _whereOrInsert(tls, bp+444, (*(*TWhereOrCost)(unsafe.Pointer(bp + 524 + 4 + uintptr(i)*12))).Fprereq|(*(*TWhereOrCost)(unsafe.Pointer(bp + 484 + 4 + uintptr(j)*12))).Fprereq, _sqlite3LogEstAdd(tls, (*(*TWhereOrCost)(unsafe.Pointer(bp + 524 + 4 + uintptr(i)*12))).FrRun, (*(*TWhereOrCost)(unsafe.Pointer(bp + 484 + 4 + uintptr(j)*12))).FrRun), _sqlite3LogEstAdd(tls, (*(*TWhereOrCost)(unsafe.Pointer(bp + 524 + 4 + uintptr(i)*12))).FnOut, (*(*TWhereOrCost)(unsafe.Pointer(bp + 484 + 4 + uintptr(j)*12))).FnOut)) @@ -147248,7 +141451,7 @@ func _whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusabl libc.Xmemset(tls, pNew+24, 0, uint32(16)) i = 0 for { - if !(rc == SQLITE_OK && i < int32((*(*TWhereOrSet)(unsafe.Pointer(bp + 444))).Fn)) { + if !(rc == SQLITE_OK && i < libc.Int32FromUint16((*(*TWhereOrSet)(unsafe.Pointer(bp + 444))).Fn)) { break } /* TUNING: Currently sSum.a[i].rRun is set to the sum of the costs @@ -147303,10 +141506,6 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { /* Loop over the tables in the join, from left to right */ pNew = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew /* Verify that pNew has already been initialized */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = uint32(SQLITE_QUERY_PLANNER_LIMIT) iTab = 0 pItem = pTabList + 8 @@ -147315,10 +141514,10 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { break } mUnusable = uint64(0) - (*TWhereLoop)(unsafe.Pointer(pNew)).FiTab = uint8(iTab) + (*TWhereLoop)(unsafe.Pointer(pNew)).FiTab = libc.Uint8FromInt32(iTab) *(*uint32)(unsafe.Pointer(pBuilder + 28)) += uint32(SQLITE_QUERY_PLANNER_LIMIT_INCR) (*TWhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = _sqlite3WhereGetMask(tls, pWInfo+488, (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor) - if bFirstPastRJ != 0 || int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)|libc.Int32FromInt32(JT_LTORJ)) != 0 { + if bFirstPastRJ != 0 || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)|libc.Int32FromInt32(JT_LTORJ)) != 0 { /* Add prerequisites to prevent reordering of FROM clause terms ** across CROSS joins and outer joins. The bFirstPastRJ boolean ** prevents the right operand of a RIGHT JOIN from being swapped with @@ -147329,23 +141528,23 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { ** a LEFT JOIN over to the left side of that join if the LEFT JOIN ** is itself on the left side of a RIGHT JOIN. */ - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { hasRightJoin = int32(1) } mPrereq |= mPrior - bFirstPastRJ = libc.BoolInt32(int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0) + bFirstPastRJ = libc.BoolInt32(libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0) } else { if !(hasRightJoin != 0) { mPrereq = uint64(0) } } - if int32((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == int32(TABTYP_VTAB) { p = pItem + 1*68 for { if !(p < pEnd) { break } - if mUnusable != 0 || int32((*TSrcItem)(unsafe.Pointer(p)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0 { + if mUnusable != 0 || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(p)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0 { mUnusable |= _sqlite3WhereGetMask(tls, pWInfo+488, (*TSrcItem)(unsafe.Pointer(p)).FiCursor) } goto _2 @@ -147431,33 +141630,32 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, ** rowid appears in the ORDER BY clause, the corresponding WhereLoop is ** automatically order-distinct. */ - _ = libc.Int32FromInt32(0) - if nLoop != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OrderByIdxJoin)) != uint32(0) { + if nLoop != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OrderByIdxJoin)) != uint32(0) { return 0 } - nOrderBy = uint16((*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr) - if int32(nOrderBy) > int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { + nOrderBy = libc.Uint16FromInt32((*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr) + if libc.Int32FromUint16(nOrderBy) > libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1) { return 0 } /* Cannot optimize overly large ORDER BYs */ isOrderDistinct = uint8(1) obDone = libc.Uint64FromInt32(1)<<nOrderBy - uint64(1) orderDistinctMask = uint64(0) ready = uint64(0) - eqOpMask = uint16(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IS) | libc.Int32FromInt32(WO_ISNULL)) - if int32(wctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_LIMIT)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)|libc.Int32FromInt32(WHERE_ORDERBY_MIN)) != 0 { + eqOpMask = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IS) | libc.Int32FromInt32(WO_ISNULL)) + if libc.Int32FromUint16(wctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_LIMIT)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)|libc.Int32FromInt32(WHERE_ORDERBY_MIN)) != 0 { eqOpMask = Tu16(int32(eqOpMask) | libc.Int32FromInt32(WO_IN)) } iLoop = 0 for { - if !(isOrderDistinct != 0 && obSat < obDone && iLoop <= int32(nLoop)) { + if !(isOrderDistinct != 0 && obSat < obDone && iLoop <= libc.Int32FromUint16(nLoop)) { break } if iLoop > 0 { ready |= (*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf } - if iLoop < int32(nLoop) { + if iLoop < libc.Int32FromUint16(nLoop) { pLoop = *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pPath)).FaLoop + uintptr(iLoop)*4)) - if int32(wctrlFlags)&int32(WHERE_ORDERBY_LIMIT) != 0 { + if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ORDERBY_LIMIT) != 0 { goto _1 } } else { @@ -147471,12 +141669,12 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, FomitMask Tu16 FidxStr uintptr FmHandleIn Tu32 - })(unsafe.Pointer(pLoop + 24))).FisOrdered != 0 && int32(wctrlFlags)&(libc.Int32FromInt32(WHERE_DISTINCTBY)|libc.Int32FromInt32(WHERE_SORTBYGROUP)) != int32(WHERE_DISTINCTBY) { + })(unsafe.Pointer(pLoop + 24))).FisOrdered != 0 && libc.Int32FromUint16(wctrlFlags)&(libc.Int32FromInt32(WHERE_DISTINCTBY)|libc.Int32FromInt32(WHERE_SORTBYGROUP)) != int32(WHERE_DISTINCTBY) { obSat = obDone } break } else { - if int32(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { + if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol = uint16(0) } } @@ -147488,7 +141686,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, */ i = 0 for { - if !(i < int32(nOrderBy)) { + if !(i < libc.Int32FromUint16(nOrderBy)) { break } if libc.Uint64FromInt32(1)<<i&obSat != 0 { @@ -147498,7 +141696,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, if pOBExpr == uintptr(0) { goto _2 } - if int32((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_AGG_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_AGG_COLUMN) { goto _2 } if (*TExpr)(unsafe.Pointer(pOBExpr)).FiTable != iCur { @@ -147508,14 +141706,13 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, if pTerm == uintptr(0) { goto _2 } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) == int32(WO_IN) { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) == int32(WO_IN) { /* IN terms are only valid for sorting in the ORDER BY LIMIT ** optimization, and then only if they are actually used ** by the query plan */ - _ = libc.Int32FromInt32(0) j = 0 for { - if !(j < int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) && pTerm != *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4))) { + if !(j < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) && pTerm != *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4))) { break } goto _3 @@ -147523,15 +141720,14 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, ; j++ } - if j >= int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) { + if j >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) { goto _2 } } - if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 && int32((*TExpr)(unsafe.Pointer(pOBExpr)).FiColumn) >= 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 && int32((*TExpr)(unsafe.Pointer(pOBExpr)).FiColumn) >= 0 { pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse pColl1 = _sqlite3ExprNNCollSeq(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).FpExpr) pColl2 = _sqlite3ExprCompareCollSeq(tls, pParse, (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr) - _ = libc.Int32FromInt32(0) if pColl2 == uintptr(0) || _sqlite3StrICmp(tls, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, (*TCollSeq)(unsafe.Pointer(pColl2)).FzName) != 0 { goto _2 } @@ -147555,13 +141751,11 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } else { nKeyCol = (*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol nColumn = (*TIndex)(unsafe.Pointer(pIndex)).FnColumn - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* All relevant terms of the index must also be non-NULL in order ** for isOrderDistinct to be true. So the isOrderDistint value ** computed here might be a false positive. Corrections will be ** made at tag-20210426-1 below */ - isOrderDistinct = libc.BoolUint8(int32((*TIndex)(unsafe.Pointer(pIndex)).FonError) != OE_None && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_SKIPSCAN) == uint32(0)) + isOrderDistinct = libc.BoolUint8(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) != OE_None && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_SKIPSCAN) == uint32(0)) } } /* Loop through all columns of the index and deal with the ones @@ -147573,12 +141767,11 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, distinctColumns = uint8(0) j = 0 for { - if !(j < int32(nColumn)) { + if !(j < libc.Int32FromUint16(nColumn)) { break } bOnce = uint8(1) /* True to run the ORDER BY search loop */ - _ = libc.Int32FromInt32(0) - if j < int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) && j >= int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { + if j < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) && j >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { eOp = (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4)))).FeOperator /* Skip over == and IS and ISNULL terms. (Also skip IN terms when ** doing WHERE_ORDERBY_LIMIT processing). Except, IS and ISNULL @@ -147592,13 +141785,13 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, ** if it is one of two or more, none of the columns can be ** considered to match an ORDER BY term. */ - if int32(eOp)&int32(eqOpMask) != 0 { - if int32(eOp)&(libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { + if libc.Int32FromUint16(eOp)&libc.Int32FromUint16(eqOpMask) != 0 { + if libc.Int32FromUint16(eOp)&(libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { isOrderDistinct = uint8(0) } goto _6 } else { - if int32(eOp)&int32(WO_IN) != 0 { + if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { /* ALWAYS() justification: eOp is an equality operator due to the ** j<pLoop->u.btree.nEq constraint above. Any equality other ** than WO_IN is captured by the previous "if". So this one @@ -147606,11 +141799,10 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pX = (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4)))).FpExpr i = j + int32(1) for { - if !(i < int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) { + if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) { break } if (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)))).FpExpr == pX { - _ = libc.Int32FromInt32(0) bOnce = uint8(0) break } @@ -147627,7 +141819,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, */ if pIndex != 0 { iColumn = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(j)*2))) - revIdx = uint8(int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(j)))) & int32(KEYINFO_ORDER_DESC)) + revIdx = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(j)))) & int32(KEYINFO_ORDER_DESC)) if iColumn == int32((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FpTable)).FiPKey) { iColumn = -int32(1) } @@ -147639,7 +141831,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, ** WhereLoop is not well-ordered. tag-20210426-1 */ if isOrderDistinct != 0 { - if iColumn >= 0 && j >= int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) && int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FpTable)).FaCol + uintptr(iColumn)*12 + 4))&0xf>>0)) == 0 { + if iColumn >= 0 && j >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) && int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FpTable)).FaCol + uintptr(iColumn)*12 + 4))&0xf>>0)) == 0 { isOrderDistinct = uint8(0) } if iColumn == -int32(2) { @@ -147652,7 +141844,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, isMatch = uint8(0) i = 0 for { - if !(bOnce != 0 && i < int32(nOrderBy)) { + if !(bOnce != 0 && i < libc.Int32FromUint16(nOrderBy)) { break } if libc.Uint64FromInt32(1)<<i&obSat != 0 { @@ -147662,11 +141854,11 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, if pOBExpr == uintptr(0) { goto _8 } - if int32(wctrlFlags)&(libc.Int32FromInt32(WHERE_GROUPBY)|libc.Int32FromInt32(WHERE_DISTINCTBY)) == 0 { + if libc.Int32FromUint16(wctrlFlags)&(libc.Int32FromInt32(WHERE_GROUPBY)|libc.Int32FromInt32(WHERE_DISTINCTBY)) == 0 { bOnce = uint8(0) } if iColumn >= -int32(1) { - if int32((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_AGG_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_AGG_COLUMN) { goto _8 } if (*TExpr)(unsafe.Pointer(pOBExpr)).FiTable != iCur { @@ -147687,8 +141879,8 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, goto _8 } } - if int32(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol = uint16(j + int32(1)) + if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { + (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol = libc.Uint16FromInt32(j + int32(1)) } isMatch = uint8(1) break @@ -147697,23 +141889,23 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, ; i++ } - if isMatch != 0 && int32(wctrlFlags)&int32(WHERE_GROUPBY) == 0 { + if isMatch != 0 && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_GROUPBY) == 0 { /* Make sure the sort order is compatible in an ORDER BY clause. ** Sort order is irrelevant for a GROUP BY clause. */ if revSet != 0 { - if int32(rev)^int32(revIdx) != int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC) { + if libc.Int32FromUint8(rev)^libc.Int32FromUint8(revIdx) != libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC) { isMatch = uint8(0) } } else { - rev = uint8(int32(revIdx) ^ int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC)) + rev = libc.Uint8FromInt32(libc.Int32FromUint8(revIdx) ^ libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC)) if rev != 0 { *(*TBitmask)(unsafe.Pointer(pRevMask)) |= libc.Uint64FromInt32(1) << iLoop } revSet = uint8(1) } } - if isMatch != 0 && int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_BIGNULL) != 0 { - if j == int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) { + if isMatch != 0 && libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_BIGNULL) != 0 { + if j == libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) { *(*Tu32)(unsafe.Pointer(pLoop + 40)) |= uint32(WHERE_BIGNULL_SORT) } else { isMatch = uint8(0) @@ -147726,7 +141918,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, obSat |= libc.Uint64FromInt32(1) << i } else { /* No match found */ - if j == 0 || j < int32(nKeyCol) { + if j == 0 || j < libc.Int32FromUint16(nKeyCol) { isOrderDistinct = uint8(0) } break @@ -147745,7 +141937,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, orderDistinctMask |= (*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf i = 0 for { - if !(i < int32(nOrderBy)) { + if !(i < libc.Int32FromUint16(nOrderBy)) { break } if libc.Uint64FromInt32(1)<<i&obSat != 0 { @@ -147771,15 +141963,15 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, iLoop++ } /* End the loop over all WhereLoops from outer-most down to inner-most */ if obSat == obDone { - return int8(nOrderBy) + return libc.Int8FromUint16(nOrderBy) } if !(isOrderDistinct != 0) { - i = int32(nOrderBy) - int32(1) + i = libc.Int32FromUint16(nOrderBy) - int32(1) for { if !(i > 0) { break } - if i < int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { + if i < libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { v11 = libc.Uint64FromInt32(1)<<i - uint64(1) } else { v11 = uint64(0) @@ -147824,8 +142016,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, // ** SELECT * FROM t1 GROUP BY y,x ORDER BY y,x; -- IsSorted()==0 // */ func _sqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return int32(uint32(*(*uint8)(unsafe.Pointer(pWInfo + 48)) & 0x8 >> 3)) } @@ -147839,21 +142029,19 @@ func _sqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) (r int32) { func _whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow TLogEst, nOrderBy int32, nSorted int32) (r TLogEst) { var nCol, rSortCost TLogEst _, _ = nCol, rSortCost - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* TUNING: sorting cost proportional to the number of output columns: */ - nCol = _sqlite3LogEst(tls, uint64(((*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FpEList)).FnExpr+int32(59))/int32(30))) + nCol = _sqlite3LogEst(tls, libc.Uint64FromInt32(((*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FpEList)).FnExpr+int32(59))/int32(30))) rSortCost = int16(int32(nRow) + int32(nCol)) if nSorted > 0 { /* Scale the result by (Y/X) */ - rSortCost = TLogEst(int32(rSortCost) + (int32(_sqlite3LogEst(tls, uint64((nOrderBy-nSorted)*int32(100)/nOrderBy))) - libc.Int32FromInt32(66))) + rSortCost = TLogEst(int32(rSortCost) + (int32(_sqlite3LogEst(tls, libc.Uint64FromInt32((nOrderBy-nSorted)*int32(100)/nOrderBy))) - libc.Int32FromInt32(66))) } /* Multiple by log(M) where M is the number of output rows. ** Use the LIMIT for M if it is smaller. Or if this sort is for ** a DISTINCT operator, M will be the number of distinct output ** rows, so fudge it downwards a bit. */ - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_USE_LIMIT) != 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_USE_LIMIT) != 0 { rSortCost = TLogEst(int32(rSortCost) + libc.Int32FromInt32(10)) /* TUNING: Extra 2.0x if using LIMIT */ if nSorted != 0 { rSortCost = TLogEst(int32(rSortCost) + libc.Int32FromInt32(6)) /* TUNING: Extra 1.5x if also using partial sort */ @@ -147862,12 +142050,11 @@ func _whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow TLogEst, nOrderBy int nRow = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiLimit } } else { - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { /* TUNING: In the sort for a DISTINCT operator, assume that the DISTINCT ** reduces the number of output rows by a factor of 2 */ if int32(nRow) > int32(10) { nRow = TLogEst(int32(nRow) - libc.Int32FromInt32(10)) - _ = libc.Int32FromInt32(0) } } } @@ -147908,7 +142095,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) mxUnsorted = 0 /* Used to divy up the pSpace memory */ aSortCost = uintptr(0) /* Bytes of space allocated at pSpace */ pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse - nLoop = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) + nLoop = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) /* TUNING: For simple queries, only the best path is tracked. ** For 2-way joins, the 5 best paths are followed. ** For joins of 3 or more tables, track the 10 best paths */ @@ -147923,7 +142110,6 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) v1 = v2 } mxChoice = v1 - _ = libc.Int32FromInt32(0) /* If nRowEst is zero and there is an ORDER BY clause, ignore it. In this ** case the purpose of this call is to estimate the number of rows returned ** by the overall query. Once this estimate has been obtained, the caller @@ -147935,9 +142121,9 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) nOrderBy = (*TExprList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr } /* Allocate and initialize space for aTo, aFrom and aSortCost[] */ - nSpace = int32((uint32(28) + uint32(4)*uint32(nLoop)) * uint32(mxChoice) * uint32(2)) - nSpace = int32(uint32(nSpace) + libc.Uint32FromInt64(2)*uint32(nOrderBy)) - pSpace = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(nSpace)) + nSpace = libc.Int32FromUint32((uint32(28) + uint32(4)*libc.Uint32FromInt32(nLoop)) * libc.Uint32FromInt32(mxChoice) * uint32(2)) + nSpace = int32(uint32(nSpace) + libc.Uint32FromInt64(2)*libc.Uint32FromInt32(nOrderBy)) + pSpace = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nSpace)) if pSpace == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -147967,10 +142153,8 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ** the ORDER BY clause are already in order, where X is the array ** index. */ aSortCost = pX - libc.Xmemset(tls, aSortCost, 0, uint32(2)*uint32(nOrderBy)) + libc.Xmemset(tls, aSortCost, 0, uint32(2)*libc.Uint32FromInt32(nOrderBy)) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Seed the search with a single WherePath containing zero WhereLoops. ** ** TUNING: Do not let the number of iterations go above 28. If the cost @@ -147982,9 +142166,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) v4 = int32(48) } (*(*TWherePath)(unsafe.Pointer(aFrom))).FnRow = int16(v4) - _ = libc.Int32FromInt32(0) nFrom = int32(1) - _ = libc.Int32FromInt32(0) if nOrderBy != 0 { /* If nLoop is zero, then there are no FROM terms in the query. Since ** in this case the query may return a maximum of one row, the results @@ -148030,7 +142212,6 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ** to run less than 1.25 times. It is tempting to also exclude ** automatic index usage on an outer loop, but sometimes an automatic ** index is useful in the outer loop of a correlated subquery. */ - _ = libc.Int32FromInt32(0) goto _8 } /* At this point, pWLoop is a candidate to be the next loop. @@ -148042,7 +142223,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) isOrdered = (*TWherePath)(unsafe.Pointer(pFrom)).FisOrdered if int32(isOrdered) < 0 { *(*TBitmask)(unsafe.Pointer(bp)) = uint64(0) - isOrdered = _wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags, uint16(iLoop), pWLoop, bp) + isOrdered = _wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags, libc.Uint16FromInt32(iLoop), pWLoop, bp) } else { *(*TBitmask)(unsafe.Pointer(bp)) = (*TWherePath)(unsafe.Pointer(pFrom)).FrevLoop } @@ -148128,7 +142309,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) (*TWherePath)(unsafe.Pointer(pTo)).FrCost = rCost (*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted = rUnsorted (*TWherePath)(unsafe.Pointer(pTo)).FisOrdered = isOrdered - libc.Xmemcpy(tls, (*TWherePath)(unsafe.Pointer(pTo)).FaLoop, (*TWherePath)(unsafe.Pointer(pFrom)).FaLoop, uint32(4)*uint32(iLoop)) + libc.Xmemcpy(tls, (*TWherePath)(unsafe.Pointer(pTo)).FaLoop, (*TWherePath)(unsafe.Pointer(pFrom)).FaLoop, uint32(4)*libc.Uint32FromInt32(iLoop)) *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pTo)).FaLoop + uintptr(iLoop)*4)) = pWLoop if nTo >= mxChoice { mxI = 0 @@ -148193,7 +142374,6 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ; ii++ } - _ = libc.Int32FromInt32(0) /* Load the lowest cost path into pWInfo */ iLoop = 0 for { @@ -148211,8 +142391,8 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ; iLoop++ } - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DISTINCTBY) == 0 && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_NOOP && nRowEst != 0 { - rc = int32(_wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet, pFrom, uint16(WHERE_DISTINCTBY), uint16(nLoop-int32(1)), *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-int32(1))*4)), bp+8)) + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DISTINCTBY) == 0 && libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_NOOP && nRowEst != 0 { + rc = int32(_wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet, pFrom, uint16(WHERE_DISTINCTBY), libc.Uint16FromInt32(nLoop-int32(1)), *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-int32(1))*4)), bp+8)) if rc == (*TExprList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet)).FnExpr { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_ORDERED) } @@ -148220,21 +142400,20 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) libc.SetBitFieldPtr8Uint32(pWInfo+48, libc.Uint32FromInt32(0), 2, 0x4) if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = (*TWherePath)(unsafe.Pointer(pFrom)).FisOrdered - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { if int32((*TWherePath)(unsafe.Pointer(pFrom)).FisOrdered) == (*TExprList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_ORDERED) } /* vvv--- See check-in [12ad822d9b827777] on 2023-03-16 ---vvv */ - _ = libc.Int32FromInt32(0) } else { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = (*TWherePath)(unsafe.Pointer(pFrom)).FrevLoop if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) <= 0 { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = 0 if nLoop > 0 { wsFlags = (*TWhereLoop)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-int32(1))*4)))).FwsFlags - if wsFlags&uint32(WHERE_ONEROW) == uint32(0) && wsFlags&uint32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != uint32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_COLUMN_IN)) { + if wsFlags&uint32(WHERE_ONEROW) == uint32(0) && wsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_COLUMN_IN)) { *(*TBitmask)(unsafe.Pointer(bp + 16)) = uint64(0) - rc1 = int32(_wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, uint16(WHERE_ORDERBY_LIMIT), uint16(nLoop-int32(1)), *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-int32(1))*4)), bp+16)) + rc1 = int32(_wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, uint16(WHERE_ORDERBY_LIMIT), libc.Uint16FromInt32(nLoop-int32(1)), *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-int32(1))*4)), bp+16)) if rc1 == (*TExprList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { libc.SetBitFieldPtr8Uint32(pWInfo+48, libc.Uint32FromInt32(1), 2, 0x4) (*TWhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = *(*TBitmask)(unsafe.Pointer(bp + 16)) @@ -148242,15 +142421,14 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) } } } else { - if nLoop != 0 && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == int32(1) && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_MIN)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)) != 0 { + if nLoop != 0 && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == int32(1) && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_MIN)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)) != 0 { libc.SetBitFieldPtr8Uint32(pWInfo+48, libc.Uint32FromInt32(1), 2, 0x4) } } } - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_SORTBYGROUP) != 0 && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == (*TExprList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr && nLoop > 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_SORTBYGROUP) != 0 && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == (*TExprList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr && nLoop > 0 { *(*TBitmask)(unsafe.Pointer(bp + 24)) = uint64(0) - nOrder = int32(_wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, uint16(0), uint16(nLoop-int32(1)), *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-int32(1))*4)), bp+24)) - _ = libc.Int32FromInt32(0) + nOrder = int32(_wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, uint16(0), libc.Uint16FromInt32(nLoop-int32(1)), *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-int32(1))*4)), bp+24)) if nOrder == (*TExprList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { libc.SetBitFieldPtr8Uint32(pWInfo+48, libc.Uint32FromInt32(1), 3, 0x8) (*TWhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = *(*TBitmask)(unsafe.Pointer(bp + 24)) @@ -148314,7 +142492,7 @@ func _whereInterstageHeuristic(tls *libc.TLS, pWInfo uintptr) { _, _, _, _ = i, iTab, p, pLoop i = 0 for { - if !(i < int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { + if !(i < libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { break } p = (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(i)*84))).FpWLoop @@ -148324,21 +142502,21 @@ func _whereInterstageHeuristic(tls *libc.TLS, pWInfo uintptr) { if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { goto _1 } - if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_NULL)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_NULL)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != uint32(0) { iTab = (*TWhereLoop)(unsafe.Pointer(p)).FiTab pLoop = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpLoops for { if !(pLoop != 0) { break } - if int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab) != int32(iTab) { + if libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab) != libc.Int32FromUint8(iTab) { goto _2 } - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_CONSTRAINT)|libc.Int32FromInt32(WHERE_AUTO_INDEX)) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_CONSTRAINT)|libc.Int32FromInt32(WHERE_AUTO_INDEX)) != uint32(0) { /* Auto-index and index-constrained loops allowed to remain */ goto _2 } - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fprereq = uint64(-libc.Int32FromInt32(1)) /* Prevent 2nd solver() from using this one */ + (*TWhereLoop)(unsafe.Pointer(pLoop)).Fprereq = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) /* Prevent 2nd solver() from using this one */ goto _2 _2: ; @@ -148375,13 +142553,12 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { var _ /* scan at bp+0 */ TWhereScan _, _, _, _, _, _, _, _, _, _, _ = iCur, j, opMask, pIdx, pItem, pLoop, pTab, pTerm, pWC, pWInfo, v2 pWInfo = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { return 0 } - _ = libc.Int32FromInt32(0) pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { return 0 } if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x2>>1)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x1>>0)) != 0 { @@ -148392,12 +142569,12 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { pLoop = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = uint32(0) (*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip = uint16(0) - pTerm = _whereScanInit(tls, bp, pWC, iCur, -int32(1), uint32(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)), uintptr(0)) + pTerm = _whereScanInit(tls, bp, pWC, iCur, -int32(1), libc.Uint32FromInt32(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)), uintptr(0)) for pTerm != 0 && (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight != 0 { pTerm = _whereScanNext(tls, bp) } if pTerm != 0 { - (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = uint32(libc.Int32FromInt32(WHERE_COLUMN_EQ) | libc.Int32FromInt32(WHERE_IPK) | libc.Int32FromInt32(WHERE_ONEROW)) + (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ) | libc.Int32FromInt32(WHERE_IPK) | libc.Int32FromInt32(WHERE_ONEROW)) *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) = pTerm (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = uint16(1) (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = uint16(1) @@ -148409,8 +142586,7 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { if !(pIdx != 0) { break } - _ = libc.Int32FromInt32(0) - if !(int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) != libc.Int32FromInt32(OE_None)) || (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) > int32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(4)) { + if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) != libc.Int32FromInt32(OE_None)) || (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) || libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) > libc.Int32FromUint32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(4)) { goto _1 } if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 { @@ -148421,10 +142597,10 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { opMask = v2 j = 0 for { - if !(j < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } - pTerm = _whereScanInit(tls, bp, pWC, iCur, j, uint32(opMask), pIdx) + pTerm = _whereScanInit(tls, bp, pWC, iCur, j, libc.Uint32FromInt32(opMask), pIdx) for pTerm != 0 && (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight != 0 { pTerm = _whereScanNext(tls, bp) } @@ -148437,15 +142613,15 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { ; j++ } - if j != int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { + if j != libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol) { goto _1 } - (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = uint32(libc.Int32FromInt32(WHERE_COLUMN_EQ) | libc.Int32FromInt32(WHERE_ONEROW) | libc.Int32FromInt32(WHERE_INDEXED)) + (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ) | libc.Int32FromInt32(WHERE_ONEROW) | libc.Int32FromInt32(WHERE_INDEXED)) if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x20>>5)) != 0 || (*TSrcItem)(unsafe.Pointer(pItem)).FcolUsed&(*TIndex)(unsafe.Pointer(pIdx)).FcolNotIdxed == uint64(0) { *(*Tu32)(unsafe.Pointer(pLoop + 40)) |= uint32(WHERE_IDX_ONLY) } - (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = uint16(j) - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = uint16(j) + (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = libc.Uint16FromInt32(j) + (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = libc.Uint16FromInt32(j) (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex = pIdx /* TUNING: Cost of a unique index lookup is 15 */ (*TWhereLoop)(unsafe.Pointer(pLoop)).FrRun = int16(39) /* 39==sqlite3LogEst(15) */ @@ -148459,17 +142635,16 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags != 0 { (*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut = libc.Int16FromInt32(1) (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FpWLoop = pLoop - _ = libc.Int32FromInt32(0) (*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf = uint64(1) /* sqlite3WhereGetMask(&pWInfo->sMaskSet, iCur); */ (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FiTabCur = iCur (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut = int16(1) if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8((*TExprList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr) } - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } - if int32((*(*TWhereScan)(unsafe.Pointer(bp))).FiEquiv) > int32(1) { + if libc.Int32FromUint8((*(*TWhereScan)(unsafe.Pointer(bp))).FiEquiv) > int32(1) { *(*Tu32)(unsafe.Pointer(pLoop + 40)) |= uint32(WHERE_TRANSCONS) } return int32(1) @@ -148483,7 +142658,7 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { // ** Helper function for exprIsDeterministic(). // */ func _exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_ConstFunc)) != uint32(0)) == 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_ConstFunc)) != uint32(0)) == 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(0) return int32(WRC_Abort) } @@ -148506,7 +142681,7 @@ func _exprIsDeterministic(tls *libc.TLS, p uintptr) (r int32) { (*(*TWalker)(unsafe.Pointer(bp))).FxExprCallback = __ccgo_fp(_exprNodeIsDeterministic) (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkFail) _sqlite3WalkExpr(tls, bp, p) - return int32((*(*TWalker)(unsafe.Pointer(bp))).FeCode) + return libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode) } // C documentation @@ -148528,6 +142703,10 @@ func _exprIsDeterministic(tls *libc.TLS, p uintptr) (r int32) { // ** the right-most table of a subquery that was flattened into the // ** main query and that subquery was the right-hand operand of an // ** inner join that held an ON or USING clause. +// ** 6) The ORDER BY clause has 63 or fewer terms +// ** 7) The omit-noop-join optimization is enabled. +// ** +// ** Items (1), (6), and (7) are checked by the caller. // ** // ** For example, given: // ** @@ -148553,28 +142732,24 @@ func _whereOmitNoopJoin(tls *libc.TLS, pWInfo uintptr, notReady TBitmask) (r TBi var tabUsed TBitmask _, _, _, _, _, _, _, _, _ = hasRightJoin, i, nByte, pEnd, pItem, pLoop, pTerm, tabUsed, p4 /* Preconditions checked by the caller */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* These two preconditions checked by the caller combine to guarantee ** condition (1) of the header comment */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) tabUsed = _sqlite3WhereExprListUsage(tls, pWInfo+488, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet) if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { tabUsed |= _sqlite3WhereExprListUsage(tls, pWInfo+488, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy) } - hasRightJoin = libc.BoolInt32(int32((*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0) - i = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - int32(1) + hasRightJoin = libc.BoolInt32(libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0) + i = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - int32(1) for { if !(i >= int32(1)) { break } pLoop = (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(i)*84))).FpWLoop pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*68 - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) != int32(JT_LEFT) { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) != int32(JT_LEFT) { goto _1 } - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_ONEROW) == uint32(0) { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_ONEROW) == uint32(0) { goto _1 } if tabUsed&(*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf != uint64(0) { @@ -148587,11 +142762,11 @@ func _whereOmitNoopJoin(tls *libc.TLS, pWInfo uintptr, notReady TBitmask) (r TBi break } if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf != uint64(0) { - if !((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr + 36)) != (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor { + if !((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr + 36)) != (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor { break } } - if hasRightJoin != 0 && (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_InnerON)) != uint32(0) && *(*int32)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr + 36)) == (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor { + if hasRightJoin != 0 && (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) != uint32(0) && *(*int32)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr + 36)) == (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor { break /* restriction (5) */ } goto _2 @@ -148617,12 +142792,11 @@ func _whereOmitNoopJoin(tls *libc.TLS, pWInfo uintptr, notReady TBitmask) (r TBi ; pTerm += 48 } - if i != int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-int32(1) { - nByte = int32(uint32(int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-libc.Int32FromInt32(1)-i) * uint32(84)) - libc.Xmemmove(tls, pWInfo+752+uintptr(i)*84, pWInfo+752+uintptr(i+int32(1))*84, uint32(nByte)) + if i != libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-int32(1) { + nByte = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-libc.Int32FromInt32(1)-i) * uint32(84)) + libc.Xmemmove(tls, pWInfo+752+uintptr(i)*84, pWInfo+752+uintptr(i+int32(1))*84, libc.Uint32FromInt32(nByte)) } (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel-- - _ = libc.Int32FromInt32(0) goto _1 _1: ; @@ -148658,25 +142832,23 @@ func _whereCheckIfBloomFilterIsUseful(tls *libc.TLS, pWInfo uintptr) { var reqFlags uint32 _, _, _, _, _, _ = i, nSearch, pItem, pLoop, pTab, reqFlags nSearch = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) i = 0 for { - if !(i < int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { + if !(i < libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { break } pLoop = (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(i)*84))).FpWLoop - reqFlags = uint32(libc.Int32FromInt32(WHERE_SELFCULL) | libc.Int32FromInt32(WHERE_COLUMN_EQ)) + reqFlags = libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_SELFCULL) | libc.Int32FromInt32(WHERE_COLUMN_EQ)) pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*68 pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasStat1) == uint32(0) { break } *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_MaybeReanalyze) - if i >= int32(1) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&reqFlags == reqFlags && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_INDEXED)) != uint32(0) { + if i >= int32(1) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&reqFlags == reqFlags && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_INDEXED)) != uint32(0) { if int32(nSearch) > int32((*TTable)(unsafe.Pointer(pTab)).FnRowLogEst) { *(*Tu32)(unsafe.Pointer(pLoop + 40)) |= uint32(WHERE_BLOOMFILTER) - *(*Tu32)(unsafe.Pointer(pLoop + 40)) &= uint32(^libc.Int32FromInt32(WHERE_IDX_ONLY)) + *(*Tu32)(unsafe.Pointer(pLoop + 40)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } nSearch = TLogEst(int32(nSearch) + int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut)) @@ -148710,10 +142882,9 @@ func _exprNodeCanReturnSubtype(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r var db, pDef uintptr var n, v1 int32 _, _, _, _ = db, n, pDef, v1 - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_FUNCTION) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_FUNCTION) { return int32(WRC_Prune) } - _ = libc.Int32FromInt32(0) db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 { v1 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr @@ -148747,7 +142918,7 @@ func _sqlite3ExprCanReturnSubtype(tls *libc.TLS, pParse uintptr, pExpr uintptr) (*(*TWalker)(unsafe.Pointer(bp))).FpParse = pParse (*(*TWalker)(unsafe.Pointer(bp))).FxExprCallback = __ccgo_fp(_exprNodeCanReturnSubtype) _sqlite3WalkExpr(tls, bp, pExpr) - return int32((*(*TWalker)(unsafe.Pointer(bp))).FeCode) + return libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode) } // C documentation @@ -148767,18 +142938,17 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i var i, j int32 var p, pArg, pExpr, pTab uintptr _, _, _, _, _, _ = i, j, p, pArg, pExpr, pTab - _ = libc.Int32FromInt32(0) pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable i = 0 for { - if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } j = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if j == -int32(2) { pExpr = (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(i)*20))).FpExpr } else { - if j >= 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + if j >= 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { pExpr = _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*12) } else { goto _1 @@ -148787,7 +142957,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i if _sqlite3ExprIsConstant(tls, uintptr(0), pExpr) != 0 { goto _1 } - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) && _sqlite3ExprCanReturnSubtype(tls, pParse, pExpr) != 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) && _sqlite3ExprCanReturnSubtype(tls, pParse, pExpr) != 0 { /* Functions that might set a subtype should not be replaced by the ** value taken from an expression index since the index omits the ** subtype. https://sqlite.org/forum/forumpost/68d284c86b082c3e */ @@ -148802,9 +142972,9 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i (*TIndexedExpr)(unsafe.Pointer(p)).FiDataCur = (*TSrcItem)(unsafe.Pointer(pTabItem)).FiCursor (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur = iIdxCur (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCol = i - (*TIndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow = libc.BoolUint8(int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0) + (*TIndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow = libc.BoolUint8(libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0) if _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx) != 0 { - (*TIndexedExpr)(unsafe.Pointer(p)).Faff = uint8(*(*int8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FzColAff + uintptr(i)))) + (*TIndexedExpr)(unsafe.Pointer(p)).Faff = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FzColAff + uintptr(i)))) } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { @@ -148838,7 +143008,7 @@ func _whereReverseScanOrder(tls *libc.TLS, pWInfo uintptr) { break } pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr(ii)*68 - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x100>>8)) != 0) || int32((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 64)))).FeM10d) != M10d_Yes || (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) || (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpOrderBy == uintptr(0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x100>>8)) != 0) || libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 64)))).FeM10d) != M10d_Yes || (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) || (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpOrderBy == uintptr(0) { *(*TBitmask)(unsafe.Pointer(pWInfo + 68)) |= libc.Uint64FromInt32(1) << ii } goto _1 @@ -148950,22 +143120,21 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrExplain, b, bFordelete, bOnerow, db, iCur, iDb, iIndexCur, iOnce, ii, n, nByteWInfo, nTabList, notReady, op, op1, p, pInfo, pIx, pJ, pLevel, pLoop, pMaskSet, pPk, pRJ, pSrc, pT, pTab, pTabItem, pVTab, pWInfo, pX, rc, v, wsFlags, wsFlags1, v1, v12, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, p10, p11, p7, p8, p9 /* Will become the return value of this function */ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Return code */ bFordelete = uint8(0) /* OPFLAG_FORDELETE or zero, as appropriate */ - _ = libc.Int32FromInt32(0) /* Only one of WHERE_OR_SUBCLAUSE or WHERE_USE_LIMIT */ - _ = libc.Int32FromInt32(0) /* Variable initialization */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb libc.Xmemset(tls, bp, 0, uint32(32)) /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */ - if pOrderBy != 0 && (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr >= int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { + if pOrderBy != 0 && (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr >= libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { pOrderBy = uintptr(0) wctrlFlags = Tu16(int32(wctrlFlags) & ^libc.Int32FromInt32(WHERE_WANT_DISTINCT)) + wctrlFlags = Tu16(int32(wctrlFlags) | libc.Int32FromInt32(WHERE_KEEP_ALL_JOINS)) /* Disable omit-noop-join opt */ } /* The number of tables in the FROM clause is limited by the number of ** bits in a Bitmask */ - if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22655, libc.VaList(bp+40, int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) + if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22655, libc.VaList(bp+40, libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -148973,7 +143142,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** only generate code for the first table in pTabList and assume that ** any cursors associated with subsequent tables are uninitialized. */ - if int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { + if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { v1 = int32(1) } else { v1 = (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc @@ -148986,11 +143155,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = int32((libc.Uint32FromInt64(836) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + nByteWInfo = libc.Int32FromUint32((libc.Uint32FromInt64(836) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) if nTabList > int32(1) { - nByteWInfo = int32((uint32(nByteWInfo) + uint32(nTabList-libc.Int32FromInt32(1))*libc.Uint32FromInt64(84) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + nByteWInfo = libc.Int32FromUint32((libc.Uint32FromInt32(nByteWInfo) + libc.Uint32FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint32FromInt64(84) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) } - pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(nByteWInfo)+uint32(72))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint32FromInt32(nByteWInfo)+uint32(72))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -149003,7 +143172,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere v2 = -libc.Int32FromInt32(1) *(*int32)(unsafe.Pointer(pWInfo + 20 + 1*4)) = v2 *(*int32)(unsafe.Pointer(pWInfo + 20)) = v2 - (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel = uint8(nTabList) + (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel = libc.Uint8FromInt32(nTabList) v3 = _sqlite3VdbeMakeLabel(tls, pParse) (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiContinue = v3 (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiBreak = v3 @@ -149012,8 +143181,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop = int32((*TParse)(unsafe.Pointer(pParse)).FnQueryLoop) (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect = pSelect libc.Xmemset(tls, pWInfo+45, 0, uint32(libc.UintptrFromInt32(0)+76)-uint32(libc.UintptrFromInt32(0)+45)) - libc.Xmemset(tls, pWInfo+752, 0, uint32(72)+uint32(nTabList)*uint32(84)) - _ = libc.Int32FromInt32(0) /* ONEPASS defaults to OFF */ + libc.Xmemset(tls, pWInfo+752, 0, uint32(72)+libc.Uint32FromInt32(nTabList)*uint32(84)) + /* ONEPASS defaults to OFF */ pMaskSet = pWInfo + 488 (*TWhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn = 0 *(*int32)(unsafe.Pointer(pMaskSet + 8)) = -int32(99) /* Initialize ix[0] to a value that can never be @@ -149022,7 +143191,6 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*(*TWhereLoopBuilder)(unsafe.Pointer(bp))).FpWInfo = pWInfo (*(*TWhereLoopBuilder)(unsafe.Pointer(bp))).FpWC = pWInfo + 76 (*(*TWhereLoopBuilder)(unsafe.Pointer(bp))).FpNew = pWInfo + uintptr(nByteWInfo) - _ = libc.Int32FromInt32(0) _whereLoopInit(tls, (*(*TWhereLoopBuilder)(unsafe.Pointer(bp))).FpNew) /* Split the WHERE clause into separate subexpressions where each ** subexpression is separated by an AND operator. @@ -149035,7 +143203,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if pOrderBy != 0 { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8((*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr) } - if int32(wctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_DistinctOpt)) == uint32(0) { + if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_DistinctOpt)) == uint32(0) { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { @@ -149110,13 +143278,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere break } pT = (*TWhereClause)(unsafe.Pointer((*(*TWhereLoopBuilder)(unsafe.Pointer(bp))).FpWC)).Fa + uintptr(ii)*48 /* The expression of pT */ - if int32((*TWhereTerm)(unsafe.Pointer(pT)).FwtFlags)&int32(TERM_VIRTUAL) != 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pT)).FwtFlags)&int32(TERM_VIRTUAL) != 0 { goto _6 } pX = (*TWhereTerm)(unsafe.Pointer(pT)).FpExpr - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TWhereTerm)(unsafe.Pointer(pT)).FprereqAll == uint64(0) && (nTabList == 0 || _exprIsDeterministic(tls, pX) != 0) && !((*TExpr)(unsafe.Pointer(pX)).Fflags&uint32(libc.Int32FromInt32(EP_InnerON)) != uint32(0) && int32((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0) { + if (*TWhereTerm)(unsafe.Pointer(pT)).FprereqAll == uint64(0) && (nTabList == 0 || _exprIsDeterministic(tls, pX) != 0) && !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) != uint32(0) && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0) { _sqlite3ExprIfFalse(tls, pParse, pX, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiBreak, int32(SQLITE_JUMPIFNULL)) p7 = pT + 10 *(*Tu16)(unsafe.Pointer(p7)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p7))) | libc.Int32FromInt32(TERM_CODED)) @@ -149126,8 +143292,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ; ii++ } - if int32(wctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_DistinctOpt)) != uint32(0) { + if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_DistinctOpt)) != uint32(0) { /* Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via ** sqlite3_test_ctrl(SQLITE_TESTCTRL_OPTIMIZATIONS,...) */ wctrlFlags = Tu16(int32(wctrlFlags) & ^libc.Int32FromInt32(WHERE_WANT_DISTINCT)) @@ -149158,7 +143324,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** changed based on STAT4 information while computing subsequent loops, ** then we need to rerun the whole loop building process so that all ** loops will be built using the revised truthProb values. */ - if int32((*(*TWhereLoopBuilder)(unsafe.Pointer(bp))).FbldFlags2)&int32(SQLITE_BLDF2_2NDPASS) != 0 { + if libc.Int32FromUint8((*(*TWhereLoopBuilder)(unsafe.Pointer(bp))).FbldFlags2)&int32(SQLITE_BLDF2_2NDPASS) != 0 { for (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpLoops != 0 { p = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpLoops (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpLoops = (*TWhereLoop)(unsafe.Pointer(p)).FpNextLoop @@ -149183,19 +143349,17 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere /* TUNING: Assume that a DISTINCT clause on a subquery reduces ** the output size by a factor of 8 (LogEst -30). */ - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p10 = pWInfo + 50 *(*TLogEst)(unsafe.Pointer(p10)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p10))) - libc.Int32FromInt32(30)) } } - _ = libc.Int32FromInt32(0) if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ReverseOrder) != uint64(0) { _whereReverseScanOrder(tls, pWInfo) } if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto whereBeginError } - _ = libc.Int32FromInt32(0) /* Attempt to omit tables from a join that do not affect the result. ** See the comment on whereOmitNoopJoin() for further information. ** @@ -149207,15 +143371,14 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** in-line sqlite3WhereCodeOneLoopStart() for performance reasons. */ notReady = ^libc.Uint64FromInt32(0) - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && pResultSet != uintptr(0) && 0 == int32(wctrlFlags)&int32(WHERE_AGG_DISTINCT) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OmitNoopJoin)) == uint32(0) { + if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && pResultSet != uintptr(0) && 0 == libc.Int32FromUint16(wctrlFlags)&(libc.Int32FromInt32(WHERE_AGG_DISTINCT)|libc.Int32FromInt32(WHERE_KEEP_ALL_JOINS)) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OmitNoopJoin)) == uint32(0) { notReady = _whereOmitNoopJoin(tls, pWInfo, notReady) - nTabList = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - _ = libc.Int32FromInt32(0) + nTabList = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) } /* Check to see if there are any SEARCH loops that might benefit from ** using a Bloom filter. */ - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { + if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } p11 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 156 @@ -149239,23 +143402,21 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** use a one-pass approach, and this is not set accurately for scans ** that use the OR optimization. */ - _ = libc.Int32FromInt32(0) - if int32(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = int32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FpWLoop)).FwsFlags) + if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { + wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) - _ = libc.Int32FromInt32(0) - if bOnerow != 0 || 0 != int32(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || int32(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { + if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { v12 = int32(ONEPASS_SINGLE) } else { v12 = int32(ONEPASS_MULTI) } - (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = uint8(v12) + (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = libc.Uint8FromInt32(v12) if (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && wsFlags&int32(WHERE_IDX_ONLY) != 0 { - if int32(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { + if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FpWLoop)).FwsFlags = uint32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -149272,7 +143433,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Ephemeral) != uint32(0) || int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Ephemeral) != uint32(0) || libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { /* Do nothing */ } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { @@ -149280,18 +143441,17 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iCur = (*TSrcItem)(unsafe.Pointer(pTabItem)).FiCursor _sqlite3VdbeAddOp4(tls, v, int32(OP_VOpen), iCur, 0, 0, pVTab, -int32(11)) } else { - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { /* noop */ } else { - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IDX_ONLY) == uint32(0) && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 || int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IDX_ONLY) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { op = int32(OP_OpenRead) - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF { + if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF { op = int32(OP_OpenWrite) *(*int32)(unsafe.Pointer(pWInfo + 20)) = (*TSrcItem)(unsafe.Pointer(pTabItem)).FiCursor } _sqlite3OpenTable(tls, pParse, (*TSrcItem)(unsafe.Pointer(pTabItem)).FiCursor, iDb, pTab, op) - _ = libc.Int32FromInt32(0) - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF && int32((*TTable)(unsafe.Pointer(pTab)).FnCol) < int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(libc.Int32FromInt32(TF_HasGenerated)|libc.Int32FromInt32(TF_WithoutRowid)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_AUTO_INDEX)|libc.Int32FromInt32(WHERE_BLOOMFILTER)) == uint32(0) { + if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF && int32((*TTable)(unsafe.Pointer(pTab)).FnCol) < libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_HasGenerated)|libc.Int32FromInt32(TF_WithoutRowid)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_AUTO_INDEX)|libc.Int32FromInt32(WHERE_BLOOMFILTER)) == uint32(0) { /* If we know that only a prefix of the record will be used, ** it is advantageous to reduce the "column count" field in ** the P4 operand of the OP_OpenRead/Write opcode. */ @@ -149308,7 +143468,6 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere n++ } _sqlite3VdbeChangeP4(tls, v, -int32(1), uintptr(n), -int32(3)) - _ = libc.Int32FromInt32(0) } _sqlite3VdbeChangeP5(tls, v, uint16(bFordelete)) } else { @@ -149321,17 +143480,15 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere pIx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex op1 = int32(OP_OpenRead) /* iAuxArg is always set to a positive value if ONEPASS is possible */ - _ = libc.Int32FromInt32(0) - if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { + if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { /* This is one term of an OR-optimization using the PRIMARY KEY of a ** WITHOUT ROWID table. No need for a separate index */ iIndexCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur op1 = 0 } else { - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF { + if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF { pJ = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab)).FpIndex iIndexCur = iAuxArg - _ = libc.Int32FromInt32(0) for pJ != 0 && pJ != pIx { iIndexCur++ pJ = (*TIndex)(unsafe.Pointer(pJ)).FpNext @@ -149339,7 +143496,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere op1 = int32(OP_OpenWrite) *(*int32)(unsafe.Pointer(pWInfo + 20 + 1*4)) = iIndexCur } else { - if iAuxArg != 0 && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { + if iAuxArg != 0 && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { @@ -149347,23 +143504,20 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere v15 = *(*int32)(unsafe.Pointer(v16)) *(*int32)(unsafe.Pointer(v16))++ iIndexCur = v15 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } - if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { _wherePartIdxExpr(tls, pParse, pIx, (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere, uintptr(0), iIndexCur, pTabItem) } } } } (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = iIndexCur - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if op1 != 0 { - _sqlite3VdbeAddOp3(tls, v, op1, iIndexCur, int32((*TIndex)(unsafe.Pointer(pIx)).Ftnum), iDb) + _sqlite3VdbeAddOp3(tls, v, op1, iIndexCur, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIx)).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIx) - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_CONSTRAINT) != uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_COLUMN_RANGE)|libc.Int32FromInt32(WHERE_SKIPSCAN)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IN_SEEKSCAN) == uint32(0) && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_ORDERBY_MIN) == 0 && int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != int32(WHERE_DISTINCT_ORDERED) { + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_CONSTRAINT) != uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_RANGE)|libc.Int32FromInt32(WHERE_SKIPSCAN)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IN_SEEKSCAN) == uint32(0) && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_ORDERBY_MIN) == 0 && libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != int32(WHERE_DISTINCT_ORDERED) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SEEKEQ)) } } @@ -149371,7 +143525,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if iDb >= 0 { _sqlite3CodeVerifySchema(tls, pParse, iDb) } - if v18 = int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0; v18 { + if v18 = libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0; v18 { v17 = _sqlite3WhereMalloc(tls, pWInfo, uint64(20)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ = v17 } @@ -149391,7 +143545,6 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere v23 = *(*int32)(unsafe.Pointer(v24)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v23 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn) - _ = libc.Int32FromInt32(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch, int32(1)) pInfo = _sqlite3KeyInfoAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(1), 0) @@ -149402,10 +143555,10 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch, int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk) } - *(*Tu32)(unsafe.Pointer(pLoop + 40)) &= uint32(^libc.Int32FromInt32(WHERE_IDX_ONLY)) + *(*Tu32)(unsafe.Pointer(pLoop + 40)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(WHERE_IDX_ONLY)) /* The nature of RIGHT JOIN processing is such that it messes up ** the output order. So omit any ORDER BY/GROUP BY elimination ** optimizations. We need to do an actual sort for RIGHT JOIN. */ @@ -149435,7 +143588,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 752 + uintptr(ii)*84 - wsFlags1 = int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*68 if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x10>>4)) != 0 { if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x8>>3)) != 0 { @@ -149446,7 +143599,6 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere _sqlite3VdbeJumpHere(tls, v, iOnce) } } - _ = libc.Int32FromInt32(0) if wsFlags1&(libc.Int32FromInt32(WHERE_AUTO_INDEX)|libc.Int32FromInt32(WHERE_BLOOMFILTER)) != 0 { if wsFlags1&int32(WHERE_AUTO_INDEX) != 0 { _constructAutomaticIndex(tls, pParse, pWInfo+76, notReady, pLevel) @@ -149461,7 +143613,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBody = _sqlite3VdbeCurrentAddr(tls, v) notReady = _sqlite3WhereCodeOneLoopStart(tls, pParse, v, pWInfo, ii, pLevel, notReady) (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiContinue = (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrCont - if wsFlags1&int32(WHERE_MULTI_OR) == 0 && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if wsFlags1&int32(WHERE_MULTI_OR) == 0 && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { _ = addrExplain } goto _25 @@ -149509,7 +143661,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { nRJ = 0 /* Generate loop termination code. */ - i = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - int32(1) + i = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - int32(1) for { if !(i >= 0) { break @@ -149526,14 +143678,14 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { nRJ++ } pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - if int32((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) != int32(OP_Noop) { + if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) != int32(OP_Noop) { addrSeek = 0 - if v3 = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == int32(WHERE_DISTINCT_ORDERED) && i == int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-int32(1) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_INDEXED) != uint32(0); v3 { + if v3 = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == int32(WHERE_DISTINCT_ORDERED) && i == libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-int32(1) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_INDEXED) != uint32(0); v3 { v2 = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex pIdx = v2 } if v5 = v3 && int32(uint32(*(*uint16)(unsafe.Pointer(v2 + 56))&0x80>>7)) != 0; v5 { - v4 = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol) + v4 = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol) n = v4 } if v5 && v4 > 0 && int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(n)*2))) >= int32(36) { @@ -149550,7 +143702,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { j++ } *(*int32)(unsafe.Pointer(pParse + 44)) += n + int32(1) - if int32((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { + if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { v7 = int32(OP_SeekGT) @@ -149563,7 +143715,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { if (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrCont != 0 { _sqlite3VdbeResolveLabel(tls, v, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrCont) } - _sqlite3VdbeAddOp3(tls, v, int32((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop), (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1, (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2, int32((*TWhereLevel)(unsafe.Pointer(pLevel)).Fp3)) + _sqlite3VdbeAddOp3(tls, v, libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop), (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1, (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2, libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fp3)) _sqlite3VdbeChangeP5(tls, v, uint16((*TWhereLevel)(unsafe.Pointer(pLevel)).Fp5)) if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregBignull != 0 { _sqlite3VdbeResolveLabel(tls, v, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBignull) @@ -149594,9 +143746,8 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { if !(j1 > 0) { break } - _ = libc.Int32FromInt32(0) _sqlite3VdbeJumpHere(tls, v, (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop+int32(1)) - if int32((*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp) != int32(OP_Noop) { + if libc.Int32FromUint8((*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp) != int32(OP_Noop) { if (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix != 0 { bEarlyOut = libc.BoolInt32((*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IN_EARLYOUT) != uint32(0)) if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 { @@ -149619,7 +143770,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { _sqlite3VdbeJumpHere(tls, v, (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop+int32(1)) } } - _sqlite3VdbeAddOp2(tls, v, int32((*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp), (*TInLoop)(unsafe.Pointer(pIn)).FiCur, (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop) + _sqlite3VdbeAddOp2(tls, v, libc.Int32FromUint8((*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp), (*TInLoop)(unsafe.Pointer(pIn)).FiCur, (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop) } _sqlite3VdbeJumpHere(tls, v, (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop-int32(1)) goto _8 @@ -149639,15 +143790,12 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { _sqlite3VdbeJumpHere(tls, v, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip-int32(2)) } if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 { - ws = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags) + ws = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfPos), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin) - _ = libc.Int32FromInt32(0) if ws&int32(WHERE_IDX_ONLY) == 0 { pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*68 - _ = libc.Int32FromInt32(0) if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x20>>5)) != 0 { n1 = (*TSrcItem)(unsafe.Pointer(pSrc)).FregResult - _ = libc.Int32FromInt32(0) m = int32((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpTab)).FnCol) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, n1, n1+m-int32(1)) } @@ -149657,12 +143805,12 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { if ws&int32(WHERE_MULTI_OR) != 0 { pIx = *(*uintptr)(unsafe.Pointer(&(*TWhereLevel)(unsafe.Pointer(pLevel)).Fu)) iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIx)).FpSchema) - _sqlite3VdbeAddOp3(tls, v, int32(OP_ReopenIdx), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, int32((*TIndex)(unsafe.Pointer(pIx)).Ftnum), iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_ReopenIdx), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIx)).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIx) } _sqlite3VdbeAddOp1(tls, v, int32(OP_NullRow), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur) } - if int32((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Return) { + if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Return) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrFirst) } else { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrFirst) @@ -149674,17 +143822,15 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; i-- } - _ = libc.Int32FromInt32(0) i = 0 pLevel = pWInfo + 752 for { - if !(i < int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { + if !(i < libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { break } pIdx1 = uintptr(0) pTabItem = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*68 pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab - _ = libc.Int32FromInt32(0) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop /* Do RIGHT JOIN processing. Generate code that will output the ** unmatched rows of the right operand of the RIGHT JOIN with @@ -149699,7 +143845,6 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ** OP_Rowid becomes OP_Null. */ if int32(uint32(*(*uint16)(unsafe.Pointer(pTabItem + 36 + 4))&0x20>>5)) != 0 { - _ = libc.Int32FromInt32(0) _translateColumnToCopy(tls, pParse, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBody, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (*TSrcItem)(unsafe.Pointer(pTabItem)).FregResult, 0) goto _9 } @@ -149714,7 +143859,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ** that reference the table and converts them into opcodes that ** reference the index. */ - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_INDEXED)|libc.Int32FromInt32(WHERE_IDX_ONLY)) != 0 { + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_INDEXED)|libc.Int32FromInt32(WHERE_IDX_ONLY)) != 0 { pIdx1 = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { @@ -149722,7 +143867,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } } if pIdx1 != 0 && !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF || !((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx1)).FpTable)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { + if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF || !((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx1)).FpTable)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { last = iEnd } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere @@ -149740,21 +143885,18 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { k = (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBody + int32(1) pOp = _sqlite3VdbeGetOp(tls, v, k) pLastOp = pOp + uintptr(last-k)*20 - _ = libc.Int32FromInt32(0) for { if (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 != (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur { /* no-op */ } else { - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) || int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Offset) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) || libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Offset) { x = (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 - _ = libc.Int32FromInt32(0) - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Offset) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Offset) { /* Do not need to translate the column number */ } else { if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) x = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(x)*2))) - _ = libc.Int32FromInt32(0) } else { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } @@ -149768,14 +143910,17 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ** reference. Verify that this is harmless - that the ** table being referenced really is open. */ - _ = libc.Int32FromInt32(0) + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IDX_ONLY) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22701, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) + } } } else { - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Rowid) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Rowid) { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = uint8(OP_IdxRowid) } else { - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_IfNullRow) { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_IfNullRow) { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur } } @@ -150074,7 +144219,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22701, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22730, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -150157,7 +144302,6 @@ func _percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintpt var p uintptr _ = p _ = nArg - _ = libc.Int32FromInt32(0) _ = apArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(24)) if p != 0 { @@ -150169,7 +144313,6 @@ func _percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr var p uintptr _ = p _ = nArg - _ = libc.Int32FromInt32(0) _ = apArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(24)) (*TCallCount)(unsafe.Pointer(p)).FnStep++ @@ -150203,7 +144346,6 @@ func _cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) var p uintptr _ = p _ = nArg - _ = libc.Int32FromInt32(0) _ = apArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(24)) if p != 0 { @@ -150215,7 +144357,6 @@ func _cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { var p uintptr _ = p _ = nArg - _ = libc.Int32FromInt32(0) _ = apArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(24)) (*TCallCount)(unsafe.Pointer(p)).FnStep++ @@ -150254,14 +144395,13 @@ type NtileCtx = TNtileCtx func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { var p uintptr _ = p - _ = libc.Int32FromInt32(0) _ = nArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(24)) if p != 0 { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22757, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22786, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -150271,7 +144411,6 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { func _ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { var p uintptr _ = p - _ = libc.Int32FromInt32(0) _ = nArg _ = apArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(24)) @@ -150292,7 +144431,6 @@ func _ntileValueFunc(tls *libc.TLS, pCtx uintptr) { nLarge = (*TNtileCtx)(unsafe.Pointer(p)).FnTotal - (*TNtileCtx)(unsafe.Pointer(p)).FnParam*int64(nSize) iSmall = nLarge * int64(nSize+libc.Int32FromInt32(1)) iRow = (*TNtileCtx)(unsafe.Pointer(p)).FiRow - _ = libc.Int32FromInt32(0) if iRow < iSmall { Xsqlite3_result_int64(tls, pCtx, int64(1)+iRow/int64(nSize+libc.Int32FromInt32(1))) } else { @@ -150403,10 +144541,10 @@ var _lagName = [4]int8{'l', 'a', 'g'} // */ func _noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /*NO_TEST*/ - _ = p /*NO_TEST*/ - _ = n /*NO_TEST*/ - _ = a /*NO_TEST*/ - _ = libc.Int32FromInt32(0) /*NO_TEST*/ + _ = p /*NO_TEST*/ + _ = n /*NO_TEST*/ + _ = a /*NO_TEST*/ + /*NO_TEST*/ } /*NO_TEST*/ @@ -150430,78 +144568,78 @@ func _noopValueFunc(tls *libc.TLS, p uintptr) { // ** Register those built-in window functions that are not also aggregates. // */ func _sqlite3WindowFunctions(tls *libc.TLS) { - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aWindowFuncs)), int32(libc.Uint32FromInt64(600)/libc.Uint32FromInt64(40))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aWindowFuncs)), libc.Int32FromUint32(libc.Uint32FromInt64(600)/libc.Uint32FromInt64(40))) } var _aWindowFuncs = [15]TFuncDef{ 0: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_row_numberName)), }, 1: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_dense_rankName)), }, 2: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_rankName)), }, 3: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_percent_rankName)), }, 4: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_cume_distName)), }, 5: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_ntileName)), }, 6: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_last_valueName)), }, 7: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_nth_valueName)), }, 8: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_first_valueName)), }, 9: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_leadName)), }, 10: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_leadName)), }, 11: { FnArg: int8(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_leadName)), }, 12: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_lagName)), }, 13: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_lagName)), }, 14: { FnArg: int8(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_lagName)), }, } @@ -150589,7 +144727,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22802, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22831, libc.VaList(bp+8, zName)) } return p } @@ -150623,7 +144761,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin var db, p, v2 uintptr var i int32 _, _, _, _, _ = aUp, db, i, p, v2 - if (*TWindow)(unsafe.Pointer(pWin)).FzName != 0 && int32((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == 0 { + if (*TWindow)(unsafe.Pointer(pWin)).FzName != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == 0 { p = _windowFind(tls, pParse, pList, (*TWindow)(unsafe.Pointer(pWin)).FzName) if p == uintptr(0) { return @@ -150639,13 +144777,13 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin } else { _sqlite3WindowChain(tls, pParse, pWin, pList) } - if int32((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22821, 0) + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22850, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22892, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22921, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -150704,7 +144842,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin } i = 0 for { - if !(i < int32(libc.Uint32FromInt64(128)/libc.Uint32FromInt64(16))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(128)/libc.Uint32FromInt64(16))) { break } if (*TFuncDef)(unsafe.Pointer(pFunc)).FzName == aUp[i].FzFunc { @@ -150713,11 +144851,11 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin v2 = libc.UintptrFromInt32(0) (*TWindow)(unsafe.Pointer(pWin)).FpStart = v2 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = v2 - (*TWindow)(unsafe.Pointer(pWin)).FeFrmType = uint8(aUp[i].FeFrmType) - (*TWindow)(unsafe.Pointer(pWin)).FeStart = uint8(aUp[i].FeStart) - (*TWindow)(unsafe.Pointer(pWin)).FeEnd = uint8(aUp[i].FeEnd) + (*TWindow)(unsafe.Pointer(pWin)).FeFrmType = libc.Uint8FromInt32(aUp[i].FeFrmType) + (*TWindow)(unsafe.Pointer(pWin)).FeStart = libc.Uint8FromInt32(aUp[i].FeStart) + (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) - if int32((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8255) } break @@ -150772,15 +144910,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( _, _, _, _, _, _, _, _, _, _ = f, i, i1, iCol, nSrc, p, pDup, pParse, pWin, v4 p = *(*uintptr)(unsafe.Pointer(pWalker + 24)) pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If this function is being called from within a scalar sub-select ** that used by the SELECT statement being processed, only process ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc @@ -150802,9 +144938,9 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( } } } - switch int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) { + switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) { case int32(TK_FUNCTION): - if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { + if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin @@ -150813,7 +144949,6 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( break } if *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)) == pWin { - _ = libc.Int32FromInt32(0) return int32(WRC_Prune) } goto _2 @@ -150850,17 +144985,16 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( } if iCol < 0 { pDup = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) - if pDup != 0 && int32((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { + if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) } if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { - f = int32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) - _ = libc.Int32FromInt32(0) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_Static)) + f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint32(52)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { @@ -150871,7 +145005,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab - (*TExpr)(unsafe.Pointer(pExpr)).Fflags = uint32(f) + (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) @@ -150917,7 +145051,6 @@ func _selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc defer tls.Free(48) var _ /* sRewrite at bp+28 */ TWindowRewrite var _ /* sWalker at bp+0 */ TWalker - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp, 0, uint32(28)) libc.Xmemset(tls, bp+28, 0, uint32(20)) (*(*TWindowRewrite)(unsafe.Pointer(bp + 28))).FpSub = *(*uintptr)(unsafe.Pointer(ppSub)) @@ -150967,7 +145100,7 @@ func _exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend u pSub = _sqlite3ExprSkipCollateAndLikely(tls, pDup) if _sqlite3ExprIsInteger(tls, pSub, bp) != 0 { (*TExpr)(unsafe.Pointer(pSub)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= uint32(^(libc.Int32FromInt32(EP_IntValue) | libc.Int32FromInt32(EP_IsTrue) | libc.Int32FromInt32(EP_IsFalse))) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_IntValue) | libc.Int32FromInt32(EP_IsTrue) | libc.Int32FromInt32(EP_IsFalse))) *(*uintptr)(unsafe.Pointer(pSub + 8)) = uintptr(0) } } @@ -150995,7 +145128,7 @@ func _exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend u // ** See also the incrAggDepth() routine in resolve.c // */ func _sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2) >= (*TWalker)(unsafe.Pointer(pWalker)).FwalkerDepth { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2) >= (*TWalker)(unsafe.Pointer(pWalker)).FwalkerDepth { (*TExpr)(unsafe.Pointer(pExpr)).Fop2++ } return WRC_Continue @@ -151004,9 +145137,8 @@ func _sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintp func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _ = libc.Int32FromInt32(0) - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+22955, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+22984, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -151030,7 +145162,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { var _ /* w at bp+4 */ TWalker _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, nSave, pArgs, pFilter, pGroupBy, pHaving, pMWin, pSort, pSrc, pSub, pTab, pTab2, pWhere, pWin, rc, selFlags, v, v1, v10, v2, v3, v5, v6, v7, v8, v9 rc = SQLITE_OK - if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 && (*TSelect)(unsafe.Pointer(p)).FpPrior == uintptr(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_WinRewrite) == uint32(0) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 && (*TSelect)(unsafe.Pointer(p)).FpPrior == uintptr(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_WinRewrite) == uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { v = _sqlite3GetVdbe(tls, pParse) db = (*TParse)(unsafe.Pointer(pParse)).Fdb pSub = uintptr(0) /* The subquery */ @@ -151057,7 +145189,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -151103,8 +145235,6 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if !(pWin != 0) { break } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pArgs = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 20)) if (*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 { _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, pArgs, pTab, bp) @@ -151153,14 +145283,14 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) - _ = libc.Int32FromInt32(0) /* Due to db->mallocFailed test inside + /* Due to db->mallocFailed test inside ** of sqlite3DbMallocRawNN() called from ** sqlite3SrcListAppend() */ if (*TSelect)(unsafe.Pointer(p)).FpSrc != 0 { (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect = pSub libc.SetBitFieldPtr16Uint32((*TSelect)(unsafe.Pointer(p)).FpSrc+8+36+4, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3SrcListAssignCursors(tls, pParse, (*TSelect)(unsafe.Pointer(p)).FpSrc) - *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(libc.Int32FromInt32(SF_Expanded) | libc.Int32FromInt32(SF_OrderByReqd)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SF_Expanded) | libc.Int32FromInt32(SF_OrderByReqd)) pTab2 = _sqlite3ResultSetOfSelect(tls, pParse, pSub, int8(SQLITE_AFF_NONE)) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= selFlags & uint32(SF_Aggregate) if pTab2 == uintptr(0) { @@ -151190,7 +145320,6 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** result-set or ORDER BY clause of the SELECT statement p. */ _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DbFree), pTab) } - _ = libc.Int32FromInt32(0) return rc } @@ -151255,7 +145384,7 @@ func _sqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { // */ func _sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintptr) { if 0 == _sqlite3ExprIsConstant(tls, uintptr(0), pExpr) { - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameExprUnmap(tls, pParse, pExpr) } _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -151276,11 +145405,6 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 pWin = uintptr(0) bImplicitFrame = 0 /* Parser assures the following: */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if eType == 0 { bImplicitFrame = int32(1) eType = int32(TK_RANGE) @@ -151300,21 +145424,21 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22981, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23010, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(100)) if pWin == uintptr(0) { goto windowAllocErr } - (*TWindow)(unsafe.Pointer(pWin)).FeFrmType = uint8(eType) - (*TWindow)(unsafe.Pointer(pWin)).FeStart = uint8(eStart) - (*TWindow)(unsafe.Pointer(pWin)).FeEnd = uint8(eEnd) - if int32(eExclude) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_WindowFunc)) != uint32(0) { + (*TWindow)(unsafe.Pointer(pWin)).FeFrmType = libc.Uint8FromInt32(eType) + (*TWindow)(unsafe.Pointer(pWin)).FeStart = libc.Uint8FromInt32(eStart) + (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(eEnd) + if libc.Int32FromUint8(eExclude) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_WindowFunc)) != uint32(0) { eExclude = uint8(TK_NO) } (*TWindow)(unsafe.Pointer(pWin)).FeExclude = eExclude - (*TWindow)(unsafe.Pointer(pWin)).FbImplicitFrame = uint8(bImplicitFrame) + (*TWindow)(unsafe.Pointer(pWin)).FbImplicitFrame = libc.Uint8FromInt32(bImplicitFrame) (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin @@ -151368,22 +145492,21 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23013 + zErr = __ccgo_ts + 23042 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23030 + zErr = __ccgo_ts + 23059 } else { - if int32((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23046 + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { + zErr = __ccgo_ts + 23075 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23066, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23095, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { - _ = libc.Int32FromInt32(0) (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy, 0) } _sqlite3DbFree(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FzBase) @@ -151400,14 +145523,11 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint // */ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr) { if p != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(p)).Fy)) = pWin - *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) + *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p - if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && int32((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23099, 0) + if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23128, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -151452,16 +145572,16 @@ func _sqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr if p1 == uintptr(0) || p2 == uintptr(0) { return int32(1) } - if int32((*TWindow)(unsafe.Pointer(p1)).FeFrmType) != int32((*TWindow)(unsafe.Pointer(p2)).FeFrmType) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(p1)).FeFrmType) != libc.Int32FromUint8((*TWindow)(unsafe.Pointer(p2)).FeFrmType) { return int32(1) } - if int32((*TWindow)(unsafe.Pointer(p1)).FeStart) != int32((*TWindow)(unsafe.Pointer(p2)).FeStart) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(p1)).FeStart) != libc.Int32FromUint8((*TWindow)(unsafe.Pointer(p2)).FeStart) { return int32(1) } - if int32((*TWindow)(unsafe.Pointer(p1)).FeEnd) != int32((*TWindow)(unsafe.Pointer(p2)).FeEnd) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(p1)).FeEnd) != libc.Int32FromUint8((*TWindow)(unsafe.Pointer(p2)).FeEnd) { return int32(1) } - if int32((*TWindow)(unsafe.Pointer(p1)).FeExclude) != int32((*TWindow)(unsafe.Pointer(p2)).FeExclude) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(p1)).FeExclude) != libc.Int32FromUint8((*TWindow)(unsafe.Pointer(p2)).FeExclude) { return int32(1) } if _sqlite3ExprCompare(tls, pParse, (*TWindow)(unsafe.Pointer(p1)).FpStart, (*TWindow)(unsafe.Pointer(p2)).FpStart, -int32(1)) != 0 { @@ -151545,8 +145665,7 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { break } p = (*TWindow)(unsafe.Pointer(pWin)).FpWFunc - if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && int32((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { - _ = libc.Int32FromInt32(0) + if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 20)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) v11 = pParse + 40 @@ -151556,7 +145675,6 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { - _ = libc.Int32FromInt32(0) *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, int32(2)) @@ -151605,17 +145723,14 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _, _, _ = regString, regZero, v v = _sqlite3GetVdbe(tls, pParse) regZero = _sqlite3GetTempReg(tls, pParse) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1662, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) - _sqlite3VdbeChangeP5(tls, v, uint16(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) - _ = libc.Int32FromInt32(0) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_MustBeInt), reg, _sqlite3VdbeCurrentAddr(tls, v)+int32(2)) - _ = libc.Int32FromInt32(0) } _sqlite3VdbeAddOp3(tls, v, _aOp1[eCond], regZero, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, uint16(SQLITE_AFF_NUMERIC)) @@ -151630,11 +145745,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23146, - 1: __ccgo_ts + 23199, - 2: __ccgo_ts + 22701, - 3: __ccgo_ts + 23250, - 4: __ccgo_ts + 23302, + 0: __ccgo_ts + 23175, + 1: __ccgo_ts + 23228, + 2: __ccgo_ts + 22730, + 3: __ccgo_ts + 23279, + 4: __ccgo_ts + 23331, } var _aOp1 = [5]int32{ @@ -151655,7 +145770,6 @@ func _windowArgCount(tls *libc.TLS, pWin uintptr) (r int32) { var pList uintptr var v1 int32 _, _ = pList, v1 - _ = libc.Int32FromInt32(0) pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 20)) if pList != 0 { v1 = (*TExprList)(unsafe.Pointer(pList)).FnExpr @@ -151843,10 +145957,8 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse v2 = _windowArgCount(tls, pWin) } nArg = v2 - _ = libc.Int32FromInt32(0) /* All OVER clauses in the same window function aggregate step must ** be the same. */ - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < nArg) { @@ -151863,7 +145975,7 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse i++ } regArg = reg - if (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid == 0 && (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && int32((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { + if (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid == 0 && (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { addrIsNull = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), regArg) if bInverse == 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), (*TWindow)(unsafe.Pointer(pWin)).FregApp+int32(1), int32(1)) @@ -151878,16 +145990,11 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse _sqlite3VdbeJumpHere(tls, v, addrIsNull) } else { if (*TWindow)(unsafe.Pointer(pWin)).FregApp != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), (*TWindow)(unsafe.Pointer(pWin)).FregApp+int32(1)-bInverse, int32(1)) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc != __ccgo_fp(_noopStepFunc) { addrIf = 0 if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) regTmp = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), csr, (*TWindow)(unsafe.Pointer(pWin)).FiArgCol+nArg, regTmp) addrIf = _sqlite3VdbeAddOp3(tls, v, int32(OP_IfNot), regTmp, 0, int32(1)) @@ -151895,7 +146002,6 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse } if (*TWindow)(unsafe.Pointer(pWin)).FbExprArgs != 0 { iOp = _sqlite3VdbeCurrentAddr(tls, v) - _ = libc.Int32FromInt32(0) nArg = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 20)))).FnExpr regArg = _sqlite3GetTempRange(tls, pParse, nArg) _sqlite3ExprCodeExprList(tls, pParse, *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 20)), regArg, 0, uint8(0)) @@ -151905,7 +146011,7 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse break } pOp = _sqlite3VdbeGetOp(tls, v, iOp) - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 == (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 == (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = csr } goto _4 @@ -151915,8 +146021,6 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse } } if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pColl = _sqlite3ExprNNCollSeq(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 20)) + 8))).FpExpr) _sqlite3VdbeAddOp4(tls, v, int32(OP_CollSeq), 0, 0, 0, pColl, -int32(2)) } @@ -151927,7 +146031,7 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse } _sqlite3VdbeAddOp3(tls, v, v5, bInverse, regArg, (*TWindow)(unsafe.Pointer(pWin)).FregAccum) _sqlite3VdbeAppendP4(tls, v, pFunc, -int32(7)) - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(nArg))) + _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(nArg))) if (*TWindow)(unsafe.Pointer(pWin)).FbExprArgs != 0 { _sqlite3ReleaseTempRange(tls, pParse, regArg, nArg) } @@ -151968,14 +146072,13 @@ func _windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { if !(pWin != 0) { break } - if (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid == 0 && (*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && int32((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { + if (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid == 0 && (*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pWin)).FregResult) _sqlite3VdbeAddOp1(tls, v, int32(OP_Last), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, 0, (*TWindow)(unsafe.Pointer(pWin)).FregResult) _sqlite3VdbeJumpHere(tls, v, _sqlite3VdbeCurrentAddr(tls, v)-int32(2)) } else { if (*TWindow)(unsafe.Pointer(pWin)).FregApp != 0 { - _ = libc.Int32FromInt32(0) } else { nArg = _windowArgCount(tls, pWin) if bFin != 0 { @@ -152015,7 +146118,6 @@ func _windowFullScan(tls *libc.TLS, p uintptr) { regCPeer = 0 /* Current peer values */ regRowid = 0 /* AggStep rowid value */ regPeer = 0 - _ = libc.Int32FromInt32(0) csr = (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp if (*TWindow)(unsafe.Pointer(pMWin)).FpOrderBy != 0 { v1 = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpOrderBy)).FnExpr @@ -152048,16 +146150,16 @@ func _windowFullScan(tls *libc.TLS, p uintptr) { addrNext = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), csr, regRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Gt), (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid, lblBrk, regRowid) - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeExclude) == int32(TK_CURRENT) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeExclude) == int32(TK_CURRENT) { _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), regCRowid, lblNext, regRowid) } else { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeExclude) != int32(TK_NO) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeExclude) != int32(TK_NO) { addrEq = 0 pKeyInfo = uintptr(0) if (*TWindow)(unsafe.Pointer(pMWin)).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*TWindow)(unsafe.Pointer(pMWin)).FpOrderBy, 0, 0) } - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeExclude) == int32(TK_TIES) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeExclude) == int32(TK_TIES) { addrEq = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), regCRowid, 0, regRowid) } if pKeyInfo != 0 { @@ -152119,7 +146221,6 @@ func _windowReturnOneRow(tls *libc.TLS, p uintptr) { break } pFunc = (*TWindow)(unsafe.Pointer(pWin)).FpWFunc - _ = libc.Int32FromInt32(0) if (*TFuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&_nth_valueName)) || (*TFuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&_first_valueName)) { csr = (*TWindow)(unsafe.Pointer(pWin)).FcsrApp lbl = _sqlite3VdbeMakeLabel(tls, pParse) @@ -152205,7 +146306,6 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { break } pFunc = (*TWindow)(unsafe.Pointer(pWin)).FpWFunc - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pWin)).FregAccum) if nArg > _windowArgCount(tls, pWin) { v2 = nArg @@ -152219,7 +146319,6 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, (*TWindow)(unsafe.Pointer(pWin)).FregApp+int32(1)) } if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && (*TWindow)(unsafe.Pointer(pWin)).FcsrApp != 0 { - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp1(tls, v, int32(OP_ResetSorter), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, (*TWindow)(unsafe.Pointer(pWin)).FregApp+int32(1)) } @@ -152335,16 +146434,13 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal /* Read the peer-value from each cursor into a register */ _windowReadPeerValues(tls, p, csr1, reg1) _windowReadPeerValues(tls, p, csr2, reg2) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC) != 0 { + if libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC) != 0 { switch op { case int32(OP_Ge): op = int32(OP_Le) case int32(OP_Gt): op = int32(OP_Lt) default: - _ = libc.Int32FromInt32(0) op = int32(OP_Ge) break } @@ -152369,7 +146465,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** Additionally, if either reg1 or reg2 are NULL but the jump to lbl is ** not taken, control jumps over the comparison operator coded below this ** block. */ - if int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_BIGNULL) != 0 { + if libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_BIGNULL) != 0 { /* This block runs if reg1 contains a NULL. */ addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_NotNull), reg1) switch op { @@ -152379,8 +146475,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), reg2, lbl) case int32(OP_Le): _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), reg2, lbl) - default: - _ = libc.Int32FromInt32(0) /* no-op */ + default: /* no-op */ break } _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, addrDone) @@ -152421,7 +146516,6 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal _sqlite3VdbeAppendP4(tls, v, pColl, -int32(2)) _sqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) _sqlite3VdbeResolveLabel(tls, v, addrDone) - _ = libc.Int32FromInt32(0) _sqlite3ReleaseTempReg(tls, pParse, reg1) _sqlite3ReleaseTempReg(tls, pParse, reg2) } @@ -152443,21 +146537,19 @@ func _windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpO ret = 0 v = (*TWindowCodeArg)(unsafe.Pointer(p)).FpVdbe addrContinue = 0 - bPeer = libc.BoolInt32(int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_ROWS)) + bPeer = libc.BoolInt32(libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_ROWS)) lblDone = _sqlite3VdbeMakeLabel(tls, pParse) addrNextRange = 0 /* Special case - WINDOW_AGGINVERSE is always a no-op if the frame ** starts with UNBOUNDED PRECEDING. */ - if op == int32(WINDOW_AGGINVERSE) && int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_UNBOUNDED) { - _ = libc.Int32FromInt32(0) + if op == int32(WINDOW_AGGINVERSE) && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_UNBOUNDED) { return 0 } if regCountdown > 0 { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { addrNextRange = _sqlite3VdbeCurrentAddr(tls, v) - _ = libc.Int32FromInt32(0) if op == int32(WINDOW_AGGINVERSE) { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { _windowCodeRangeTest(tls, p, int32(OP_Le), (*TWindowCodeArg)(unsafe.Pointer(p)).Fcurrent.Fcsr, regCountdown, (*TWindowCodeArg)(unsafe.Pointer(p)).Fstart.Fcsr, lblDone) } else { _windowCodeRangeTest(tls, p, int32(OP_Ge), (*TWindowCodeArg)(unsafe.Pointer(p)).Fstart.Fcsr, regCountdown, (*TWindowCodeArg)(unsafe.Pointer(p)).Fcurrent.Fcsr, lblDone) @@ -152479,7 +146571,7 @@ func _windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpO ** temporary table. It otherwise might, if (a>b). Also ensure that, ** if the input cursor is still finding new rows, that the end ** cursor does not go past it to EOF. */ - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) && regCountdown != 0 && int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) && regCountdown != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { regRowid1 = _sqlite3GetTempReg(tls, pParse) regRowid2 = _sqlite3GetTempReg(tls, pParse) if op == int32(WINDOW_AGGINVERSE) { @@ -152494,7 +146586,6 @@ func _windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpO } _sqlite3ReleaseTempReg(tls, pParse, regRowid1) _sqlite3ReleaseTempReg(tls, pParse, regRowid2) - _ = libc.Int32FromInt32(0) } switch op { case int32(WINDOW_RETURN_ROW): @@ -152505,17 +146596,14 @@ func _windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpO csr = (*TWindowCodeArg)(unsafe.Pointer(p)).Fstart.Fcsr reg = (*TWindowCodeArg)(unsafe.Pointer(p)).Fstart.Freg if (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid != 0 { - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid, int32(1)) } else { _windowAggStep(tls, p, pMWin, csr, int32(1), (*TWindowCodeArg)(unsafe.Pointer(p)).FregArg) } default: - _ = libc.Int32FromInt32(0) csr = (*TWindowCodeArg)(unsafe.Pointer(p)).Fend.Fcsr reg = (*TWindowCodeArg)(unsafe.Pointer(p)).Fend.Freg if (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid != 0 { - _ = libc.Int32FromInt32(0) _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid, int32(1)) } else { _windowAggStep(tls, p, pMWin, csr, 0, (*TWindowCodeArg)(unsafe.Pointer(p)).FregArg) @@ -153013,9 +147101,6 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regFlushPart = 0 /* Label just before sqlite3WhereEnd() code */ regStart = 0 /* Value of <expr> PRECEDING */ regEnd = 0 /* Value of <expr> FOLLOWING */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) lblWhereEnd = _sqlite3VdbeMakeLabel(tls, pParse) /* Fill in the context object */ libc.Xmemset(tls, bp, 0, uint32(56)) @@ -153034,15 +147119,15 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** (eDelete==WINDOW_AGGINVERSE), they may be deleted as after the row ** has been returned to the caller (WINDOW_RETURN_ROW), or they may ** be deleted after they enter the frame (WINDOW_AGGSTEP). */ - switch int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) { + switch libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) { case int32(TK_FOLLOWING): - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_RANGE) && _windowExprGtZero(tls, pParse, (*TWindow)(unsafe.Pointer(pMWin)).FpStart) != 0 { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_RANGE) && _windowExprGtZero(tls, pParse, (*TWindow)(unsafe.Pointer(pMWin)).FpStart) != 0 { (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FeDelete = int32(WINDOW_RETURN_ROW) } case int32(TK_UNBOUNDED): if _windowCacheFrame(tls, pMWin) == 0 { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_RANGE) && _windowExprGtZero(tls, pParse, (*TWindow)(unsafe.Pointer(pMWin)).FpEnd) != 0 { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_RANGE) && _windowExprGtZero(tls, pParse, (*TWindow)(unsafe.Pointer(pMWin)).FpEnd) != 0 { (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FeDelete = int32(WINDOW_AGGSTEP) } } else { @@ -153069,13 +147154,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* If the window frame contains an "<expr> PRECEDING" or "<expr> FOLLOWING" ** clause, allocate registers to store the results of evaluating each ** <expr>. */ - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { v6 = pParse + 44 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { v8 = pParse + 44 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) @@ -153084,7 +147169,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* If this is not a "ROWS BETWEEN ..." frame, then allocate arrays of ** registers to store copies of the ORDER BY expressions (peer values) ** for the main loop, and for each cursor (start, current and end). */ - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_ROWS) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_ROWS) { if pOrderBy != 0 { v9 = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr } else { @@ -153147,7 +147232,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregArg = _windowInitAccum(tls, pParse, pMWin) if regStart != 0 { _sqlite3ExprCode(tls, pParse, (*TWindow)(unsafe.Pointer(pMWin)).FpStart, regStart) - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { v13 = int32(3) } else { v13 = 0 @@ -153156,15 +147241,15 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin } if regEnd != 0 { _sqlite3ExprCode(tls, pParse, (*TWindow)(unsafe.Pointer(pMWin)).FpEnd, regEnd) - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { v14 = int32(3) } else { v14 = 0 } _windowCheckValue(tls, pParse, regEnd, int32(1)+v14) } - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_RANGE) && int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) && regStart != 0 { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_RANGE) && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) && regStart != 0 { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { v15 = int32(OP_Ge) } else { v15 = int32(OP_Le) @@ -153180,11 +147265,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, lblWhereEnd) _sqlite3VdbeJumpHere(tls, v, addrGe) } - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) && int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_RANGE) && regEnd != 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) != int32(TK_RANGE) && regEnd != 0 { _sqlite3VdbeAddOp3(tls, v, int32(OP_Subtract), regStart, regEnd, regStart) } - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) != int32(TK_UNBOUNDED) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) != int32(TK_UNBOUNDED) { _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Fcsr) } _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Fcsr) @@ -153201,10 +147285,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin if regPeer != 0 { _windowIfNewPeer(tls, pParse, pOrderBy, regNewPeer, regPeer, lblWhereEnd) } - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { _windowCodeOp(tls, bp, int32(WINDOW_AGGSTEP), 0, 0) - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) != int32(TK_UNBOUNDED) { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) != int32(TK_UNBOUNDED) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { lbl = _sqlite3VdbeMakeLabel(tls, pParse) addrNext = _sqlite3VdbeCurrentAddr(tls, v) _windowCodeRangeTest(tls, bp, int32(OP_Ge), (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Fcsr, regEnd, (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Fcsr, lbl) @@ -153218,8 +147302,8 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin } } } else { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) { - bRPS = libc.BoolInt32(int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) && int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE)) + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) { + bRPS = libc.BoolInt32(libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE)) _windowCodeOp(tls, bp, int32(WINDOW_AGGSTEP), regEnd, 0) if bRPS != 0 { _windowCodeOp(tls, bp, int32(WINDOW_AGGINVERSE), regStart, 0) @@ -153231,8 +147315,8 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin } else { addr1 = 0 _windowCodeOp(tls, bp, int32(WINDOW_AGGSTEP), 0, 0) - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) != int32(TK_UNBOUNDED) { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) != int32(TK_UNBOUNDED) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { lbl1 = 0 addr1 = _sqlite3VdbeCurrentAddr(tls, v) if regEnd != 0 { @@ -153268,27 +147352,26 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin } (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = 0 addrEmpty = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), csrWrite) - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) { - bRPS1 = libc.BoolInt32(int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) && int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE)) + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) { + bRPS1 = libc.BoolInt32(libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE)) _windowCodeOp(tls, bp, int32(WINDOW_AGGSTEP), regEnd, 0) if bRPS1 != 0 { _windowCodeOp(tls, bp, int32(WINDOW_AGGINVERSE), regStart, 0) } _windowCodeOp(tls, bp, int32(WINDOW_RETURN_ROW), 0, 0) } else { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { _windowCodeOp(tls, bp, int32(WINDOW_AGGSTEP), 0, 0) - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeFrmType) == int32(TK_RANGE) { addrStart = _sqlite3VdbeCurrentAddr(tls, v) addrBreak2 = _windowCodeOp(tls, bp, int32(WINDOW_AGGINVERSE), regStart, int32(1)) addrBreak1 = _windowCodeOp(tls, bp, int32(WINDOW_RETURN_ROW), 0, int32(1)) } else { - if int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_UNBOUNDED) { + if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_UNBOUNDED) { addrStart = _sqlite3VdbeCurrentAddr(tls, v) addrBreak1 = _windowCodeOp(tls, bp, int32(WINDOW_RETURN_ROW), regStart, int32(1)) addrBreak2 = _windowCodeOp(tls, bp, int32(WINDOW_AGGINVERSE), 0, int32(1)) } else { - _ = libc.Int32FromInt32(0) addrStart = _sqlite3VdbeCurrentAddr(tls, v) addrBreak1 = _windowCodeOp(tls, bp, int32(WINDOW_RETURN_ROW), regEnd, int32(1)) addrBreak2 = _windowCodeOp(tls, bp, int32(WINDOW_AGGINVERSE), regStart, int32(1)) @@ -153431,7 +147514,6 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { var pLoop, pNext, v1 uintptr var v3 bool _, _, _, _, _, _, _ = cnt, mxSelect, pLoop, pNext, v1, v2, v3 - _ = libc.Int32FromInt32(0) if (*TSelect)(unsafe.Pointer(p)).FpPrior != 0 { pNext = uintptr(0) pLoop = p @@ -153447,20 +147529,20 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23352 + v1 = __ccgo_ts + 23381 } else { - v1 = __ccgo_ts + 23361 + v1 = __ccgo_ts + 23390 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23367, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23396, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } - if v3 = (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_MultiValue) == uint32(0); v3 { + if v3 = (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_MultiValue)|libc.Int32FromInt32(SF_Values)) == uint32(0); v3 { v2 = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 116 + 4*4)) mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23409, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23438, 0) } } } @@ -153492,7 +147574,7 @@ func _parserStackRealloc(tls *libc.TLS, pOld uintptr, newSize Tsqlite3_uint64) ( if _sqlite3FaultSim(tls, int32(700)) != 0 { v1 = uintptr(0) } else { - v1 = Xsqlite3_realloc(tls, pOld, int32(newSize)) + v1 = Xsqlite3_realloc(tls, pOld, libc.Int32FromUint64(newSize)) } return v1 } @@ -153509,7 +147591,7 @@ func _tokenExpr(tls *libc.TLS, pParse uintptr, op int32, _t TToken) (r uintptr) p = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(52)+(*(*TToken)(unsafe.Pointer(bp))).Fn+uint32(1))) if p != 0 { /* memset(p, 0, sizeof(Expr)); */ - (*TExpr)(unsafe.Pointer(p)).Fop = uint8(op) + (*TExpr)(unsafe.Pointer(p)).Fop = libc.Uint8FromInt32(op) (*TExpr)(unsafe.Pointer(p)).FaffExpr = 0 (*TExpr)(unsafe.Pointer(p)).Fflags = uint32(EP_Leaf) /* p->iAgg = -1; // Not required */ @@ -153526,11 +147608,11 @@ func _tokenExpr(tls *libc.TLS, pParse uintptr, op int32, _t TToken) (r uintptr) libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 8)), (*(*TToken)(unsafe.Pointer(bp))).Fz, (*(*TToken)(unsafe.Pointer(bp))).Fn) *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8)) + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = 0 *(*int32)(unsafe.Pointer(p + 36)) = int32((*(*TToken)(unsafe.Pointer(bp))).Fz) - int32((*TParse)(unsafe.Pointer(pParse)).FzTail) - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8)))))])&int32(0x80) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8)))))])&int32(0x80) != 0 { _sqlite3DequoteExpr(tls, p) } (*TExpr)(unsafe.Pointer(p)).FnHeight = int32(1) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { return _sqlite3RenameTokenMap(tls, pParse, p, bp) } } @@ -153545,8 +147627,8 @@ func _binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, var db uintptr _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if pA != 0 && pY != 0 && int32((*TExpr)(unsafe.Pointer(pY)).Fop) == int32(TK_NULL) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { - (*TExpr)(unsafe.Pointer(pA)).Fop = uint8(op) + if pA != 0 && pY != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pY)).Fop) == int32(TK_NULL) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + (*TExpr)(unsafe.Pointer(pA)).Fop = libc.Uint8FromInt32(op) _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pA)).FpRight) (*TExpr)(unsafe.Pointer(pA)).FpRight = uintptr(0) } @@ -153565,8 +147647,8 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId var p uintptr _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) - if (hasCollate != 0 || sortOrder != -int32(1)) && int32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23443, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23472, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -159955,13 +154037,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = (int32((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int32((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 12 if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+16 { - pNew = _parserStackRealloc(tls, uintptr(0), uint64(uint32(newSize)*uint32(12))) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint32FromInt32(newSize)*uint32(12))) if pNew == uintptr(0) { return int32(1) } - libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint32(oldSize)*uint32(12)) + libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint32FromInt32(oldSize)*uint32(12)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(uint32(newSize)*uint32(12))) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint32FromInt32(newSize)*uint32(12))) if pNew == uintptr(0) { return int32(1) } @@ -160007,7 +154089,7 @@ func _yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor u var pParse uintptr _ = pParse pParse = (*TyyParser)(unsafe.Pointer(yypParser)).FpParse - switch int32(yymajor) { + switch libc.Int32FromUint16(yymajor) { /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a @@ -160138,8 +154220,6 @@ func _yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor u func _yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { var yytos, v1, v2 uintptr _, _, _ = yytos, v1, v2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v2 = pParser v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2)) -= 12 @@ -160160,7 +154240,7 @@ func _sqlite3ParserFinalize(tls *libc.TLS, p uintptr) { ** element left in the stack */ yytos = (*TyyParser)(unsafe.Pointer(pParser)).Fyytos for yytos > (*TyyParser)(unsafe.Pointer(pParser)).Fyystack { - if int32((*TyyStackEntry)(unsafe.Pointer(yytos)).Fmajor) >= int32(YY_MIN_DSTRCTR) { + if libc.Int32FromUint16((*TyyStackEntry)(unsafe.Pointer(yytos)).Fmajor) >= int32(YY_MIN_DSTRCTR) { _yy_destructor(tls, pParser, (*TyyStackEntry)(unsafe.Pointer(yytos)).Fmajor, yytos+4) } yytos -= 12 @@ -160199,35 +154279,25 @@ func _yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) (r var i, j int32 var iFallback uint16 _, _, _ = i, iFallback, j - if int32(stateno) > int32(YY_MAX_SHIFT) { + if libc.Int32FromUint16(stateno) > int32(YY_MAX_SHIFT) { return stateno } - _ = libc.Int32FromInt32(0) for cond := true; cond; cond = int32(1) != 0 { - i = int32(_yy_shift_ofst[stateno]) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - i += int32(iLookAhead) - _ = libc.Int32FromInt32(0) - if int32(_yy_lookahead[i]) != int32(iLookAhead) { /* Fallback token */ - _ = libc.Int32FromInt32(0) + i = libc.Int32FromUint16(_yy_shift_ofst[stateno]) + i += libc.Int32FromUint16(iLookAhead) + if libc.Int32FromUint16(_yy_lookahead[i]) != libc.Int32FromUint16(iLookAhead) { /* Fallback token */ iFallback = _yyFallback[iLookAhead] - if int32(iFallback) != 0 { - _ = libc.Int32FromInt32(0) /* Fallback loop must terminate */ + if libc.Int32FromUint16(iFallback) != 0 { + /* Fallback loop must terminate */ iLookAhead = iFallback continue } - j = i - int32(iLookAhead) + int32(YYWILDCARD) - _ = libc.Int32FromInt32(0) - if int32(_yy_lookahead[j]) == int32(YYWILDCARD) && int32(iLookAhead) > 0 { + j = i - libc.Int32FromUint16(iLookAhead) + int32(YYWILDCARD) + if libc.Int32FromUint16(_yy_lookahead[j]) == int32(YYWILDCARD) && libc.Int32FromUint16(iLookAhead) > 0 { return _yy_action[j] } return _yy_default[stateno] } else { - _ = libc.Int32FromInt32(0) return _yy_action[i] } } @@ -160243,12 +154313,8 @@ func _yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) (r func _yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) (r uint16) { var i int32 _ = i - _ = libc.Int32FromInt32(0) i = int32(_yy_reduce_ofst[stateno]) - _ = libc.Int32FromInt32(0) - i += int32(iLookAhead) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + i += libc.Int32FromUint16(iLookAhead) return _yy_action[i] } @@ -160294,9 +154360,8 @@ func _yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint return } yytos = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos - _ = libc.Int32FromInt32(0) } - if int32(yyNewState) > int32(YY_MAX_SHIFT) { + if libc.Int32FromUint16(yyNewState) > int32(YY_MAX_SHIFT) { yyNewState = uint16(int32(yyNewState) + (libc.Int32FromInt32(YY_MIN_REDUCE) - libc.Int32FromInt32(YY_MIN_SHIFTREDUCE))) } (*TyyStackEntry)(unsafe.Pointer(yytos)).Fstateno = yyNewState @@ -161834,13 +155899,13 @@ _8: ; _9: ; - *(*int32)(unsafe.Pointer(yymsp + 4)) = int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) /*A-overwrites-X*/ + *(*int32)(unsafe.Pointer(yymsp + 4)) = libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) /*A-overwrites-X*/ goto _346 _11: ; /* cmd ::= COMMIT|END trans_opt */ _10: ; - _sqlite3EndTransaction(tls, pParse, int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor)) + _sqlite3EndTransaction(tls, pParse, libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor)) goto _346 _12: ; /* cmd ::= SAVEPOINT nm */ @@ -161886,7 +155951,7 @@ _25: goto _346 _26: ; /* temp ::= TEMP */ - *(*int32)(unsafe.Pointer(yymsp + 4)) = libc.BoolInt32(int32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0) + *(*int32)(unsafe.Pointer(yymsp + 4)) = libc.BoolInt32(libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0) goto _346 _27: ; /* create_table_args ::= LP columnlist conslist_opt RP table_option_set */ @@ -161909,10 +155974,10 @@ _30: _31: ; /* table_option ::= WITHOUT nm */ if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16781, int32(5)) == 0 { - *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = uint32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) + *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23481, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23510, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) } goto _346 _32: @@ -161921,7 +155986,7 @@ _32: *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23481, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23510, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) } *(*Tu32)(unsafe.Pointer(yymsp + 4)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -161940,24 +156005,22 @@ _36: goto _346 _37: ; /* typetoken ::= typename LP signed RP */ - *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4 + 4)) = uint32(t__predefined_ptrdiff_t(*(*uintptr)(unsafe.Pointer(yymsp + 4))+uintptr(*(*uint32)(unsafe.Pointer(yymsp + 4 + 4)))) - int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)))) + *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4 + 4)) = libc.Uint32FromInt32(t__predefined_ptrdiff_t(*(*uintptr)(unsafe.Pointer(yymsp + 4))+uintptr(*(*uint32)(unsafe.Pointer(yymsp + 4 + 4)))) - int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)))) goto _346 _38: ; /* typetoken ::= typename LP signed COMMA signed RP */ - *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4 + 4)) = uint32(t__predefined_ptrdiff_t(*(*uintptr)(unsafe.Pointer(yymsp + 4))+uintptr(*(*uint32)(unsafe.Pointer(yymsp + 4 + 4)))) - int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)))) + *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4 + 4)) = libc.Uint32FromInt32(t__predefined_ptrdiff_t(*(*uintptr)(unsafe.Pointer(yymsp + 4))+uintptr(*(*uint32)(unsafe.Pointer(yymsp + 4 + 4)))) - int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)))) goto _346 _39: ; /* typename ::= typename ID|STRING */ - *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4 + 4)) = *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) + uint32(int32(*(*uintptr)(unsafe.Pointer(yymsp + 4)))-int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))) + *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4 + 4)) = *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) + libc.Uint32FromInt32(int32(*(*uintptr)(unsafe.Pointer(yymsp + 4)))-int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))) goto _346 _40: ; /* scanpt ::= */ - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4)) = yyLookaheadToken.Fz goto _346 _41: ; /* scantok ::= */ - _ = libc.Int32FromInt32(0) *(*TToken)(unsafe.Pointer(yymsp + 1*12 + 4)) = yyLookaheadToken goto _346 _43: @@ -162194,12 +156257,12 @@ _98: pRhs = _sqlite3SelectNew(tls, pParse, uintptr(0), pFrom, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) } if pRhs != 0 { - (*TSelect)(unsafe.Pointer(pRhs)).Fop = uint8(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) + (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= uint32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= uint32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -162212,7 +156275,7 @@ _100: ; /* multiselect_op ::= UNION */ _99: ; - *(*int32)(unsafe.Pointer(yymsp + 4)) = int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) /*A-overwrites-OP*/ + *(*int32)(unsafe.Pointer(yymsp + 4)) = libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) /*A-overwrites-OP*/ goto _346 _101: ; /* multiselect_op ::= UNION ALL */ @@ -162220,11 +156283,11 @@ _101: goto _346 _102: ; /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4)) = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), uint32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + 4))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4)) = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + 4))) goto _346 _103: ; /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */ - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(9))*12 + 4)) = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), uint32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + 4))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(9))*12 + 4)) = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + 4))) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(9))*12 + 4)) != 0 { (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(9))*12 + 4)))).FpWinDefn = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) } else { @@ -162313,7 +156376,7 @@ _125: _126: ; /* stl_prefix ::= seltablist joinop */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != 0 && (*TSrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))).FnSrc > 0 { - (*(*TSrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) + 8 + uintptr((*TSrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))).FnSrc-int32(1))*68))).Ffg.Fjointype = uint8(*(*int32)(unsafe.Pointer(yymsp + 4))) + (*(*TSrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) + 8 + uintptr((*TSrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))).FnSrc-int32(1))*68))).Ffg.Fjointype = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + 4))) } goto _346 _127: @@ -162379,7 +156442,7 @@ _132: _134: ; /* fullname ::= nm */ *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+4, uintptr(0)) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) != 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) != 0 { _sqlite3RenameTokenMap(tls, pParse, (*(*TSrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) + 8))).FzName, yymsp+4) } *(*uintptr)(unsafe.Pointer(yymsp + 4)) = *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) @@ -162387,7 +156450,7 @@ _134: _135: ; /* fullname ::= nm DOT nm */ *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+uintptr(-libc.Int32FromInt32(2))*12+4, yymsp+4) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) != 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) != 0 { _sqlite3RenameTokenMap(tls, pParse, (*(*TSrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) + 8))).FzName, yymsp+4) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) = *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) @@ -162550,7 +156613,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), yymsp+uintptr(-libc.Int32FromInt32(4))*12+4) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+23508) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+23537) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -162656,7 +156719,7 @@ _198: temp21 = _tokenExpr(tls, pParse, int32(TK_ID), *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4))) temp3 = _tokenExpr(tls, pParse, int32(TK_ID), *(*TToken)(unsafe.Pointer(yymsp + 4))) temp4 = _sqlite3PExpr(tls, pParse, int32(TK_DOT), temp21, temp3) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), temp11) } *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3PExpr(tls, pParse, int32(TK_DOT), temp11, temp4) @@ -162666,7 +156729,7 @@ _200: ; /* term ::= NULL|FLOAT|BLOB */ _199: ; - *(*uintptr)(unsafe.Pointer(yymsp + 4)) = _tokenExpr(tls, pParse, int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor), *(*TToken)(unsafe.Pointer(yymsp + 4))) /*A-overwrites-X*/ + *(*uintptr)(unsafe.Pointer(yymsp + 4)) = _tokenExpr(tls, pParse, libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor), *(*TToken)(unsafe.Pointer(yymsp + 4))) /*A-overwrites-X*/ goto _346 _201: ; /* term ::= INTEGER */ @@ -162678,7 +156741,7 @@ _201: goto _346 _202: ; /* expr ::= VARIABLE */ - if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 4))))) == int32('#') && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 4)) + 1)))])&int32(0x04) != 0) { + if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 4))))) == int32('#') && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 4)) + 1)))])&int32(0x04) != 0) { n = *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) *(*uintptr)(unsafe.Pointer(yymsp + 4)) = _tokenExpr(tls, pParse, int32(TK_VARIABLE), *(*TToken)(unsafe.Pointer(yymsp + 4))) _sqlite3ExprAssignVarNumber(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), n) @@ -162687,9 +156750,8 @@ _202: ** that look like this: #1 #2 ... These terms refer to registers ** in the virtual machine. #N is the N-th register. */ *(*TToken)(unsafe.Pointer(bp + 56)) = *(*TToken)(unsafe.Pointer(yymsp + 4)) /*A-overwrites-X*/ - _ = libc.Int32FromInt32(0) - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23517, libc.VaList(bp+80, bp+56)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23546, libc.VaList(bp+80, bp+56)) *(*uintptr)(unsafe.Pointer(yymsp + 4)) = uintptr(0) } else { *(*uintptr)(unsafe.Pointer(yymsp + 4)) = _sqlite3PExpr(tls, pParse, int32(TK_REGISTER), uintptr(0), uintptr(0)) @@ -162755,7 +156817,7 @@ _212: if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) != 0 { *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) + 20)) = pList if (*TExprList)(unsafe.Pointer(pList)).FnExpr != 0 { - *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) + 4)) |= (*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8))).FpExpr)).Fflags & uint32(libc.Int32FromInt32(EP_Collate)|libc.Int32FromInt32(EP_Subquery)|libc.Int32FromInt32(EP_HasFunc)) + *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) + 4)) |= (*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8))).FpExpr)).Fflags & libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)|libc.Int32FromInt32(EP_Subquery)|libc.Int32FromInt32(EP_HasFunc)) } } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -162779,7 +156841,7 @@ _219: ; _220: ; - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) = _sqlite3PExpr(tls, pParse, libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4))) goto _346 _221: ; /* likeop ::= NOT LIKE_KW|MATCH */ @@ -162788,7 +156850,7 @@ _221: goto _346 _222: ; /* expr ::= expr likeop expr */ - bNot = int32(*(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4 + 4)) & uint32(0x80000000)) + bNot = libc.Int32FromUint32(*(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4 + 4)) & uint32(0x80000000)) *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4 + 4)) &= uint32(0x7fffffff) pList1 = _sqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4))) pList1 = _sqlite3ExprListAppend(tls, pParse, pList1, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4))) @@ -162802,7 +156864,7 @@ _222: goto _346 _223: ; /* expr ::= expr likeop expr ESCAPE expr */ - bNot1 = int32(*(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4 + 4)) & uint32(0x80000000)) + bNot1 = libc.Int32FromUint32(*(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4 + 4)) & uint32(0x80000000)) *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4 + 4)) &= uint32(0x7fffffff) pList2 = _sqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4))) pList2 = _sqlite3ExprListAppend(tls, pParse, pList2, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) @@ -162817,7 +156879,7 @@ _223: goto _346 _224: ; /* expr ::= expr ISNULL|NOTNULL */ - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = _sqlite3PExpr(tls, pParse, libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), uintptr(0)) goto _346 _225: ; /* expr ::= expr NOT NULL */ @@ -162847,19 +156909,17 @@ _231: ; /* expr ::= NOT expr */ _230: ; - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + 4)), uintptr(0)) /*A-overwrites-B*/ + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = _sqlite3PExpr(tls, pParse, libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + 4)), uintptr(0)) /*A-overwrites-B*/ goto _346 _232: ; /* expr ::= PLUS|MINUS expr */ p4 = *(*uintptr)(unsafe.Pointer(yymsp + 4)) - op = uint8(int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor) + (libc.Int32FromInt32(TK_UPLUS) - libc.Int32FromInt32(TK_PLUS))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if p4 != 0 && int32((*TExpr)(unsafe.Pointer(p4)).Fop) == int32(TK_UPLUS) { + op = libc.Uint8FromInt32(libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor) + (libc.Int32FromInt32(TK_UPLUS) - libc.Int32FromInt32(TK_PLUS))) + if p4 != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p4)).Fop) == int32(TK_UPLUS) { (*TExpr)(unsafe.Pointer(p4)).Fop = op *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = p4 } else { - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32(op), p4, uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = _sqlite3PExpr(tls, pParse, libc.Int32FromUint8(op), p4, uintptr(0)) /*A-overwrites-B*/ } goto _346 @@ -162913,13 +156973,13 @@ _237: } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) + 8))).FpExpr - if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))).FnExpr == int32(1) && _sqlite3ExprIsConstant(tls, pParse, pRHS) != 0 && int32((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)))).Fop) != int32(TK_VECTOR) { + if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))).FnExpr == int32(1) && _sqlite3ExprIsConstant(tls, pParse, pRHS) != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)))).Fop) != int32(TK_VECTOR) { (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) + 8))).FpExpr = uintptr(0) _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) pRHS = _sqlite3PExpr(tls, pParse, int32(TK_UPLUS), pRHS, uintptr(0)) *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32(TK_EQ), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), pRHS) } else { - if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))).FnExpr == int32(1) && int32((*TExpr)(unsafe.Pointer(pRHS)).Fop) == int32(TK_SELECT) { + if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))).FnExpr == int32(1) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRHS)).Fop) == int32(TK_SELECT) { *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), *(*uintptr)(unsafe.Pointer(pRHS + 20))) *(*uintptr)(unsafe.Pointer(pRHS + 20)) = uintptr(0) @@ -162929,7 +156989,7 @@ _237: if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) == uintptr(0) { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) } else { - if int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)))).FpLeft)).Fop) == int32(TK_VECTOR) { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)))).FpLeft)).Fop) == int32(TK_VECTOR) { nExpr = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)))).FpLeft + 20)))).FnExpr pSelectRHS = _sqlite3ExprListToValues(tls, pParse, nExpr, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) if pSelectRHS != 0 { @@ -163029,7 +157089,7 @@ _247: _249: ; /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ _sqlite3CreateIndex(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*12+4, yymsp+uintptr(-libc.Int32FromInt32(6))*12+4, _sqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+uintptr(-libc.Int32FromInt32(4))*12+4, uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)), yymsp+uintptr(-libc.Int32FromInt32(11))*12+4, *(*uintptr)(unsafe.Pointer(yymsp + 4)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4)), uint8(SQLITE_IDXTYPE_APPDEF)) - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TParse)(unsafe.Pointer(pParse)).FpNewIndex != 0 { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TParse)(unsafe.Pointer(pParse)).FpNewIndex != 0 { _sqlite3RenameTokenMap(tls, pParse, (*TIndex)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, yymsp+uintptr(-libc.Int32FromInt32(4))*12+4) } goto _346 @@ -163086,7 +157146,7 @@ _262: _263: ; /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ (*(*TToken)(unsafe.Pointer(bp + 64))).Fz = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) - (*(*TToken)(unsafe.Pointer(bp + 64))).Fn = uint32(int32(*(*uintptr)(unsafe.Pointer(yymsp + 4)))-int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)))) + *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) + (*(*TToken)(unsafe.Pointer(bp + 64))).Fn = libc.Uint32FromInt32(int32(*(*uintptr)(unsafe.Pointer(yymsp + 4)))-int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)))) + *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) _sqlite3FinishTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), bp+64) goto _346 _264: @@ -163100,8 +157160,8 @@ _264: *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)) = v352 /*A-overwrites-T*/ goto _346 _265: - ; /* trigger_time ::= BEFORE|AFTER */ - *(*int32)(unsafe.Pointer(yymsp + 4)) = int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) /*A-overwrites-X*/ + ; /* trigger_time ::= BEFORE|AFTER */ + *(*int32)(unsafe.Pointer(yymsp + 4)) = libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) /*A-overwrites-X*/ goto _346 _266: ; /* trigger_time ::= INSTEAD OF */ @@ -163115,7 +157175,7 @@ _269: ; /* trigger_event ::= DELETE|INSERT */ _268: ; - *(*int32)(unsafe.Pointer(yymsp + 4)) = int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) /*A-overwrites-X*/ + *(*int32)(unsafe.Pointer(yymsp + 4)) = libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) /*A-overwrites-X*/ *(*uintptr)(unsafe.Pointer(yymsp + 4 + 4)) = uintptr(0) goto _346 _270: @@ -163137,36 +157197,34 @@ _273: goto _346 _275: ; /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ - _ = libc.Int32FromInt32(0) (*TTriggerStep)(unsafe.Pointer((*TTriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)))).FpLast)).FpNext = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) (*TTriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) goto _346 _276: ; /* trigger_cmd_list ::= trigger_cmd SEMI */ - _ = libc.Int32FromInt32(0) (*TTriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) goto _346 _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) = *(*TToken)(unsafe.Pointer(yymsp + 4)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23541, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23570, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23636, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23665, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23749, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ - *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3TriggerUpdateStep(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(6))*12+4, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), uint8(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4))) + *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3TriggerUpdateStep(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(6))*12+4, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4))) *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4)) = *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 _281: - ; /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ - *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3TriggerInsertStep(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(4))*12+4, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), uint8(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4))) /*yylhsminor.yy427-overwrites-yymsp[-6].minor.yy144*/ + ; /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ + *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3TriggerInsertStep(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(4))*12+4, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4))) /*yylhsminor.yy427-overwrites-yymsp[-6].minor.yy144*/ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)) = *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 _282: @@ -163235,7 +157293,7 @@ _295: goto _346 _296: ; /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ - *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4 + 4)) = uint32(int32((*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fz)-int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))) + (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fn + *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4 + 4)) = libc.Uint32FromInt32(int32((*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fz)-int32(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)))) + (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fn _sqlite3AlterFinishAddColumn(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(1))*12+4) goto _346 _297: @@ -163311,7 +157369,6 @@ _315: goto _346 _316: ; /* windowdefn_list ::= windowdefn_list COMMA windowdefn */ - _ = libc.Int32FromInt32(0) _sqlite3WindowChain(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4))) (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 4)))).FpNextWin = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = *(*uintptr)(unsafe.Pointer(yymsp + 4)) @@ -163375,13 +157432,13 @@ _328: ; _330: ; - (*(*TFrameBound)(unsafe.Pointer(bp))).FeType = int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor) + (*(*TFrameBound)(unsafe.Pointer(bp))).FeType = libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12))).Fmajor) (*(*TFrameBound)(unsafe.Pointer(bp))).FpExpr = uintptr(0) *(*TFrameBound)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = *(*TFrameBound)(unsafe.Pointer(bp)) goto _346 _331: ; /* frame_bound ::= expr PRECEDING|FOLLOWING */ - (*(*TFrameBound)(unsafe.Pointer(bp))).FeType = int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) + (*(*TFrameBound)(unsafe.Pointer(bp))).FeType = libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor) (*(*TFrameBound)(unsafe.Pointer(bp))).FpExpr = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) *(*TFrameBound)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = *(*TFrameBound)(unsafe.Pointer(bp)) goto _346 @@ -163436,7 +157493,6 @@ _340: _341: ; /* over_clause ::= OVER LP window RP */ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) - _ = libc.Int32FromInt32(0) goto _346 _342: ; /* over_clause ::= OVER nm */ @@ -163451,44 +157507,26 @@ _343: goto _346 _344: ; /* term ::= QNUMBER */ - *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _tokenExpr(tls, pParse, int32((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor), *(*TToken)(unsafe.Pointer(yymsp + 4))) + *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _tokenExpr(tls, pParse, libc.Int32FromUint16((*(*TyyStackEntry)(unsafe.Pointer(yymsp))).Fmajor), *(*TToken)(unsafe.Pointer(yymsp + 4))) _sqlite3DequoteNumber(tls, pParse, *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp))))) *(*uintptr)(unsafe.Pointer(yymsp + 4)) = *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 _345: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) goto _346 /********** End reduce actions ************************************************/ _346: ; - _ = libc.Int32FromInt32(0) - yygoto = int32(_yyRuleInfoLhs[yyruleno]) + yygoto = libc.Int32FromUint16(_yyRuleInfoLhs[yyruleno]) yysize = int32(_yyRuleInfoNRhs[yyruleno]) - yyact = _yy_find_reduce_action(tls, (*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(yysize)*12))).Fstateno, uint16(yygoto)) + yyact = _yy_find_reduce_action(tls, (*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(yysize)*12))).Fstateno, libc.Uint16FromInt32(yygoto)) /* There are no SHIFTREDUCE actions on nonterminals because the table ** generator has simplified them to pure REDUCE actions. */ - _ = libc.Int32FromInt32(0) /* It is not possible for a REDUCE to be followed by an error */ - _ = libc.Int32FromInt32(0) yymsp += uintptr(yysize+int32(1)) * 12 (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos = yymsp (*TyyStackEntry)(unsafe.Pointer(yymsp)).Fstateno = yyact - (*TyyStackEntry)(unsafe.Pointer(yymsp)).Fmajor = uint16(yygoto) + (*TyyStackEntry)(unsafe.Pointer(yymsp)).Fmajor = libc.Uint16FromInt32(yygoto) return yyact } @@ -163511,9 +157549,9 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor /************ Begin %syntax_error code ****************************************/ _ = yymajor /* Silence some compiler warnings */ if *(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23517, libc.VaList(bp+16, bp)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23546, libc.VaList(bp+16, bp)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23805, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23834, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163529,7 +157567,6 @@ func _yy_accept(tls *libc.TLS, yypParser uintptr) { var pParse uintptr _ = pParse pParse = (*TyyParser)(unsafe.Pointer(yypParser)).FpParse - _ = libc.Int32FromInt32(0) /* Here code is inserted which will be executed whenever the ** parser accepts */ /*********** Begin %parse_accept code *****************************************/ @@ -163569,14 +157606,11 @@ func _sqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor TToken) { _, _, _, _ = pParse, yyact, yypParser, yyruleno /* The parser action. */ yypParser = yyp /* The parser */ pParse = (*TyyParser)(unsafe.Pointer(yypParser)).FpParse - _ = libc.Int32FromInt32(0) yyact = (*TyyStackEntry)(unsafe.Pointer((*TyyParser)(unsafe.Pointer(yypParser)).Fyytos)).Fstateno for int32(1) != 0 { /* Exit by "break" */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - yyact = _yy_find_shift_action(tls, uint16(yymajor), yyact) - if int32(yyact) >= int32(YY_MIN_REDUCE) { - yyruleno = uint32(int32(yyact) - int32(YY_MIN_REDUCE)) /* Reduce by this rule */ + yyact = _yy_find_shift_action(tls, libc.Uint16FromInt32(yymajor), yyact) + if libc.Int32FromUint16(yyact) >= int32(YY_MIN_REDUCE) { + yyruleno = libc.Uint32FromInt32(libc.Int32FromUint16(yyact) - int32(YY_MIN_REDUCE)) /* Reduce by this rule */ /* Check that the stack is large enough to grow by a single entry ** if the RHS of the rule is empty. This ensures that there is room ** enough on the stack to push the LHS value */ @@ -163590,16 +157624,15 @@ func _sqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor TToken) { } yyact = _yy_reduce(tls, yypParser, yyruleno, yymajor, yyminor, pParse) } else { - if int32(yyact) <= int32(YY_MAX_SHIFTREDUCE) { - _yy_shift(tls, yypParser, yyact, uint16(yymajor), yyminor) + if libc.Int32FromUint16(yyact) <= int32(YY_MAX_SHIFTREDUCE) { + _yy_shift(tls, yypParser, yyact, libc.Uint16FromInt32(yymajor), yyminor) break } else { - if int32(yyact) == int32(YY_ACCEPT_ACTION) { + if libc.Int32FromUint16(yyact) == int32(YY_ACCEPT_ACTION) { (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos -= 12 _yy_accept(tls, yypParser) return } else { - _ = libc.Int32FromInt32(0) *(*TToken)(unsafe.Pointer(bp)) = yyminor /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to ** do any kind of error recovery. Instead, simply invoke the syntax @@ -163609,7 +157642,7 @@ func _sqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor TToken) { ** they intend to abandon the parse upon the first syntax error seen. */ _yy_syntax_error(tls, yypParser, yymajor, yyminor) - _yy_destructor(tls, yypParser, uint16(yymajor), bp) + _yy_destructor(tls, yypParser, libc.Uint16FromInt32(yymajor), bp) break } } @@ -163625,8 +157658,7 @@ func _sqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor TToken) { // ** 0 if iToken has no fallback. // */ func _sqlite3ParserFallback(tls *libc.TLS, iToken int32) (r int32) { - _ = libc.Int32FromInt32(0) - return int32(_yyFallback[iToken]) + return libc.Int32FromUint16(_yyFallback[iToken]) } /************** End of parse.c ***********************************************/ @@ -165396,14 +159428,13 @@ func _keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) (r int32) { var i, j int32 var zKW uintptr _, _, _ = i, j, zKW - _ = libc.Int32FromInt32(0) - i = (int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z)))])*int32(4) ^ int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n-int32(1)))))])*int32(3) ^ n*int32(1)) % int32(127) - i = int32(_aKWHash[i]) + i = (libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])*int32(4) ^ libc.Int32FromUint8(_sqlite3UpperToLower[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(n-int32(1)))))])*int32(3) ^ n*int32(1)) % int32(127) + i = libc.Int32FromUint8(_aKWHash[i]) for { if !(i > 0) { break } - if int32(_aKWLen[i]) != n { + if libc.Int32FromUint8(_aKWLen[i]) != n { goto _1 } zKW = uintptr(unsafe.Pointer(&_zKWText)) + uintptr(_aKWOffset[i]) @@ -165567,12 +159598,12 @@ func _keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) (r int32) { /* INITIALLY */ /* ALL */ /* PRIMARY */ - *(*int32)(unsafe.Pointer(pType)) = int32(_aKWCode[i]) + *(*int32)(unsafe.Pointer(pType)) = libc.Int32FromUint8(_aKWCode[i]) break goto _1 _1: ; - i = int32(_aKWNext[i]) + i = libc.Int32FromUint8(_aKWNext[i]) } return n } @@ -165594,7 +159625,7 @@ func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintpt } i++ *(*uintptr)(unsafe.Pointer(pzName)) = uintptr(unsafe.Pointer(&_zKWText)) + uintptr(_aKWOffset[i]) - *(*int32)(unsafe.Pointer(pnName)) = int32(_aKWLen[i]) + *(*int32)(unsafe.Pointer(pnName)) = libc.Int32FromUint8(_aKWLen[i]) return SQLITE_OK } @@ -165630,7 +159661,7 @@ func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) (r int32) // // /* Make the IdChar function accessible from ctime.c and alter.c */ func _sqlite3IsIdChar(tls *libc.TLS, c Tu8) (r int32) { - return libc.BoolInt32(int32(_sqlite3CtypeMap[c])&int32(0x46) != 0) + return libc.BoolInt32(libc.Int32FromUint8(_sqlite3CtypeMap[c])&int32(0x46) != 0) } // C documentation @@ -165740,13 +159771,13 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { var c, delim, i, n, v10, v16, v18, v21, v22, v3, v5, v7, v8 int32 var v17, v6 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, delim, i, n, v10, v16, v17, v18, v21, v22, v3, v5, v6, v7, v8 - switch int32(_aiClass[*(*uint8)(unsafe.Pointer(z))]) { /* Switch on the character-class of the first byte + switch libc.Int32FromUint8(_aiClass[*(*uint8)(unsafe.Pointer(z))]) { /* Switch on the character-class of the first byte ** of the token. See the comment on the CC_ defines ** above. */ case int32(CC_SPACE): i = int32(1) for { - if !(int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x01) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x01) != 0) { break } goto _1 @@ -165757,10 +159788,10 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_SPACE) return i case int32(CC_MINUS): - if int32(*(*uint8)(unsafe.Pointer(z + 1))) == int32('-') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('-') { i = int32(2) for { - v3 = int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) + v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) c = v3 if !(v3 != 0 && c != int32('\n')) { break @@ -165773,9 +159804,9 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_SPACE) /* IMP: R-22934-25134 */ return i } else { - if int32(*(*uint8)(unsafe.Pointer(z + 1))) == int32('>') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('>') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_PTR) - return int32(2) + libc.BoolInt32(int32(*(*uint8)(unsafe.Pointer(z + 2))) == int32('>')) + return int32(2) + libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 2))) == int32('>')) } } *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_MINUS) @@ -165796,15 +159827,15 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_STAR) return int32(1) case int32(CC_SLASH): - if int32(*(*uint8)(unsafe.Pointer(z + 1))) != int32('*') || int32(*(*uint8)(unsafe.Pointer(z + 2))) == 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) != int32('*') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 2))) == 0 { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_SLASH) return int32(1) } i = int32(3) - c = int32(*(*uint8)(unsafe.Pointer(z + 2))) + c = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 2))) for { - if v6 = c != int32('*') || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != int32('/'); v6 { - v5 = int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) + if v6 = c != int32('*') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != int32('/'); v6 { + v5 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) c = v5 } if !(v6 && v5 != 0) { @@ -165825,9 +159856,9 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { return int32(1) case int32(CC_EQ): *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_EQ) - return int32(1) + libc.BoolInt32(int32(*(*uint8)(unsafe.Pointer(z + 1))) == int32('=')) + return int32(1) + libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('=')) case int32(CC_LT): - v7 = int32(*(*uint8)(unsafe.Pointer(z + 1))) + v7 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) c = v7 if v7 == int32('=') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_LE) @@ -165848,7 +159879,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { } fallthrough case int32(CC_GT): - v8 = int32(*(*uint8)(unsafe.Pointer(z + 1))) + v8 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) c = v8 if v8 == int32('=') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_GE) @@ -165864,7 +159895,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { } fallthrough case int32(CC_BANG): - if int32(*(*uint8)(unsafe.Pointer(z + 1))) != int32('=') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) != int32('=') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_ILLEGAL) return int32(1) } else { @@ -165873,7 +159904,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { } fallthrough case int32(CC_PIPE): - if int32(*(*uint8)(unsafe.Pointer(z + 1))) != int32('|') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) != int32('|') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_BITOR) return int32(1) } else { @@ -165891,16 +159922,16 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_BITNOT) return int32(1) case int32(CC_QUOTE): - delim = int32(*(*uint8)(unsafe.Pointer(z))) + delim = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) i = int32(1) for { - v10 = int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) + v10 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) c = v10 if !(v10 != 0) { break } if c == delim { - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == delim { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == delim { i++ } else { break @@ -165925,21 +159956,21 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { } fallthrough case int32(CC_DOT): - if !(int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 1))])&libc.Int32FromInt32(0x04) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 1))])&libc.Int32FromInt32(0x04) != 0) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_DOT) return int32(1) } fallthrough case int32(CC_DIGIT): *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_INTEGER) - if int32(*(*uint8)(unsafe.Pointer(z))) == int32('0') && (int32(*(*uint8)(unsafe.Pointer(z + 1))) == int32('x') || int32(*(*uint8)(unsafe.Pointer(z + 1))) == int32('X')) && int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&int32(0x08) != 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('0') && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('x') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('X')) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&int32(0x08) != 0 { i = int32(3) for { if !(int32(1) != 0) { break } - if int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x08) == 0 { - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('_') { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x08) == 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('_') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_QNUMBER) } else { break @@ -165956,8 +159987,8 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { if !(int32(1) != 0) { break } - if int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x04) == 0 { - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('_') { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x04) == 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('_') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_QNUMBER) } else { break @@ -165968,7 +159999,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { ; i++ } - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('.') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('.') { if *(*int32)(unsafe.Pointer(tokenType)) == int32(TK_INTEGER) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_FLOAT) } @@ -165977,8 +160008,8 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { if !(int32(1) != 0) { break } - if int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x04) == 0 { - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('_') { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x04) == 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('_') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_QNUMBER) } else { break @@ -165990,7 +160021,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { i++ } } - if (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('e') || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('E')) && (int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))])&int32(0x04) != 0 || (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == int32('+') || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == int32('-')) && int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(2))))])&int32(0x04) != 0) { + if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('e') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('E')) && (libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))])&int32(0x04) != 0 || (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == int32('+') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == int32('-')) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(2))))])&int32(0x04) != 0) { if *(*int32)(unsafe.Pointer(tokenType)) == int32(TK_INTEGER) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_FLOAT) } @@ -165999,8 +160030,8 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { if !(int32(1) != 0) { break } - if int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x04) == 0 { - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('_') { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x04) == 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('_') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_QNUMBER) } else { break @@ -166013,17 +160044,17 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { } } } - for int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x46) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x46) != 0 { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_ILLEGAL) i++ } return i case int32(CC_QUOTE2): i = int32(1) - c = int32(*(*uint8)(unsafe.Pointer(z))) + c = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) for { if v17 = c != int32(']'); v17 { - v16 = int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) + v16 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) c = v16 } if !(v17 && v16 != 0) { @@ -166045,7 +160076,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_VARIABLE) i = int32(1) for { - if !(int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x04) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x04) != 0) { break } goto _19 @@ -166061,12 +160092,12 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_VARIABLE) i = int32(1) for { - v21 = int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) + v21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) c = v21 if !(v21 != 0) { break } - if int32(_sqlite3CtypeMap[uint8(c)])&int32(0x46) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt32(c)])&int32(0x46) != 0 { n++ } else { if c == int32('(') && n > 0 { @@ -166075,9 +160106,9 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { goto _23 _23: ; - v22 = int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) + v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) c = v22 - if !(v22 != 0 && !(int32(_sqlite3CtypeMap[uint8(c)])&libc.Int32FromInt32(0x01) != 0) && c != int32(')')) { + if !(v22 != 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt32(c)])&libc.Int32FromInt32(0x01) != 0) && c != int32(')')) { break } } @@ -166088,7 +160119,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { } break } else { - if c == int32(':') && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == int32(':') { + if c == int32(':') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == int32(':') { i++ } else { break @@ -166105,13 +160136,13 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { } return i case int32(CC_KYWD0): - if int32(_aiClass[*(*uint8)(unsafe.Pointer(z + 1))]) > int32(CC_KYWD) { + if libc.Int32FromUint8(_aiClass[*(*uint8)(unsafe.Pointer(z + 1))]) > int32(CC_KYWD) { i = int32(1) break } i = int32(2) for { - if !(int32(_aiClass[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) <= int32(CC_KYWD)) { + if !(libc.Int32FromUint8(_aiClass[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) <= int32(CC_KYWD)) { break } goto _24 @@ -166119,7 +160150,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { ; i++ } - if int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x46) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x46) != 0 { /* This token started out using characters that can appear in keywords, ** but z[i] is a character not allowed within keywords, so this must ** be an identifier instead */ @@ -166129,11 +160160,11 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_ID) return _keywordCode(tls, z, i, tokenType) case CC_X: - if int32(*(*uint8)(unsafe.Pointer(z + 1))) == int32('\'') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('\'') { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_BLOB) i = int32(2) for { - if !(int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x08) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x08) != 0) { break } goto _25 @@ -166141,9 +160172,9 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { ; i++ } - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != int32('\'') || i%int32(2) != 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != int32('\'') || i%int32(2) != 0 { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_ILLEGAL) - for *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != int32('\'') { + for *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != int32('\'') { i++ } } @@ -166158,7 +160189,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { case int32(CC_ID): i = int32(1) case int32(CC_BOM): - if int32(*(*uint8)(unsafe.Pointer(z + 1))) == int32(0xbb) && int32(*(*uint8)(unsafe.Pointer(z + 2))) == int32(0xbf) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32(0xbb) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 2))) == int32(0xbf) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_SPACE) return int32(3) } @@ -166170,7 +160201,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_ILLEGAL) return int32(1) } - for int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x46) != 0 { + for libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&int32(0x46) != 0 { i++ } *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_ID) @@ -166196,7 +160227,6 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { lastTokenParsed = -int32(1) /* type of the previous token */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Max length of an SQL string */ pParentParse = uintptr(0) /* Space to hold the Lemon-generated Parser object */ - _ = libc.Int32FromInt32(0) mxSqlLen = *(*int32)(unsafe.Pointer(db + 116 + 1*4)) if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 { libc.AtomicStoreNInt32(db+304, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) @@ -166205,10 +160235,6 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { (*TParse)(unsafe.Pointer(pParse)).FzTail = zSql pEngine = bp + 4 _sqlite3ParserInit(tls, pEngine, pParse) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) pParentParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse for int32(1) != 0 { @@ -166220,7 +160246,6 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { break } if *(*int32)(unsafe.Pointer(bp)) >= int32(TK_WINDOW) { - _ = libc.Int32FromInt32(0) if libc.AtomicLoadNInt32(db+304, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERRUPT) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -166245,21 +160270,18 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { n = 0 } else { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _analyzeWindowKeyword(tls, zSql+6) } else { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _analyzeOverKeyword(tls, zSql+4, lastTokenParsed) } else { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { if *(*int32)(unsafe.Pointer(bp)) != int32(TK_QNUMBER) { (*(*TToken)(unsafe.Pointer(bp + 1224))).Fz = zSql - (*(*TToken)(unsafe.Pointer(bp + 1224))).Fn = uint32(n) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23822, libc.VaList(bp+1240, bp+1224)) + (*(*TToken)(unsafe.Pointer(bp + 1224))).Fn = libc.Uint32FromInt32(n) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23851, libc.VaList(bp+1240, bp+1224)) break } } @@ -166268,16 +160290,14 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { } } (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fz = zSql - (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fn = uint32(n) + (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fn = libc.Uint32FromInt32(n) _sqlite3Parser(tls, pEngine, *(*int32)(unsafe.Pointer(bp)), (*TParse)(unsafe.Pointer(pParse)).FsLastToken) lastTokenParsed = *(*int32)(unsafe.Pointer(bp)) zSql += uintptr(n) - _ = libc.Int32FromInt32(0) if (*TParse)(unsafe.Pointer(pParse)).Frc != SQLITE_OK { break } } - _ = libc.Int32FromInt32(0) _sqlite3ParserFinalize(tls, pEngine) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -166286,26 +160306,25 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if (*TParse)(unsafe.Pointer(pParse)).FzErrMsg == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+3859, libc.VaList(bp+1240, _sqlite3ErrStr(tls, (*TParse)(unsafe.Pointer(pParse)).Frc))) } - Xsqlite3_log(tls, (*TParse)(unsafe.Pointer(pParse)).Frc, __ccgo_ts+23847, libc.VaList(bp+1240, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg, (*TParse)(unsafe.Pointer(pParse)).FzTail)) + Xsqlite3_log(tls, (*TParse)(unsafe.Pointer(pParse)).Frc, __ccgo_ts+23876, libc.VaList(bp+1240, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg, (*TParse)(unsafe.Pointer(pParse)).FzTail)) nErr++ } (*TParse)(unsafe.Pointer(pParse)).FzTail = zSql Xsqlite3_free(tls, (*TParse)(unsafe.Pointer(pParse)).FapVtabLock) - if (*TParse)(unsafe.Pointer(pParse)).FpNewTable != 0 && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { + if (*TParse)(unsafe.Pointer(pParse)).FpNewTable != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { /* If the pParse->declareVtab flag is set, do not delete any table ** structure built up in pParse->pNewTable. The calling code (see vtab.c) ** will take responsibility for freeing the Table structure. */ _sqlite3DeleteTable(tls, db, (*TParse)(unsafe.Pointer(pParse)).FpNewTable) } - if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3DeleteTrigger(tls, db, (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger) } if (*TParse)(unsafe.Pointer(pParse)).FpVList != 0 { _sqlite3DbNNFreeNN(tls, db, (*TParse)(unsafe.Pointer(pParse)).FpVList) } (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParentParse - _ = libc.Int32FromInt32(0) return nErr } @@ -166437,7 +160456,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { zSql++ } if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { - return libc.BoolInt32(int32(state) == int32(1)) + return libc.BoolInt32(libc.Int32FromUint8(state) == int32(1)) } token = uint8(tkWS) case int32('['): /* Microsoft-style identifiers in [...] */ @@ -166464,10 +160483,10 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { } token = uint8(tkOTHER) default: - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zSql)))])&int32(0x46) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zSql)))])&int32(0x46) != 0 { nId = int32(1) for { - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zSql + uintptr(nId))))])&int32(0x46) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zSql + uintptr(nId))))])&int32(0x46) != 0) { break } goto _1 @@ -166479,7 +160498,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { case int32('c'): fallthrough case int32('C'): - if nId == int32(6) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23858, int32(6)) == 0 { + if nId == int32(6) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23887, int32(6)) == 0 { token = uint8(tkCREATE) } else { token = uint8(tkOTHER) @@ -166490,10 +160509,10 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { if nId == int32(7) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+20511, int32(7)) == 0 { token = uint8(tkTRIGGER) } else { - if nId == int32(4) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23865, int32(4)) == 0 { + if nId == int32(4) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23894, int32(4)) == 0 { token = uint8(tkTEMP) } else { - if nId == int32(9) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23870, int32(9)) == 0 { + if nId == int32(9) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23899, int32(9)) == 0 { token = uint8(tkTEMP) } else { token = uint8(tkOTHER) @@ -166503,10 +160522,10 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { case int32('e'): fallthrough case int32('E'): - if nId == int32(3) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23880, int32(3)) == 0 { + if nId == int32(3) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23909, int32(3)) == 0 { token = uint8(tkEND) } else { - if nId == int32(7) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23884, int32(7)) == 0 { + if nId == int32(7) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23913, int32(7)) == 0 { token = uint8(tkEXPLAIN) } else { token = uint8(tkOTHER) @@ -166526,7 +160545,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { state = *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_trans)) + uintptr(state)*8 + uintptr(token))) zSql++ } - return libc.BoolInt32(int32(state) == int32(1)) + return libc.BoolInt32(libc.Int32FromUint8(state) == int32(1)) } /* A complex statement machine used to detect the end of a CREATE TRIGGER @@ -166772,7 +160791,6 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { /* If the following assert() fails on some obscure processor/compiler ** combination, the work-around is to set the correct pointer ** size at compile-time using -DSQLITE_PTRSIZE=n compile-time option */ - _ = libc.Int32FromInt32(0) /* If SQLite is already completely initialized, then this call ** to sqlite3_initialize() should be a no-op. But the initialization ** must be complete. So isInit must not be set until the very end @@ -166865,7 +160883,6 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { Xsqlite3_mutex_enter(tls, pMainMtx) _sqlite3Config.FnRefInitMutex-- if _sqlite3Config.FnRefInitMutex <= 0 { - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_free(tls, _sqlite3Config.FpInitMutex) _sqlite3Config.FpInitMutex = uintptr(0) } @@ -166948,7 +160965,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { */ if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)<<op&_mAnytimeConfigOption == uint64(0) { - return _sqlite3MisuseError(tls, int32(180234)) + return _sqlite3MisuseError(tls, int32(180224)) } } ap = va @@ -166994,13 +161011,13 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { } *(*Tsqlite3_mem_methods)(unsafe.Pointer(libc.VaUintptr(&ap))) = _sqlite3Config.Fm case int32(SQLITE_CONFIG_MEMSTATUS): - _ = libc.Int32FromInt32(0) /* Cannot change at runtime */ + /* Cannot change at runtime */ /* EVIDENCE-OF: R-61275-35157 The SQLITE_CONFIG_MEMSTATUS option takes ** single argument of type int, interpreted as a boolean, which enables ** or disables the collection of memory allocation statistics. */ _sqlite3Config.FbMemstat = libc.VaInt32(&ap) case int32(SQLITE_CONFIG_SMALL_MALLOC): - _sqlite3Config.FbSmallMalloc = uint8(libc.VaInt32(&ap)) + _sqlite3Config.FbSmallMalloc = libc.Uint8FromInt32(libc.VaInt32(&ap)) case int32(SQLITE_CONFIG_PAGECACHE): /* EVIDENCE-OF: R-18761-36601 There are three arguments to ** SQLITE_CONFIG_PAGECACHE: A pointer to 8-byte aligned memory (pMem), @@ -167067,13 +161084,13 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** enabled. If the parameter is zero, then URI handling is globally ** disabled. */ bOpenUri = libc.VaInt32(&ap) - libc.AtomicStoreNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, uint8(bOpenUri), libc.Int32FromInt32(__ATOMIC_RELAXED)) + libc.AtomicStoreNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Uint8FromInt32(bOpenUri), libc.Int32FromInt32(__ATOMIC_RELAXED)) case int32(SQLITE_CONFIG_COVERING_INDEX_SCAN): /* EVIDENCE-OF: R-36592-02772 The SQLITE_CONFIG_COVERING_INDEX_SCAN ** option takes a single integer argument which is interpreted as a ** boolean in order to enable or disable the use of covering indices for ** full table scans in the query optimizer. */ - _sqlite3Config.FbUseCis = uint8(libc.VaInt32(&ap)) + _sqlite3Config.FbUseCis = libc.Uint8FromInt32(libc.VaInt32(&ap)) case int32(SQLITE_CONFIG_MMAP_SIZE): /* EVIDENCE-OF: R-58063-38258 SQLITE_CONFIG_MMAP_SIZE takes two 64-bit ** integer (sqlite3_int64) values that are the default mmap size limit @@ -167164,7 +161181,7 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, uint64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -167194,10 +161211,9 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart = pStart (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(sz) - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue = uint16(sz) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = libc.Uint16FromInt32(sz) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue = libc.Uint16FromInt32(sz) if pStart != 0 { - _ = libc.Int32FromInt32(0) p = pStart i = 0 for { @@ -167228,7 +161244,6 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 ; i++ } - _ = libc.Int32FromInt32(0) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = p (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable = uint32(0) if pBuf == uintptr(0) { @@ -167236,8 +161251,8 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } else { v4 = 0 } - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbMalloced = uint8(v4) - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot = uint32(nBig + nSm) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbMalloced = libc.Uint8FromInt32(v4) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot = libc.Uint32FromInt32(nBig + nSm) } else { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = uintptr(0) @@ -167250,7 +161265,6 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd - _ = libc.Int32FromInt32(0) return SQLITE_OK } @@ -167367,7 +161381,7 @@ func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r int3 rc = int32(SQLITE_ERROR) /* IMP: R-42790-23372 */ i = uint32(0) for { - if !(i < uint32(int32(libc.Uint32FromInt64(144)/libc.Uint32FromInt64(8)))) { + if !(i < libc.Uint32FromInt32(libc.Int32FromUint32(libc.Uint32FromInt64(144)/libc.Uint32FromInt64(8)))) { break } if _aFlagOp[i].Fop == op { @@ -167448,7 +161462,7 @@ var _aFlagOp = [18]struct { }, 10: { Fop: int32(SQLITE_DBCONFIG_WRITABLE_SCHEMA), - Fmask: uint32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), + Fmask: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), }, 11: { Fop: int32(SQLITE_DBCONFIG_LEGACY_ALTER_TABLE), @@ -167499,8 +161513,7 @@ func _binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nK /* EVIDENCE-OF: R-65033-28449 The built-in BINARY collation compares ** strings byte by byte using the memcmp() function from the standard C ** library. */ - _ = libc.Int32FromInt32(0) - rc = libc.Xmemcmp(tls, pKey1, pKey2, uint32(n)) + rc = libc.Xmemcmp(tls, pKey1, pKey2, libc.Uint32FromInt32(n)) if rc == 0 { rc = nKey1 - nKey2 } @@ -167518,10 +161531,10 @@ func _rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nK _, _ = pK1, pK2 pK1 = pKey1 pK2 = pKey2 - for nKey1 != 0 && int32(*(*Tu8)(unsafe.Pointer(pK1 + uintptr(nKey1-int32(1))))) == int32(' ') { + for nKey1 != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pK1 + uintptr(nKey1-int32(1))))) == int32(' ') { nKey1-- } - for nKey2 != 0 && int32(*(*Tu8)(unsafe.Pointer(pK2 + uintptr(nKey2-int32(1))))) == int32(' ') { + for nKey2 != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pK2 + uintptr(nKey2-int32(1))))) == int32(' ') { nKey2-- } return _binCollFunc(tls, pUser, nKey1, pKey1, nKey2, pKey2) @@ -167533,7 +161546,6 @@ func _rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nK // ** Return true if CollSeq is the default built-in BINARY. // */ func _sqlite3IsBinary(tls *libc.TLS, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return libc.BoolInt32(p == uintptr(0) || (*TCollSeq)(unsafe.Pointer(p)).FxCmp == __ccgo_fp(_binCollFunc)) } @@ -167641,7 +161653,6 @@ func _sqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { func _functionDestroy(tls *libc.TLS, db uintptr, p uintptr) { var pDestructor uintptr _ = pDestructor - _ = libc.Int32FromInt32(0) pDestructor = *(*uintptr)(unsafe.Pointer(p + 36)) if pDestructor != 0 { (*TFuncDestructor)(unsafe.Pointer(pDestructor)).FnRef-- @@ -167676,7 +161687,7 @@ func _disconnectAllVtab(tls *libc.TLS, db uintptr) { break } pTab = (*THashElem)(unsafe.Pointer(p)).Fdata - if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { _sqlite3VtabDisconnect(tls, db, pTab) } goto _2 @@ -167718,7 +161729,6 @@ func _connectionIsBusy(tls *libc.TLS, db uintptr) (r int32) { var j int32 var pBt uintptr _, _ = j, pBt - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { return int32(1) } @@ -167753,10 +161763,10 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(181034)) + return _sqlite3MisuseError(tls, int32(181024)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_CLOSE), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0)) } /* Force xDisconnect calls on all virtual tables */ @@ -167773,14 +161783,13 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+23892, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+23921, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } for (*Tsqlite3)(unsafe.Pointer(db)).FpDbData != 0 { p = (*Tsqlite3)(unsafe.Pointer(db)).FpDbData (*Tsqlite3)(unsafe.Pointer(db)).FpDbData = (*TDbClientData)(unsafe.Pointer(p)).FpNext - _ = libc.Int32FromInt32(0) if (*TDbClientData)(unsafe.Pointer(p)).FxDestructor != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TDbClientData)(unsafe.Pointer(p)).FxDestructor})))(tls, (*TDbClientData)(unsafe.Pointer(p)).FpData) } @@ -167876,7 +161885,7 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { ** or if the connection has not yet been closed by sqlite3_close_v2(), ** then just leave the mutex and return. */ - if int32((*Tsqlite3)(unsafe.Pointer(db)).FeOpenState) != int32(SQLITE_STATE_ZOMBIE) || _connectionIsBusy(tls, db) != 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FeOpenState) != int32(SQLITE_STATE_ZOMBIE) || _connectionIsBusy(tls, db) != 0 { Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return } @@ -167918,8 +161927,6 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { _sqlite3VtabUnlockList(tls, db) /* Free up the array of auxiliary databases */ _sqlite3CollapseDatabaseArray(tls, db) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Tell the code in notify.c that the connection no longer holds any ** locks and does not require any further unlock-notify callbacks. */ @@ -168000,7 +162007,6 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_CLOSED) Xsqlite3_mutex_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbMalloced != 0 { Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } @@ -168021,7 +162027,6 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { var p uintptr _, _, _, _ = i, inTrans, p, schemaChange inTrans = 0 - _ = libc.Int32FromInt32(0) _sqlite3BeginBenignMalloc(tls) /* Obtain all b-tree mutexes before making any calls to BtreeRollback(). ** This is important in case the transaction being rolled back has @@ -168030,7 +162035,7 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { ** the database rollback and schema reset, which can cause false ** corruption reports in some cases. */ _sqlite3BtreeEnterAll(tls, db) - schemaChange = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_SchemaChange) != uint32(0) && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0) + schemaChange = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_SchemaChange) != uint32(0) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -168058,7 +162063,7 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* Any deferred constraint violations have now been resolved. */ (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 - *(*Tu64)(unsafe.Pointer(db + 28)) &= ^(libc.Uint64FromInt32(SQLITE_DeferFKs) | uint64(libc.Int32FromInt32(0x00002))<<libc.Int32FromInt32(32)) + *(*Tu64)(unsafe.Pointer(db + 28)) &= ^(libc.Uint64FromInt32(SQLITE_DeferFKs) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00002))<<libc.Int32FromInt32(32)) /* If one has been configured, invoke the rollback-hook callback */ if (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback != 0 && (inTrans != 0 || !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0)) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg) @@ -168079,17 +162084,17 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24435 + zErr = __ccgo_ts + 24464 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8): - zErr = __ccgo_ts + 24449 + zErr = __ccgo_ts + 24478 case int32(SQLITE_ROW): - zErr = __ccgo_ts + 24471 + zErr = __ccgo_ts + 24500 case int32(SQLITE_DONE): - zErr = __ccgo_ts + 24493 + zErr = __ccgo_ts + 24522 default: rc &= int32(0xff) - if rc >= 0 && rc < int32(libc.Uint32FromInt64(116)/libc.Uint32FromInt64(4)) && _aMsg[rc] != uintptr(0) { + if rc >= 0 && rc < libc.Int32FromUint32(libc.Uint32FromInt64(116)/libc.Uint32FromInt64(4)) && _aMsg[rc] != uintptr(0) { zErr = _aMsg[rc] } break @@ -168098,31 +162103,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 23960, - 1: __ccgo_ts + 23973, - 3: __ccgo_ts + 23989, - 4: __ccgo_ts + 24014, - 5: __ccgo_ts + 24028, - 6: __ccgo_ts + 24047, + 0: __ccgo_ts + 23989, + 1: __ccgo_ts + 24002, + 3: __ccgo_ts + 24018, + 4: __ccgo_ts + 24043, + 5: __ccgo_ts + 24057, + 6: __ccgo_ts + 24076, 7: __ccgo_ts + 1632, - 8: __ccgo_ts + 24072, - 9: __ccgo_ts + 24109, - 10: __ccgo_ts + 24121, - 11: __ccgo_ts + 24136, - 12: __ccgo_ts + 24169, - 13: __ccgo_ts + 24187, - 14: __ccgo_ts + 24212, - 15: __ccgo_ts + 24241, + 8: __ccgo_ts + 24101, + 9: __ccgo_ts + 24138, + 10: __ccgo_ts + 24150, + 11: __ccgo_ts + 24165, + 12: __ccgo_ts + 24198, + 13: __ccgo_ts + 24216, + 14: __ccgo_ts + 24241, + 15: __ccgo_ts + 24270, 17: __ccgo_ts + 6085, 18: __ccgo_ts + 5487, - 19: __ccgo_ts + 24258, - 20: __ccgo_ts + 24276, - 21: __ccgo_ts + 24294, - 23: __ccgo_ts + 24328, - 25: __ccgo_ts + 24349, - 26: __ccgo_ts + 24375, - 27: __ccgo_ts + 24398, - 28: __ccgo_ts + 24419, + 19: __ccgo_ts + 24287, + 20: __ccgo_ts + 24305, + 21: __ccgo_ts + 24323, + 23: __ccgo_ts + 24357, + 25: __ccgo_ts + 24378, + 26: __ccgo_ts + 24404, + 27: __ccgo_ts + 24427, + 28: __ccgo_ts + 24448, } // C documentation @@ -168142,13 +162147,12 @@ func _sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) (r int3 _, _, _, _ = db, delay, prior, tmout db = ptr tmout = (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout - _ = libc.Int32FromInt32(0) - if count < int32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(1)) { - delay = int32(_delays[count]) - prior = int32(_totals[count]) + if count < libc.Int32FromUint32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(1)) { + delay = libc.Int32FromUint8(_delays[count]) + prior = libc.Int32FromUint8(_totals[count]) } else { - delay = int32(_delays[int32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(1))-libc.Int32FromInt32(1)]) - prior = int32(_totals[int32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(1))-libc.Int32FromInt32(1)]) + delay*(count-(int32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(1))-libc.Int32FromInt32(1))) + delay = libc.Int32FromUint8(_delays[libc.Int32FromUint32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(1))-libc.Int32FromInt32(1)]) + prior = libc.Int32FromUint8(_totals[libc.Int32FromUint32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(1))-libc.Int32FromInt32(1)]) + delay*(count-(libc.Int32FromUint32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(1))-libc.Int32FromInt32(1))) } if prior+delay > tmout { delay = tmout - prior @@ -168244,7 +162248,7 @@ func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress - (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = uint32(nOps) + (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = uintptr(0) @@ -168301,18 +162305,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(181689)) + return _sqlite3MisuseError(tls, int32(181679)) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) /* The SQLITE_INNOCUOUS flag is the same bit as SQLITE_FUNC_UNSAFE. But ** the meaning is inverted. So flip the bit. */ - _ = libc.Int32FromInt32(0) extraFlags ^= int32(SQLITE_FUNC_UNSAFE) /* tag-20230109-1 */ /* If SQLITE_UTF16 is specified as the encoding type, transform this ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the @@ -168347,11 +162346,10 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i ** is being overridden/deleted but there are no active VMs, allow the ** operation to continue but invalidate all precompiled statements. */ - p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, uint8(enc), uint8(0)) - if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == uint32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { + p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) + if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24516, 0) - _ = libc.Int32FromInt32(0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24545, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -168363,8 +162361,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i return SQLITE_OK } } - p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, uint8(enc), uint8(1)) - _ = libc.Int32FromInt32(0) + p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(1)) if !(p != 0) { return int32(SQLITE_NOMEM) } @@ -168375,7 +162372,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i (*TFuncDestructor)(unsafe.Pointer(pDestructor)).FnRef++ } *(*uintptr)(unsafe.Pointer(p + 36)) = pDestructor - (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | uint32(extraFlags) + (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) if xSFunc != 0 { v1 = xSFunc } else { @@ -168386,7 +162383,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData - (*TFuncDef)(unsafe.Pointer(p)).FnArg = int8(uint16(nArg)) + (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int8FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK } @@ -168419,7 +162416,6 @@ func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, en } rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } @@ -168453,7 +162449,6 @@ func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _ = libc.Int32FromInt32(0) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) @@ -168480,7 +162475,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24579, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24608, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -168539,7 +162534,7 @@ func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r } else { v1 = 0 } - (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(v1) + (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) *(*uintptr)(unsafe.Pointer(db + 212)) = xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -168752,14 +162747,10 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if pnCkpt != 0 { *(*int32)(unsafe.Pointer(pnCkpt)) = -int32(1) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(182304)) + return _sqlite3MisuseError(tls, int32(182294)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -168769,7 +162760,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24630, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24659, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -168825,9 +162816,6 @@ func _sqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog _, _, _, _ = bBusy, i, rc, v2 rc = SQLITE_OK /* Used to iterate through attached dbs */ bBusy = 0 /* True if SQLITE_BUSY has been encountered */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* See forum post a006d86f72 */ i = 0 for { @@ -168878,7 +162866,7 @@ func _sqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog // ** 3 any memory (return 1) // */ func _sqlite3TempInMemory(tls *libc.TLS, db uintptr) (r int32) { - return libc.BoolInt32(int32((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store) == int32(2)) + return libc.BoolInt32(libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store) == int32(2)) } // C documentation @@ -168894,7 +162882,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(182440))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(182430))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -168906,7 +162894,6 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { v1 = uintptr(0) } z = v1 - _ = libc.Int32FromInt32(0) if z == uintptr(0) { z = _sqlite3ErrStr(tls, (*Tsqlite3)(unsafe.Pointer(db)).FerrCode) } @@ -169027,7 +163014,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182519)) + return _sqlite3MisuseError(tls, int32(182509)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -169037,7 +163024,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182528)) + return _sqlite3MisuseError(tls, int32(182518)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -169077,26 +163064,25 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl - _ = libc.Int32FromInt32(0) /* If SQLITE_UTF16 is specified as the encoding type, transform this ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally. */ - enc2 = int32(enc) + enc2 = libc.Int32FromUint8(enc) if enc2 == int32(SQLITE_UTF16) || enc2 == int32(SQLITE_UTF16_ALIGNED) { enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(182576)) + return _sqlite3MisuseError(tls, int32(182566)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there ** are no active VMs, invalidate any pre-compiled statements. */ - pColl = _sqlite3FindCollSeq(tls, db, uint8(enc2), zName, 0) + pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24651, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24680, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -169106,7 +163092,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui ** Also, collation destructor - CollSeq.xDel() - function may need ** to be called. */ - if int32((*TCollSeq)(unsafe.Pointer(pColl)).Fenc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) == enc2 { + if libc.Int32FromUint8((*TCollSeq)(unsafe.Pointer(pColl)).Fenc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) == enc2 { aColl = _sqlite3HashFind(tls, db+440, zName) j = 0 for { @@ -169114,7 +163100,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui break } p = aColl + uintptr(j)*20 - if int32((*TCollSeq)(unsafe.Pointer(p)).Fenc) == int32((*TCollSeq)(unsafe.Pointer(pColl)).Fenc) { + if libc.Int32FromUint8((*TCollSeq)(unsafe.Pointer(p)).Fenc) == libc.Int32FromUint8((*TCollSeq)(unsafe.Pointer(pColl)).Fenc) { if (*TCollSeq)(unsafe.Pointer(p)).FxDel != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TCollSeq)(unsafe.Pointer(p)).FxDel})))(tls, (*TCollSeq)(unsafe.Pointer(p)).FpUser) } @@ -169127,14 +163113,14 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui } } } - pColl = _sqlite3FindCollSeq(tls, db, uint8(enc2), zName, int32(1)) + pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, int32(1)) if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel - (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = uint8(enc2 | int32(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) + (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK } @@ -169185,19 +163171,6 @@ func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) (r ** macro called SQLITE_MAX_NAME. (The "_LIMIT_" in the name is changed to ** "_MAX_".) */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if limitId < 0 || limitId >= libc.Int32FromInt32(SQLITE_LIMIT_WORKER_THREADS)+libc.Int32FromInt32(1) { return -int32(1) } @@ -169256,10 +163229,9 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - _ = libc.Int32FromInt32(0) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24719, uint32(5)) == 0 { /* Input character index */ - iOut = 0 /* Output character index */ - nByte = uint64(nUri + int32(8)) /* Bytes of space to allocate */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24748, uint32(5)) == 0 { /* Input character index */ + iOut = 0 /* Output character index */ + nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen ** method that there may be extra parameters following the file-name. */ flags |= uint32(SQLITE_OPEN_URI) @@ -169287,8 +163259,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24725, zUri+7, uint32(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24735, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24754, zUri+7, uint32(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24764, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -169311,14 +163283,13 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u break } iIn++ - if int32(c) == int32('%') && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn))))])&int32(0x08) != 0 && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn+int32(1)))))])&int32(0x08) != 0 { + if int32(c) == int32('%') && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn))))])&int32(0x08) != 0 && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn+int32(1)))))])&int32(0x08) != 0 { v3 = iIn iIn++ - octet = int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(v3)))))) << int32(4) + octet = libc.Int32FromUint8(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(v3)))))) << int32(4) v4 = iIn iIn++ - octet += int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(v4)))))) - _ = libc.Int32FromInt32(0) + octet += libc.Int32FromUint8(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(v4)))))) if octet == 0 { /* This branch is taken when "%00" appears within the URI. In this ** case we ignore all text in the remainder of the path, name or @@ -169378,23 +163349,23 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24763, zOpt, uint32(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24792, zOpt, uint32(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24767, zOpt, uint32(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24796, zOpt, uint32(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24767 + zModeType = __ccgo_ts + 24796 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24788, zOpt, uint32(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24817, zOpt, uint32(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) - limit = int32(uint32(mask) & flags) + limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) zModeType = __ccgo_ts + 3468 } if aMode != 0 { @@ -169411,7 +163382,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u Fz uintptr Fmode int32 })(unsafe.Pointer(aMode + uintptr(i)*8))).Fz - if nVal == _sqlite3Strlen30(tls, z) && 0 == libc.Xmemcmp(tls, zVal, z, uint32(nVal)) { + if nVal == _sqlite3Strlen30(tls, z) && 0 == libc.Xmemcmp(tls, zVal, z, libc.Uint32FromInt32(nVal)) { mode = (*(*struct { Fz uintptr Fmode int32 @@ -169424,36 +163395,36 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24803, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24832, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24823, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24852, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } - flags = flags&uint32(^mask) | uint32(mode) + flags = flags&libc.Uint32FromInt32(^mask) | libc.Uint32FromInt32(mode) } } zOpt = zVal + uintptr(nVal+int32(1)) } } else { - zFile = Xsqlite3_malloc64(tls, uint64(nUri+int32(8))) + zFile = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nUri+int32(8))) if !(zFile != 0) { return int32(SQLITE_NOMEM) } libc.Xmemset(tls, zFile, 0, uint32(4)) zFile += uintptr(4) if nUri != 0 { - libc.Xmemcpy(tls, zFile, zUri, uint32(nUri)) + libc.Xmemcpy(tls, zFile, zUri, libc.Uint32FromInt32(nUri)) } libc.Xmemset(tls, zFile+uintptr(nUri), 0, uint32(4)) - flags &= uint32(^libc.Int32FromInt32(SQLITE_OPEN_URI)) + flags &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_URI)) } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24847, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24876, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -169473,11 +163444,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24773, + Fz: __ccgo_ts + 24802, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24780, + Fz: __ccgo_ts + 24809, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -169488,15 +163459,15 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24793, + Fz: __ccgo_ts + 24822, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24796, + Fz: __ccgo_ts + 24825, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24799, + Fz: __ccgo_ts + 24828, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { @@ -169551,7 +163522,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 if rc != 0 { return rc } - if int32(_sqlite3Config.FbCoreMutex) == 0 { + if libc.Int32FromUint8(_sqlite3Config.FbCoreMutex) == 0 { isThreadsafe = 0 } else { if *(*uint32)(unsafe.Pointer(bp))&uint32(SQLITE_OPEN_NOMUTEX) != 0 { @@ -169560,12 +163531,12 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 if *(*uint32)(unsafe.Pointer(bp))&uint32(SQLITE_OPEN_FULLMUTEX) != 0 { isThreadsafe = int32(1) } else { - isThreadsafe = int32(_sqlite3Config.FbFullMutex) + isThreadsafe = libc.Int32FromUint8(_sqlite3Config.FbFullMutex) } } } if *(*uint32)(unsafe.Pointer(bp))&uint32(SQLITE_OPEN_PRIVATECACHE) != 0 { - *(*uint32)(unsafe.Pointer(bp)) &= uint32(^libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE)) + *(*uint32)(unsafe.Pointer(bp)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE)) } else { if _sqlite3Config.FsharedCacheEnabled != 0 { *(*uint32)(unsafe.Pointer(bp)) |= uint32(SQLITE_OPEN_SHAREDCACHE) @@ -169580,7 +163551,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 ** SQLITE_OPEN_PRIVATECACHE, SQLITE_OPEN_EXRESCODE, and some reserved ** bits. Silently mask off all other flags. */ - *(*uint32)(unsafe.Pointer(bp)) &= uint32(^(libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_DB) | libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_TRANSIENT_DB) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) | libc.Int32FromInt32(SQLITE_OPEN_TEMP_JOURNAL) | libc.Int32FromInt32(SQLITE_OPEN_SUBJOURNAL) | libc.Int32FromInt32(SQLITE_OPEN_SUPER_JOURNAL) | libc.Int32FromInt32(SQLITE_OPEN_NOMUTEX) | libc.Int32FromInt32(SQLITE_OPEN_FULLMUTEX) | libc.Int32FromInt32(SQLITE_OPEN_WAL))) + *(*uint32)(unsafe.Pointer(bp)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_DB) | libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_TRANSIENT_DB) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) | libc.Int32FromInt32(SQLITE_OPEN_TEMP_JOURNAL) | libc.Int32FromInt32(SQLITE_OPEN_SUBJOURNAL) | libc.Int32FromInt32(SQLITE_OPEN_SUPER_JOURNAL) | libc.Int32FromInt32(SQLITE_OPEN_NOMUTEX) | libc.Int32FromInt32(SQLITE_OPEN_FULLMUTEX) | libc.Int32FromInt32(SQLITE_OPEN_WAL))) /* Allocate the sqlite data structure */ db = _sqlite3MallocZero(tls, uint64(564)) if db == uintptr(0) { @@ -169602,13 +163573,12 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 } else { v1 = uint32(0xff) } - (*Tsqlite3)(unsafe.Pointer(db)).FerrMask = int32(v1) + (*Tsqlite3)(unsafe.Pointer(db)).FerrMask = libc.Int32FromUint32(v1) (*Tsqlite3)(unsafe.Pointer(db)).FnDb = int32(2) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_BUSY) (*Tsqlite3)(unsafe.Pointer(db)).FaDb = db + 468 (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable = uint32(1) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, db+116, uintptr(unsafe.Pointer(&_aHardLimit)), uint32(48)) *(*int32)(unsafe.Pointer(db + 116 + 11*4)) = SQLITE_DEFAULT_WORKER_THREADS (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = uint8(1) @@ -169616,7 +163586,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 (*Tsqlite3)(unsafe.Pointer(db)).FszMmap = _sqlite3Config.FszMmap (*Tsqlite3)(unsafe.Pointer(db)).FnextPagesize = 0 (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit = uintptr(unsafe.Pointer(&_sqlite3StdType)) /* Any array of string ptrs will do */ - *(*Tu64)(unsafe.Pointer(db + 28)) |= uint64(uint32(libc.Int32FromInt32(SQLITE_ShortColNames)|libc.Int32FromInt32(SQLITE_EnableTrigger)) | libc.Uint32FromUint32(SQLITE_EnableView) | libc.Uint32FromInt32(SQLITE_CacheSpill) | libc.Uint32FromInt32(SQLITE_TrustedSchema) | libc.Uint32FromInt32(SQLITE_DqsDML) | libc.Uint32FromInt32(SQLITE_DqsDDL) | libc.Uint32FromInt32(SQLITE_AutoIndex)) + *(*Tu64)(unsafe.Pointer(db + 28)) |= uint64(libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_ShortColNames)|libc.Int32FromInt32(SQLITE_EnableTrigger)) | libc.Uint32FromUint32(SQLITE_EnableView) | libc.Uint32FromInt32(SQLITE_CacheSpill) | libc.Uint32FromInt32(SQLITE_TrustedSchema) | libc.Uint32FromInt32(SQLITE_DqsDML) | libc.Uint32FromInt32(SQLITE_DqsDDL) | libc.Uint32FromInt32(SQLITE_AutoIndex)) _sqlite3HashInit(tls, db+440) _sqlite3HashInit(tls, db+396) /* Add the default collation sequence BINARY. BINARY works for both UTF-8 @@ -169630,7 +163600,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, __ccgo_ts+22496, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24863, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+24892, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -169647,14 +163617,11 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 ** 6: SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE */ (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags = *(*uint32)(unsafe.Pointer(bp)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* READONLY */ /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(183248)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(183238)) /* IMP: R-18321-05872 */ } else { rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+4, bp+8) } @@ -169671,9 +163638,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) goto opendb_out } - _ = libc.Int32FromInt32(0) /* Open the backend database driver */ - rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer(bp + 4)), db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb+4, 0, int32(*(*uint32)(unsafe.Pointer(bp))|uint32(SQLITE_OPEN_MAIN_DB))) + rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer(bp + 4)), db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb+4, 0, libc.Int32FromUint32(*(*uint32)(unsafe.Pointer(bp))|uint32(SQLITE_OPEN_MAIN_DB))) if rc != SQLITE_OK { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) { rc = int32(SQLITE_NOMEM) @@ -169692,8 +163658,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 ** database it is OFF. This matches the pager layer defaults. */ (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6649 - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = uint8(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 23865 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 23894 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -169709,7 +163675,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* Load compiled-in extensions */ i = 0 for { - if !(rc == SQLITE_OK && i < int32(libc.Uint32FromInt64(20)/libc.Uint32FromInt64(4))) { + if !(rc == SQLITE_OK && i < libc.Int32FromUint32(libc.Uint32FromInt64(20)/libc.Uint32FromInt64(4))) { break } rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3BuiltinExtensions[i]})))(tls, db) @@ -169742,11 +163708,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 opendb_out: ; if db != 0 { - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) } rc = Xsqlite3_errcode(tls, db) - _ = libc.Int32FromInt32(0) if rc&int32(0xff) == int32(SQLITE_NOMEM) { Xsqlite3_close(tls, db) db = uintptr(0) @@ -169766,11 +163730,11 @@ opendb_out: // ** Open a new database handle. // */ func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { - return _openDatabase(tls, zFilename, ppDb, uint32(libc.Int32FromInt32(SQLITE_OPEN_READWRITE)|libc.Int32FromInt32(SQLITE_OPEN_CREATE)), uintptr(0)) + return _openDatabase(tls, zFilename, ppDb, libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_READWRITE)|libc.Int32FromInt32(SQLITE_OPEN_CREATE)), uintptr(0)) } func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) (r int32) { - return _openDatabase(tls, filename, ppDb, uint32(flags), zVfs) + return _openDatabase(tls, filename, ppDb, libc.Uint32FromInt32(flags), zVfs) } // C documentation @@ -169789,15 +163753,14 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24869 + zFilename = __ccgo_ts + 24898 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) zFilename8 = _sqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zFilename8 != 0 { - rc = _openDatabase(tls, zFilename8, ppDb, uint32(libc.Int32FromInt32(SQLITE_OPEN_READWRITE)|libc.Int32FromInt32(SQLITE_OPEN_CREATE)), uintptr(0)) - _ = libc.Int32FromInt32(0) - if rc == SQLITE_OK && !(int32((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppDb)))).FaDb))).FpSchema)).FschemaFlags)&libc.Int32FromInt32(DB_SchemaLoaded) == libc.Int32FromInt32(DB_SchemaLoaded)) { + rc = _openDatabase(tls, zFilename8, ppDb, libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_READWRITE)|libc.Int32FromInt32(SQLITE_OPEN_CREATE)), uintptr(0)) + if rc == SQLITE_OK && !(libc.Int32FromUint16((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppDb)))).FaDb))).FpSchema)).FschemaFlags)&libc.Int32FromInt32(DB_SchemaLoaded) == libc.Int32FromInt32(DB_SchemaLoaded)) { v1 = libc.Uint8FromInt32(SQLITE_UTF16LE) (*Tsqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppDb)))).Fenc = v1 (*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppDb)))).FaDb))).FpSchema)).Fenc = v1 @@ -169827,8 +163790,7 @@ func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _ = libc.Int32FromInt32(0) - rc = _createCollation(tls, db, zName, uint8(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -169845,10 +163807,9 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i _, _ = rc, zName8 rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _ = libc.Int32FromInt32(0) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, uint8(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -169937,7 +163898,6 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin p = (*TDbClientData)(unsafe.Pointer(p)).FpNext } if p != 0 { - _ = libc.Int32FromInt32(0) if (*TDbClientData)(unsafe.Pointer(p)).FxDestructor != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TDbClientData)(unsafe.Pointer(p)).FxDestructor})))(tls, (*TDbClientData)(unsafe.Pointer(p)).FpData) } @@ -169991,7 +163951,7 @@ func Xsqlite3_global_recover(tls *libc.TLS) (r int32) { // ** by the next COMMIT or ROLLBACK. // */ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { - return int32((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) + return libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) } // C documentation @@ -170010,20 +163970,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24872, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+24901, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+24897) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+24926) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+24917) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+24946) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+24924) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+24953) } // C documentation @@ -170069,7 +164029,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, } /* Locate the table in question */ pTab = _sqlite3FindTable(tls, db, zTableName, zDbName) - if !(pTab != 0) || int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { + if !(pTab != 0) || libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { pTab = uintptr(0) goto error_out } @@ -170120,7 +164080,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, zDataType = _sqlite3ColumnType(tls, pCol, uintptr(0)) zCollSeq = _sqlite3ColumnColl(tls, pCol) notnull = libc.BoolInt32(int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0) - primarykey = libc.BoolInt32(int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) + primarykey = libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { zDataType = __ccgo_ts + 1136 @@ -170154,7 +164114,7 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+24941, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+24970, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -170208,7 +164168,7 @@ func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) (r i } else { v1 = uint32(0xff) } - (*Tsqlite3)(unsafe.Pointer(db)).FerrMask = int32(v1) + (*Tsqlite3)(unsafe.Pointer(db)).FerrMask = libc.Int32FromUint32(v1) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -170228,9 +164188,7 @@ func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, if pBtree != 0 { _sqlite3BtreeEnter(tls, pBtree) pPager = _sqlite3BtreePager(tls, pBtree) - _ = libc.Int32FromInt32(0) fd = _sqlite3PagerFile(tls, pPager) - _ = libc.Int32FromInt32(0) if op == int32(SQLITE_FCNTL_FILE_POINTER) { *(*uintptr)(unsafe.Pointer(pArg)) = fd rc = SQLITE_OK @@ -170330,7 +164288,6 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { case int32(SQLITE_TESTCTRL_PRNG_SEED): x = libc.VaInt32(&ap) db = libc.VaUintptr(&ap) - _ = libc.Int32FromInt32(0) if v2 = db != 0; v2 { v1 = (*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)).Fschema_cookie y = v1 @@ -170338,7 +164295,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { if v2 && v1 != 0 { x = y } - _sqlite3Config.FiPrngSeed = uint32(x) + _sqlite3Config.FiPrngSeed = libc.Uint32FromInt32(x) Xsqlite3_randomness(tls, 0, uintptr(0)) break /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); @@ -170357,9 +164314,9 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { db1 = libc.VaUintptr(&ap) b = libc.VaInt32(&ap) if b != 0 { - *(*Tu64)(unsafe.Pointer(db1 + 28)) |= uint64(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32) + *(*Tu64)(unsafe.Pointer(db1 + 28)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32) } else { - *(*Tu64)(unsafe.Pointer(db1 + 28)) &= ^(uint64(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) + *(*Tu64)(unsafe.Pointer(db1 + 28)) &= ^(libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) } break /* @@ -170421,7 +164378,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { rc = _sqlite3PendingByte newVal = libc.VaUint32(&ap) if newVal != 0 { - _sqlite3PendingByte = int32(newVal) + _sqlite3PendingByte = libc.Int32FromUint32(newVal) } break /* @@ -170438,7 +164395,6 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { fallthrough case int32(SQLITE_TESTCTRL_ASSERT): x1 = 0 - _ = libc.Int32FromInt32(0) rc = x1 break /* @@ -170565,7 +164521,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { */ fallthrough case int32(SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS): - _sqlite3Config.FbExtraSchemaChecks = uint8(libc.VaInt32(&ap)) + _sqlite3Config.FbExtraSchemaChecks = libc.Uint8FromInt32(libc.VaInt32(&ap)) break /* Set the threshold at which OP_Once counters reset back to zero. ** By default this is 0x7ffffffe (over 2 billion), but that value is @@ -170623,10 +164579,10 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db5)).Fmutex) iDb = _sqlite3FindDbName(tls, db5, libc.VaUintptr(&ap)) if iDb >= 0 { - (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FiDb = uint8(iDb) - (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.Fbusy = uint8(libc.AssignBitFieldPtr8Uint32(db5+168+8, uint32(libc.VaInt32(&ap)), 1, 1, 0x2)) - (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FnewTnum = uint32(libc.VaInt32(&ap)) - if int32((*Tsqlite3)(unsafe.Pointer(db5)).Finit1.Fbusy) == 0 && (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FnewTnum > uint32(0) { + (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FiDb = libc.Uint8FromInt32(iDb) + (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.Fbusy = uint8(libc.AssignBitFieldPtr8Uint32(db5+168+8, libc.Uint32FromInt32(libc.VaInt32(&ap)), 1, 1, 0x2)) + (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FnewTnum = libc.Uint32FromInt32(libc.VaInt32(&ap)) + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db5)).Finit1.Fbusy) == 0 && (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FnewTnum > uint32(0) { _sqlite3ResetAllSchemasOfConnection(tls, db5) } } @@ -170724,7 +164680,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { if b1 >= 0 { _sqlite3Config.FbUseLongDouble = libc.BoolUint8(b1 > 0) } - rc = libc.BoolInt32(int32(_sqlite3Config.FbUseLongDouble) != 0) + rc = libc.BoolInt32(libc.Int32FromUint8(_sqlite3Config.FbUseLongDouble) != 0) break /* sqlite3_test_control(SQLITE_TESTCTRL_JSON_SELFCHECK, &onOff); ** @@ -170791,19 +164747,19 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr var nByte Tsqlite3_int64 var p, pResult, v2, v4, v5, v6 uintptr _, _, _, _, _, _, _, _ = i, nByte, p, pResult, v2, v4, v5, v6 - nByte = int64(libc.Xstrlen(tls, zDatabase) + libc.Xstrlen(tls, zJournal) + libc.Xstrlen(tls, zWal) + uint32(10)) + nByte = libc.Int64FromUint32(libc.Xstrlen(tls, zDatabase) + libc.Xstrlen(tls, zJournal) + libc.Xstrlen(tls, zWal) + uint32(10)) i = 0 for { if !(i < nParam*int32(2)) { break } - nByte += int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*4))) + uint32(1)) + nByte += libc.Int64FromUint32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*4))) + uint32(1)) goto _1 _1: ; i++ } - v2 = Xsqlite3_malloc64(tls, uint64(nByte)) + v2 = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) p = v2 pResult = v2 if p == uintptr(0) { @@ -170834,7 +164790,6 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr v6 = p p++ *(*int8)(unsafe.Pointer(v6)) = 0 - _ = libc.Int32FromInt32(0) return pResult + uintptr(4) } @@ -170920,7 +164875,7 @@ func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDfl z = Xsqlite3_uri_parameter(tls, zFilename, zParam) bDflt = libc.BoolInt32(bDflt != 0) if z != 0 { - v1 = int32(_sqlite3GetBoolean(tls, z, uint8(bDflt))) + v1 = libc.Int32FromUint8(_sqlite3GetBoolean(tls, z, libc.Uint8FromInt32(bDflt))) } else { v1 = bDflt } @@ -171072,7 +165027,7 @@ func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot ui _, _, _ = iDb, pBt, rc rc = int32(SQLITE_ERROR) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 { iDb = _sqlite3FindDbName(tls, db, zDb) if iDb == 0 || iDb > int32(1) { pBt = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpBt @@ -171099,7 +165054,7 @@ func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot ui _, _, _, _, _ = bUnlock, iDb, pBt, pPager, rc rc = int32(SQLITE_ERROR) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if int32((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 { + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 { iDb = _sqlite3FindDbName(tls, db, zDb) if iDb == 0 || iDb > int32(1) { pBt = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpBt @@ -171187,7 +165142,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+24969, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+24998, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -171198,7 +165153,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { if !(i < *(*int32)(unsafe.Pointer(bp))) { break } - if Xsqlite3_strnicmp(tls, zOptName, *(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*4)), n) == 0 && _sqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*4)) + uintptr(n))))) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, *(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*4)), n) == 0 && _sqlite3IsIdChar(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*4)) + uintptr(n))))) == 0 { return int32(1) } goto _1 @@ -171278,7 +165233,6 @@ var _sqlite3BlockedList = uintptr(0) func _removeFromBlockedList(tls *libc.TLS, db uintptr) { var pp uintptr _ = pp - _ = libc.Int32FromInt32(0) pp = uintptr(unsafe.Pointer(&_sqlite3BlockedList)) for { if !(*(*uintptr)(unsafe.Pointer(pp)) != 0) { @@ -171304,7 +165258,6 @@ func _removeFromBlockedList(tls *libc.TLS, db uintptr) { func _addToBlockedList(tls *libc.TLS, db uintptr) { var pp uintptr _ = pp - _ = libc.Int32FromInt32(0) pp = uintptr(unsafe.Pointer(&_sqlite3BlockedList)) for { if !(*(*uintptr)(unsafe.Pointer(pp)) != 0 && (*Tsqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FxUnlockNotify != (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify) { @@ -171334,7 +165287,6 @@ func _enterMutex(tls *libc.TLS) { // ** Release the STATIC_MAIN mutex. // */ func _leaveMutex(tls *libc.TLS) { - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } @@ -171407,9 +165359,8 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } } _leaveMutex(tls) - _ = libc.Int32FromInt32(0) if rc != 0 { - v2 = __ccgo_ts + 24977 + v2 = __ccgo_ts + 25006 } else { v2 = uintptr(0) } @@ -171481,19 +165432,16 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { } /* Step 2. */ if (*Tsqlite3)(unsafe.Pointer(p)).FpUnlockConnection == db { - _ = libc.Int32FromInt32(0) if (*Tsqlite3)(unsafe.Pointer(p)).FxUnlockNotify != xUnlockNotify && nArg != 0 { (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xUnlockNotify})))(tls, aArg, nArg) nArg = 0 } _sqlite3BeginBenignMalloc(tls) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if !(aDyn != 0) && nArg == int32(libc.Uint32FromInt64(64)/libc.Uint32FromInt64(4)) || aDyn != 0 && nArg == int32(uint32(_sqlite3MallocSize(tls, aDyn))/libc.Uint32FromInt64(4)) { + if !(aDyn != 0) && nArg == libc.Int32FromUint32(libc.Uint32FromInt64(64)/libc.Uint32FromInt64(4)) || aDyn != 0 && nArg == libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint32FromInt64(4)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, uint64(uint32(nArg)*uint32(4)*uint32(2))) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint32FromInt32(nArg)*uint32(4)*uint32(2))) if pNew != 0 { - libc.Xmemcpy(tls, pNew, aArg, uint32(nArg)*uint32(4)) + libc.Xmemcpy(tls, pNew, aArg, libc.Uint32FromInt32(nArg)*uint32(4)) Xsqlite3_free(tls, aDyn) v2 = pNew aArg = v2 @@ -172303,8 +166251,8 @@ var _jsonbType = [17]uintptr{ 8: __ccgo_ts + 8322, 9: __ccgo_ts + 8322, 10: __ccgo_ts + 8322, - 11: __ccgo_ts + 25000, - 12: __ccgo_ts + 25006, + 11: __ccgo_ts + 25029, + 12: __ccgo_ts + 25035, 13: __ccgo_ts + 1662, 14: __ccgo_ts + 1662, 15: __ccgo_ts + 1662, @@ -172754,9 +166702,6 @@ func _jsonCacheDeleteGeneric(tls *libc.TLS, p uintptr) { func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { var db, p uintptr _, _ = db, p - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p = Xsqlite3_get_auxdata(tls, ctx, -int32(429938)) if p == uintptr(0) { db = Xsqlite3_context_db_handle(tls, ctx) @@ -172773,10 +166718,9 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { } if (*TJsonCache)(unsafe.Pointer(p)).FnUsed >= int32(JSON_CACHE_SIZE) { _jsonParseFree(tls, *(*uintptr)(unsafe.Pointer(p + 8))) - libc.Xmemmove(tls, p+8, p+8+1*4, uint32(libc.Int32FromInt32(JSON_CACHE_SIZE)-libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) + libc.Xmemmove(tls, p+8, p+8+1*4, libc.Uint32FromInt32(libc.Int32FromInt32(JSON_CACHE_SIZE)-libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) (*TJsonCache)(unsafe.Pointer(p)).FnUsed = libc.Int32FromInt32(JSON_CACHE_SIZE) - libc.Int32FromInt32(1) } - _ = libc.Int32FromInt32(0) (*TJsonParse)(unsafe.Pointer(pParse)).FeEdit = uint8(0) (*TJsonParse)(unsafe.Pointer(pParse)).FnJPRef++ (*TJsonParse)(unsafe.Pointer(pParse)).FbReadOnly = uint8(1) @@ -172836,7 +166780,7 @@ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { if (*TJsonParse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 + uintptr(i)*4)))).FnJson != nJson { goto _2 } - if libc.Xmemcmp(tls, (*TJsonParse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 + uintptr(i)*4)))).FzJson, zJson, uint32(nJson)) == 0 { + if libc.Xmemcmp(tls, (*TJsonParse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 + uintptr(i)*4)))).FzJson, zJson, libc.Uint32FromInt32(nJson)) == 0 { break } goto _2 @@ -172849,11 +166793,10 @@ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { if i < (*TJsonCache)(unsafe.Pointer(p)).FnUsed-int32(1) { /* Make the matching entry the most recently used entry */ tmp = *(*uintptr)(unsafe.Pointer(p + 8 + uintptr(i)*4)) - libc.Xmemmove(tls, p+8+uintptr(i)*4, p+8+uintptr(i+int32(1))*4, uint32((*TJsonCache)(unsafe.Pointer(p)).FnUsed-i-libc.Int32FromInt32(1))*uint32(4)) + libc.Xmemmove(tls, p+8+uintptr(i)*4, p+8+uintptr(i+int32(1))*4, libc.Uint32FromInt32((*TJsonCache)(unsafe.Pointer(p)).FnUsed-i-libc.Int32FromInt32(1))*uint32(4)) *(*uintptr)(unsafe.Pointer(p + 8 + uintptr((*TJsonCache)(unsafe.Pointer(p)).FnUsed-int32(1))*4)) = tmp i = (*TJsonCache)(unsafe.Pointer(p)).FnUsed - int32(1) } - _ = libc.Int32FromInt32(0) return *(*uintptr)(unsafe.Pointer(p + 8 + uintptr(i)*4)) } else { return uintptr(0) @@ -172960,7 +166903,6 @@ func _jsonStringGrow(tls *libc.TLS, p uintptr, N Tu32) (r int32) { // /* Append N bytes from zIn onto the end of the JsonString string. // */ func _jsonStringExpandAndAppend(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { - _ = libc.Int32FromInt32(0) if _jsonStringGrow(tls, p, N) != 0 { return } @@ -172981,7 +166923,6 @@ func _jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { } func _jsonAppendRawNZ(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { - _ = libc.Int32FromInt32(0) if uint64(N)+(*TJsonString)(unsafe.Pointer(p)).FnUsed >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc { _jsonStringExpandAndAppend(tls, p, zIn, N) } else { @@ -172997,13 +166938,13 @@ func _jsonAppendRawNZ(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { func _jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) { var ap Tva_list _ = ap - if (*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(N) >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, uint32(N)) != 0 { + if (*TJsonString)(unsafe.Pointer(p)).FnUsed+libc.Uint64FromInt32(N) >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, libc.Uint32FromInt32(N)) != 0 { return } ap = va Xsqlite3_vsnprintf(tls, N, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), zFormat, ap) _ = ap - *(*Tu64)(unsafe.Pointer(p + 16)) += uint64(int32(libc.Xstrlen(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed)))) + *(*Tu64)(unsafe.Pointer(p + 16)) += libc.Uint64FromInt32(libc.Int32FromUint32(libc.Xstrlen(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed)))) } // C documentation @@ -173042,8 +166983,7 @@ func _jsonAppendChar(tls *libc.TLS, p uintptr, c int8) { // /* Remove a single character from the end of the string // */ func _jsonStringTrimOneChar(tls *libc.TLS, p uintptr) { - if int32((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { (*TJsonString)(unsafe.Pointer(p)).FnUsed-- } } @@ -173058,7 +166998,7 @@ func _jsonStringTrimOneChar(tls *libc.TLS, p uintptr) { func _jsonStringTerminate(tls *libc.TLS, p uintptr) (r int32) { _jsonAppendChar(tls, p, 0) _jsonStringTrimOneChar(tls, p) - return libc.BoolInt32(int32((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0) + return libc.BoolInt32(libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0) } // C documentation @@ -173088,14 +167028,6 @@ func _jsonAppendSeparator(tls *libc.TLS, p uintptr) { // ** sufficiently to hold the worst-case encoding plus a nul terminator. // */ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if _aSpecial[c] != 0 { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed))) = int8('\\') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = _aSpecial[c] @@ -173105,8 +167037,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = int8('u') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = int8('0') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = int8('0') - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25013 + uintptr(int32(c)>>int32(4)))) - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25013 + uintptr(int32(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25042 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25042 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 16)) += uint64(6) } } @@ -173191,7 +167123,7 @@ func _jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { N -= k } c = *(*Tu8)(unsafe.Pointer(z)) - if int32(c) == int32('"') || int32(c) == int32('\\') { + if libc.Int32FromUint8(c) == int32('"') || libc.Int32FromUint8(c) == int32('\\') { if (*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(N)+uint64(3) > (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { return } @@ -173202,13 +167134,13 @@ func _jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { v6 = p + 16 v5 = *(*Tu64)(unsafe.Pointer(v6)) *(*Tu64)(unsafe.Pointer(v6))++ - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v5))) = int8(c) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v5))) = libc.Int8FromUint8(c) } else { - if int32(c) == int32('\'') { + if libc.Int32FromUint8(c) == int32('\'') { v8 = p + 16 v7 = *(*Tu64)(unsafe.Pointer(v8)) *(*Tu64)(unsafe.Pointer(v8))++ - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v7))) = int8(c) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v7))) = libc.Int8FromUint8(c) } else { if (*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(N)+uint64(7) > (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(7)) != 0 { return @@ -173223,7 +167155,6 @@ func _jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { v9 = *(*Tu64)(unsafe.Pointer(v10)) *(*Tu64)(unsafe.Pointer(v10))++ *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v9))) = int8('"') - _ = libc.Int32FromInt32(0) } // C documentation @@ -173246,11 +167177,11 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonPrintf(tls, int32(100), p, __ccgo_ts+15416, libc.VaList(bp+64, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) - n = uint32(Xsqlite3_value_bytes(tls, pValue)) + n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) _jsonAppendRaw(tls, p, z, n) case int32(SQLITE_TEXT): z1 = Xsqlite3_value_text(tls, pValue) - n1 = uint32(Xsqlite3_value_bytes(tls, pValue)) + n1 = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) if Xsqlite3_value_subtype(tls, pValue) == uint32(JSON_SUBTYPE) { _jsonAppendRaw(tls, p, z1, n1) } else { @@ -173260,11 +167191,11 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { libc.Xmemset(tls, bp, 0, uint32(56)) (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, pValue)) + (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { - if int32((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25030, -int32(1)) + if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25059, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -173287,9 +167218,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { var flags, rc int32 _, _ = flags, rc - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { + if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { flags = int32(Xsqlite3_user_data(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx)) if flags&int32(JSON_BLOB) != 0 { _jsonReturnStringAsBlob(tls, p) @@ -173298,9 +167227,9 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_text64(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, (*TJsonString)(unsafe.Pointer(p)).FzBuf, (*TJsonString)(unsafe.Pointer(p)).FnUsed, uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) } else { if _jsonStringTerminate(tls, p) != 0 { - if pParse != 0 && int32((*TJsonParse)(unsafe.Pointer(pParse)).FbJsonIsRCStr) == 0 && (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc > uint32(0) { + if pParse != 0 && libc.Int32FromUint8((*TJsonParse)(unsafe.Pointer(pParse)).FbJsonIsRCStr) == 0 && (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc > uint32(0) { (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = _sqlite3RCStrRef(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf) - (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = int32((*TJsonString)(unsafe.Pointer(p)).FnUsed) + (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = libc.Int32FromUint64((*TJsonString)(unsafe.Pointer(p)).FnUsed) (*TJsonParse)(unsafe.Pointer(pParse)).FbJsonIsRCStr = uint8(1) rc = _jsonCacheInsert(tls, ctx, pParse) if rc == int32(SQLITE_NOMEM) { @@ -173316,11 +167245,11 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { } } } else { - if int32((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_OOM) != 0 { + if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_OOM) != 0 { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { - if int32((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25059, -int32(1)) + if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25088, -int32(1)) } } } @@ -173338,7 +167267,6 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { // ** delete the JsonParse object itself. // */ func _jsonParseReset(tls *libc.TLS, pParse uintptr) { - _ = libc.Int32FromInt32(0) if (*TJsonParse)(unsafe.Pointer(pParse)).FbJsonIsRCStr != 0 { _sqlite3RCStrUnref(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FzJson) (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = uintptr(0) @@ -173384,7 +167312,7 @@ func _jsonParseFree(tls *libc.TLS, pParse uintptr) { // */ func _jsonHexToInt(tls *libc.TLS, h int32) (r Tu8) { h += int32(9) * (int32(1) & (h >> int32(6))) - return uint8(h & libc.Int32FromInt32(0xf)) + return libc.Uint8FromInt32(h & libc.Int32FromInt32(0xf)) } // C documentation @@ -173395,7 +167323,7 @@ func _jsonHexToInt(tls *libc.TLS, h int32) (r Tu8) { func _jsonHexToInt4(tls *libc.TLS, z uintptr) (r Tu32) { var v Tu32 _ = v - v = uint32(int32(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z)))))<<int32(12) + int32(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 1)))))<<int32(8) + int32(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 2)))))<<int32(4) + int32(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 3)))))) + v = libc.Uint32FromInt32(libc.Int32FromUint8(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z)))))<<int32(12) + libc.Int32FromUint8(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 1)))))<<int32(8) + libc.Int32FromUint8(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 2)))))<<int32(4) + libc.Int32FromUint8(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 3)))))) return v } @@ -173405,7 +167333,7 @@ func _jsonHexToInt4(tls *libc.TLS, z uintptr) (r Tu32) { // ** Return true if z[] begins with 2 (or more) hexadecimal digits // */ func _jsonIs2Hex(tls *libc.TLS, z uintptr) (r int32) { - return libc.BoolInt32(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x08) != 0 && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + 1)))])&int32(0x08) != 0) + return libc.BoolInt32(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&int32(0x08) != 0 && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 1)))])&int32(0x08) != 0) } // C documentation @@ -173464,7 +167392,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { n = 0 z = zIn for int32(1) != 0 { - switch int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n)))) { + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n)))) { case int32(0x09): fallthrough case int32(0x0a): @@ -173478,13 +167406,13 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { case int32(0x20): n++ case int32('/'): - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32('*') && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32('*') && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) != 0 { j = n + int32(3) for { - if !(int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('/') || int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j-int32(1))))) != int32('*')) { + if !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('/') || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j-int32(1))))) != int32('*')) { break } - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == 0 { goto whitespace_done } goto _1 @@ -173495,10 +167423,10 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { n = j + int32(1) break } else { - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32('/') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32('/') { j1 = n + int32(2) for { - v3 = int8(*(*Tu8)(unsafe.Pointer(z + uintptr(j1)))) + v3 = libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j1)))) c = v3 if !(int32(v3) != 0) { break @@ -173506,7 +167434,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { if int32(c) == int32('\n') || int32(c) == int32('\r') { break } - if int32(0xe2) == int32(uint8(c)) && int32(0x80) == int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(1))))) && (int32(0xa8) == int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(2))))) || int32(0xa9) == int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(2)))))) { + if int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(2)))))) { j1 += int32(2) break } @@ -173524,42 +167452,42 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { } goto whitespace_done case int32(0xc2): - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0xa0) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0xa0) { n += int32(2) break } goto whitespace_done case int32(0xe1): - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0x9a) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) == int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0x9a) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) == int32(0x80) { n += int32(3) break } goto whitespace_done case int32(0xe2): - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0x80) { c1 = *(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2)))) - if int32(c1) < int32(0x80) { + if libc.Int32FromUint8(c1) < int32(0x80) { goto whitespace_done } - if int32(c1) <= int32(0x8a) || int32(c1) == int32(0xa8) || int32(c1) == int32(0xa9) || int32(c1) == int32(0xaf) { + if libc.Int32FromUint8(c1) <= int32(0x8a) || libc.Int32FromUint8(c1) == int32(0xa8) || libc.Int32FromUint8(c1) == int32(0xa9) || libc.Int32FromUint8(c1) == int32(0xaf) { n += int32(3) break } } else { - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0x81) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) == int32(0x9f) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0x81) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) == int32(0x9f) { n += int32(3) break } } goto whitespace_done case int32(0xe3): - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0x80) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) == int32(0x80) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0x80) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) == int32(0x80) { n += int32(3) break } goto whitespace_done case int32(0xef): - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0xbb) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) == int32(0xbf) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0xbb) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2))))) == int32(0xbf) { n += int32(3) break } @@ -173604,8 +167532,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25074, - FzRepl: __ccgo_ts + 25078, + FzMatch: __ccgo_ts + 25103, + FzRepl: __ccgo_ts + 25107, }, 1: { Fc1: int8('i'), @@ -173613,8 +167541,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25086, - FzRepl: __ccgo_ts + 25078, + FzMatch: __ccgo_ts + 25115, + FzRepl: __ccgo_ts + 25107, }, 2: { Fc1: int8('n'), @@ -173629,7 +167557,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25095, + FzMatch: __ccgo_ts + 25124, FzRepl: __ccgo_ts + 1648, }, 4: { @@ -173637,7 +167565,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25100, + FzMatch: __ccgo_ts + 25129, FzRepl: __ccgo_ts + 1648, }, } @@ -173653,7 +167581,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25105, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25134, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -173673,7 +167601,6 @@ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr var t Tu32 _, _ = aNew, t - _ = libc.Int32FromInt32(0) if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { t = uint32(100) } else { @@ -173706,7 +167633,6 @@ func _jsonBlobMakeEditable(tls *libc.TLS, pParse uintptr, nExtra Tu32) (r int32) var aOld uintptr var nSize Tu32 _, _ = aOld, nSize - _ = libc.Int32FromInt32(0) if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return 0 } @@ -173719,7 +167645,6 @@ func _jsonBlobMakeEditable(tls *libc.TLS, pParse uintptr, nExtra Tu32) (r int32) if _jsonBlobExpand(tls, pParse, nSize) != 0 { return 0 } - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, aOld, (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) return int32(1) } @@ -173733,8 +167658,7 @@ func _jsonBlobExpandAndAppendOneByte(tls *libc.TLS, pParse uintptr, c Tu8) { var v2 uintptr _, _ = v1, v2 _jsonBlobExpand(tls, pParse, (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob+uint32(1)) - if int32((*TJsonParse)(unsafe.Pointer(pParse)).Foom) == 0 { - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8((*TJsonParse)(unsafe.Pointer(pParse)).Foom) == 0 { v2 = pParse + 4 v1 = *(*Tu32)(unsafe.Pointer(v2)) *(*Tu32)(unsafe.Pointer(v2))++ @@ -173785,24 +167709,23 @@ func _jsonBlobAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPayload Tu3 _jsonBlobExpandAndAppendNode(tls, pParse, eType, szPayload, aPayload) return } - _ = libc.Int32FromInt32(0) a = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) if szPayload <= uint32(11) { *(*Tu8)(unsafe.Pointer(a)) = uint8(uint32(eType) | szPayload<<libc.Int32FromInt32(4)) *(*Tu32)(unsafe.Pointer(pParse + 4)) += uint32(1) } else { if szPayload <= uint32(0xff) { - *(*Tu8)(unsafe.Pointer(a)) = uint8(int32(eType) | int32(0xc0)) + *(*Tu8)(unsafe.Pointer(a)) = libc.Uint8FromInt32(libc.Int32FromUint8(eType) | int32(0xc0)) *(*Tu8)(unsafe.Pointer(a + 1)) = uint8(szPayload & uint32(0xff)) *(*Tu32)(unsafe.Pointer(pParse + 4)) += uint32(2) } else { if szPayload <= uint32(0xffff) { - *(*Tu8)(unsafe.Pointer(a)) = uint8(int32(eType) | int32(0xd0)) + *(*Tu8)(unsafe.Pointer(a)) = libc.Uint8FromInt32(libc.Int32FromUint8(eType) | int32(0xd0)) *(*Tu8)(unsafe.Pointer(a + 1)) = uint8(szPayload >> libc.Int32FromInt32(8) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 2)) = uint8(szPayload & uint32(0xff)) *(*Tu32)(unsafe.Pointer(pParse + 4)) += uint32(3) } else { - *(*Tu8)(unsafe.Pointer(a)) = uint8(int32(eType) | int32(0xe0)) + *(*Tu8)(unsafe.Pointer(a)) = libc.Uint8FromInt32(libc.Int32FromUint8(eType) | int32(0xe0)) *(*Tu8)(unsafe.Pointer(a + 1)) = uint8(szPayload >> libc.Int32FromInt32(24) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 2)) = uint8(szPayload >> libc.Int32FromInt32(16) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 3)) = uint8(szPayload >> libc.Int32FromInt32(8) & uint32(0xff)) @@ -173831,14 +167754,14 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload return 0 } a = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i) - szType = uint8(int32(*(*Tu8)(unsafe.Pointer(a))) >> int32(4)) - if int32(szType) <= int32(11) { + szType = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a))) >> int32(4)) + if libc.Int32FromUint8(szType) <= int32(11) { nExtra = uint8(0) } else { - if int32(szType) == int32(12) { + if libc.Int32FromUint8(szType) == int32(12) { nExtra = uint8(1) } else { - if int32(szType) == int32(13) { + if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { nExtra = uint8(4) @@ -173858,9 +167781,9 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload } } } - delta = int32(nNeeded) - int32(nExtra) + delta = libc.Int32FromUint8(nNeeded) - libc.Int32FromUint8(nExtra) if delta != 0 { - newSize = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob + uint32(delta) + newSize = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob + libc.Uint32FromInt32(delta) if delta > 0 { if newSize > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc && _jsonBlobExpand(tls, pParse, newSize) != 0 { return 0 /* OOM error. Error state recorded in pParse->oom. */ @@ -173868,23 +167791,23 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload a = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i) libc.Xmemmove(tls, a+uintptr(int32(1)+delta), a+1, (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-(i+uint32(1))) } else { - libc.Xmemmove(tls, a+1, a+uintptr(int32(1)-delta), (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-(i+uint32(1)-uint32(delta))) + libc.Xmemmove(tls, a+1, a+uintptr(int32(1)-delta), (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-(i+uint32(1)-libc.Uint32FromInt32(delta))) } (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = newSize } - if int32(nNeeded) == 0 { - *(*Tu8)(unsafe.Pointer(a)) = uint8(uint32(int32(*(*Tu8)(unsafe.Pointer(a)))&libc.Int32FromInt32(0x0f)) | szPayload<<libc.Int32FromInt32(4)) + if libc.Int32FromUint8(nNeeded) == 0 { + *(*Tu8)(unsafe.Pointer(a)) = uint8(libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a)))&libc.Int32FromInt32(0x0f)) | szPayload<<libc.Int32FromInt32(4)) } else { - if int32(nNeeded) == int32(1) { - *(*Tu8)(unsafe.Pointer(a)) = uint8(int32(*(*Tu8)(unsafe.Pointer(a)))&int32(0x0f) | int32(0xc0)) + if libc.Int32FromUint8(nNeeded) == int32(1) { + *(*Tu8)(unsafe.Pointer(a)) = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a)))&int32(0x0f) | int32(0xc0)) *(*Tu8)(unsafe.Pointer(a + 1)) = uint8(szPayload & uint32(0xff)) } else { - if int32(nNeeded) == int32(2) { - *(*Tu8)(unsafe.Pointer(a)) = uint8(int32(*(*Tu8)(unsafe.Pointer(a)))&int32(0x0f) | int32(0xd0)) + if libc.Int32FromUint8(nNeeded) == int32(2) { + *(*Tu8)(unsafe.Pointer(a)) = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a)))&int32(0x0f) | int32(0xd0)) *(*Tu8)(unsafe.Pointer(a + 1)) = uint8(szPayload >> libc.Int32FromInt32(8) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 2)) = uint8(szPayload & uint32(0xff)) } else { - *(*Tu8)(unsafe.Pointer(a)) = uint8(int32(*(*Tu8)(unsafe.Pointer(a)))&int32(0x0f) | int32(0xe0)) + *(*Tu8)(unsafe.Pointer(a)) = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a)))&int32(0x0f) | int32(0xe0)) *(*Tu8)(unsafe.Pointer(a + 1)) = uint8(szPayload >> libc.Int32FromInt32(24) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 2)) = uint8(szPayload >> libc.Int32FromInt32(16) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 3)) = uint8(szPayload >> libc.Int32FromInt32(8) & uint32(0xff)) @@ -173947,8 +167870,8 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept return i + uint32(1) } /* Checked by caller */ z = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob - x = uint8(int32(*(*Tu8)(unsafe.Pointer(z + uintptr(i)))) & int32(0x0f)) - switch int32(x) { + x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(i)))) & int32(0x0f)) + switch libc.Int32FromUint8(x) { case JSONB_NULL: fallthrough case int32(JSONB_TRUE): @@ -173965,7 +167888,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept return i + uint32(1) } j = i + n - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('-') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('-') { j++ if *(*Tu32)(unsafe.Pointer(bp)) < uint32(2) { return i + uint32(1) @@ -173973,7 +167896,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept } k = i + n + *(*Tu32)(unsafe.Pointer(bp)) for j < k { - if int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))])&int32(0x04) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))])&int32(0x04) != 0 { j++ } else { return j + uint32(1) @@ -173985,22 +167908,22 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept return i + uint32(1) } j = i + n - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('-') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('-') { if *(*Tu32)(unsafe.Pointer(bp)) < uint32(4) { return i + uint32(1) } j++ } - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('0') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('0') { return i + uint32(1) } - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('x') && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('X') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('x') && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('X') { return j + uint32(2) } j += uint32(2) k = i + n + *(*Tu32)(unsafe.Pointer(bp)) for j < k { - if int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))])&int32(0x08) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))])&int32(0x08) != 0 { j++ } else { return j + uint32(1) @@ -174016,27 +167939,27 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept } j = i + n k = j + *(*Tu32)(unsafe.Pointer(bp)) - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('-') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('-') { j++ if *(*Tu32)(unsafe.Pointer(bp)) < uint32(3) { return i + uint32(1) } } - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('.') { - if int32(x) == int32(JSONB_FLOAT) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('.') { + if libc.Int32FromUint8(x) == int32(JSONB_FLOAT) { return j + uint32(1) } - if !(int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0) { return j + uint32(1) } j += uint32(2) seen = uint8(1) } else { - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('0') && int32(x) == int32(JSONB_FLOAT) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('0') && libc.Int32FromUint8(x) == int32(JSONB_FLOAT) { if j+uint32(3) > k { return j + uint32(1) } - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('.') && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('e') && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('E') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('.') && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('e') && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) != int32('E') { return j + uint32(1) } j++ @@ -174046,27 +167969,27 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if !(j < k) { break } - if int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))])&int32(0x04) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))])&int32(0x04) != 0 { goto _2 } - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('.') { - if int32(seen) > 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('.') { + if libc.Int32FromUint8(seen) > 0 { return j + uint32(1) } - if int32(x) == int32(JSONB_FLOAT) && (j == k-uint32(1) || !(int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0)) { + if libc.Int32FromUint8(x) == int32(JSONB_FLOAT) && (j == k-uint32(1) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0)) { return j + uint32(1) } seen = uint8(1) goto _2 } - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('e') || int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('E') { - if int32(seen) == int32(2) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('e') || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('E') { + if libc.Int32FromUint8(seen) == int32(2) { return j + uint32(1) } if j == k-uint32(1) { return j + uint32(1) } - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('+') || int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('-') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('+') || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('-') { j++ if j == k-uint32(1) { return j + uint32(1) @@ -174081,7 +168004,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept ; j++ } - if int32(seen) == 0 { + if libc.Int32FromUint8(seen) == 0 { return i + uint32(1) } return uint32(0) @@ -174089,7 +168012,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept j = i + n k = j + *(*Tu32)(unsafe.Pointer(bp)) for j < k { - if !(_jsonIsOk[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))] != 0) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\'') { + if !(_jsonIsOk[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))] != 0) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\'') { return j + uint32(1) } j++ @@ -174101,25 +168024,25 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept j = i + n k = j + *(*Tu32)(unsafe.Pointer(bp)) for j < k { - if !(_jsonIsOk[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))] != 0) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\'') { - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('"') { - if int32(x) == int32(JSONB_TEXTJ) { + if !(_jsonIsOk[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))] != 0) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\'') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('"') { + if libc.Int32FromUint8(x) == int32(JSONB_TEXTJ) { return j + uint32(1) } } else { - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) <= int32(0x1f) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) <= int32(0x1f) { /* Control characters in JSON5 string literals are ok */ - if int32(x) == int32(JSONB_TEXTJ) { + if libc.Int32FromUint8(x) == int32(JSONB_TEXTJ) { return j + uint32(1) } } else { - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25148, int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25177, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { if j+uint32(5) >= k { return j + uint32(1) } @@ -174128,7 +168051,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept } j++ } else { - if int32(x) != int32(JSONB_TEXT5) { + if libc.Int32FromUint8(x) != int32(JSONB_TEXT5) { return j + uint32(1) } else { *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(0) @@ -174167,7 +168090,6 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept } j += n + *(*Tu32)(unsafe.Pointer(bp)) } - _ = libc.Int32FromInt32(0) return uint32(0) case int32(JSONB_OBJECT): cnt = uint32(0) @@ -174183,8 +168105,8 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept return j + uint32(1) } if cnt&uint32(1) == uint32(0) { - x = uint8(int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) & int32(0x0f)) - if int32(x) < int32(JSONB_TEXT) || int32(x) > int32(JSONB_TEXTRAW) { + x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) & int32(0x0f)) + if libc.Int32FromUint8(x) < int32(JSONB_TEXT) || libc.Int32FromUint8(x) > int32(JSONB_TEXTRAW) { return j + uint32(1) } } @@ -174195,7 +168117,6 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept cnt++ j += n + *(*Tu32)(unsafe.Pointer(bp)) } - _ = libc.Int32FromInt32(0) if cnt&uint32(1) != uint32(0) { return j + uint32(1) } @@ -174238,7 +168159,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { goto json_parse_restart json_parse_restart: ; - switch int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))) { + switch libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))) { case int32('{'): goto _1 case int32('['): @@ -174321,11 +168242,11 @@ _1: ; /* Parse object */ iThis = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_OBJECT), uint32((*TJsonParse)(unsafe.Pointer(pParse)).FnJson)-i, uintptr(0)) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_OBJECT), libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).FnJson)-i, uintptr(0)) v41 = pParse + 32 *(*Tu16)(unsafe.Pointer(v41))++ v40 = *(*Tu16)(unsafe.Pointer(v41)) - if int32(v40) > int32(JSON_MAX_DEPTH) { + if libc.Int32FromUint16(v40) > int32(JSON_MAX_DEPTH) { (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = i return -int32(1) } @@ -174342,15 +168263,14 @@ _1: } break } - j += uint32(_json5Whitespace(tls, z+uintptr(j))) + j += libc.Uint32FromInt32(_json5Whitespace(tls, z+uintptr(j))) *(*int32)(unsafe.Pointer(bp)) = int32(JSONB_TEXT) - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))])&int32(0x42) != 0 || int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32('\\') && _jsonIs4HexB(tls, z+uintptr(j+uint32(1)), bp) != 0 { - k = int32(j + uint32(1)) - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(k))))])&int32(0x46) != 0 && _json5Whitespace(tls, z+uintptr(k)) == 0 || int32(*(*int8)(unsafe.Pointer(z + uintptr(k)))) == int32('\\') && _jsonIs4HexB(tls, z+uintptr(k+int32(1)), bp) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j))))])&int32(0x42) != 0 || int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32('\\') && _jsonIs4HexB(tls, z+uintptr(j+uint32(1)), bp) != 0 { + k = libc.Int32FromUint32(j + uint32(1)) + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(k))))])&int32(0x46) != 0 && _json5Whitespace(tls, z+uintptr(k)) == 0 || int32(*(*int8)(unsafe.Pointer(z + uintptr(k)))) == int32('\\') && _jsonIs4HexB(tls, z+uintptr(k+int32(1)), bp) != 0 { k++ } - _ = libc.Int32FromInt32(0) - _jsonBlobAppendNode(tls, pParse, uint8(*(*int32)(unsafe.Pointer(bp))), uint32(k)-j, z+uintptr(j)) + _jsonBlobAppendNode(tls, pParse, libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp))), libc.Uint32FromInt32(k)-j, z+uintptr(j)) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) x = k } else { @@ -174363,18 +168283,18 @@ _1: if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return -int32(1) } - t = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(iBlob)))) & int32(0x0f)) - if int32(t) < int32(JSONB_TEXT) || int32(t) > int32(JSONB_TEXTRAW) { + t = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(iBlob)))) & int32(0x0f)) + if libc.Int32FromUint8(t) < int32(JSONB_TEXT) || libc.Int32FromUint8(t) > int32(JSONB_TEXTRAW) { (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = j return -int32(1) } - j = uint32(x) + j = libc.Uint32FromInt32(x) if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(':') { j++ } else { - if _jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { + if _jsonIsSpace[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { /* strspn() is not helpful here */ - for cond := true; cond; cond = _jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { + for cond := true; cond; cond = _jsonIsSpace[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { j++ } if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(':') { @@ -174401,14 +168321,14 @@ _1: } return -int32(1) } - j = uint32(x) + j = libc.Uint32FromInt32(x) if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(',') { goto _42 } else { if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32('}') { break } else { - if _jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { + if _jsonIsSpace[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { j += uint32(1) + libc.Xstrspn(tls, z+uintptr(j+uint32(1)), uintptr(unsafe.Pointer(&_jsonSpaces))) if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(',') { goto _42 @@ -174438,13 +168358,12 @@ _1: } _jsonBlobChangePayloadSize(tls, pParse, iThis, (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-iStart) (*TJsonParse)(unsafe.Pointer(pParse)).FiDepth-- - return int32(j + uint32(1)) + return libc.Int32FromUint32(j + uint32(1)) _2: ; /* Parse array */ iThis = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob - _ = libc.Int32FromInt32(0) - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_ARRAY), uint32((*TJsonParse)(unsafe.Pointer(pParse)).FnJson)-i, uintptr(0)) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_ARRAY), libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).FnJson)-i, uintptr(0)) iStart = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return -int32(1) @@ -174452,7 +168371,7 @@ _2: v44 = pParse + 32 *(*Tu16)(unsafe.Pointer(v44))++ v43 = *(*Tu16)(unsafe.Pointer(v44)) - if int32(v43) > int32(JSON_MAX_DEPTH) { + if libc.Int32FromUint16(v43) > int32(JSON_MAX_DEPTH) { (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = i return -int32(1) } @@ -174472,14 +168391,14 @@ _2: } return -int32(1) } - j = uint32(x) + j = libc.Uint32FromInt32(x) if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(',') { goto _45 } else { if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(']') { break } else { - if _jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { + if _jsonIsSpace[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { j += uint32(1) + libc.Xstrspn(tls, z+uintptr(j+uint32(1)), uintptr(unsafe.Pointer(&_jsonSpaces))) if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(',') { goto _45 @@ -174509,7 +168428,7 @@ _2: } _jsonBlobChangePayloadSize(tls, pParse, iThis, (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-iStart) (*TJsonParse)(unsafe.Pointer(pParse)).FiDepth-- - return int32(j + uint32(1)) + return libc.Int32FromUint32(j + uint32(1)) _4: ; (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) @@ -174525,11 +168444,11 @@ parse_string: cDelim = *(*int8)(unsafe.Pointer(z + uintptr(i))) j = i + uint32(1) for int32(1) != 0 { - if _jsonIsOk[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { - if !(_jsonIsOk[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))] != 0) { + if _jsonIsOk[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 { + if !(_jsonIsOk[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))] != 0) { j += uint32(1) } else { - if !(_jsonIsOk[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))] != 0) { + if !(_jsonIsOk[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))] != 0) { j += uint32(2) } else { j += uint32(3) @@ -174546,11 +168465,11 @@ parse_string: v46 = j c = *(*int8)(unsafe.Pointer(z + uintptr(v46))) if int32(c) == int32('"') || int32(c) == int32('\\') || int32(c) == int32('/') || int32(c) == int32('b') || int32(c) == int32('f') || int32(c) == int32('n') || int32(c) == int32('r') || int32(c) == int32('t') || int32(c) == int32('u') && _jsonIs4Hex(tls, z+uintptr(j+uint32(1))) != 0 { - if int32(opcode) == int32(JSONB_TEXT) { + if libc.Int32FromUint8(opcode) == int32(JSONB_TEXT) { opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == int32(uint8(c)) && int32(0x80) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -174586,20 +168505,20 @@ parse_string: j++ } _jsonBlobAppendNode(tls, pParse, opcode, j-uint32(1)-i, z+uintptr(i+uint32(1))) - return int32(j + uint32(1)) + return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8011, uint32(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8011, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) - return int32(i + uint32(4)) + return libc.Int32FromUint32(i + uint32(4)) } (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = i return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8016, uint32(5)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8016, uint32(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) - return int32(i + uint32(5)) + return libc.Int32FromUint32(i + uint32(5)) } (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = i return -int32(1) @@ -174610,7 +168529,7 @@ _19: goto parse_number _7: ; - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1)))))])&int32(0x04) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1)))))])&int32(0x04) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) t = uint8(0x03) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ seenE = uint8(0) @@ -174646,19 +168565,15 @@ _8: parse_number: ; seenE = uint8(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) c = *(*int8)(unsafe.Pointer(z + uintptr(i))) if int32(c) <= int32('0') { if int32(c) == int32('0') { - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('x') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('X')) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2)))))])&int32(0x08) != 0 { - _ = libc.Int32FromInt32(0) + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('x') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('X')) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2)))))])&int32(0x08) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) t = uint8(0x01) j = i + uint32(3) for { - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))])&int32(0x08) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j))))])&int32(0x08) != 0) { break } goto _47 @@ -174668,29 +168583,29 @@ parse_number: } goto parse_number_finish } else { - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1)))))])&int32(0x04) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1)))))])&int32(0x04) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = i + uint32(1) return -int32(1) } } } else { - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) { /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25074, int32(3)) == 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25103, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25157) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25186) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25164) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25193) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25170, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25199, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) } - return int32(i + uint32(v48)) + return libc.Int32FromUint32(i + libc.Uint32FromInt32(v48)) } if int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('.') { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) @@ -174701,16 +168616,16 @@ parse_number: return -int32(1) } if int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('0') { - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2)))))])&int32(0x04) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2)))))])&int32(0x04) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = i + uint32(1) return -int32(1) } else { - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2))))) == int32('x') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2))))) == int32('X')) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(3)))))])&int32(0x08) != 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2))))) == int32('x') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2))))) == int32('X')) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(3)))))])&int32(0x08) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) t = Tu8(int32(t) | libc.Int32FromInt32(0x01)) j = i + uint32(4) for { - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))])&int32(0x08) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j))))])&int32(0x08) != 0) { break } goto _49 @@ -174730,11 +168645,11 @@ parse_number_2: j = i + uint32(1) for { c = *(*int8)(unsafe.Pointer(z + uintptr(j))) - if int32(_sqlite3CtypeMap[uint8(c)])&int32(0x04) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(c)])&int32(0x04) != 0 { goto _50 } if int32(c) == int32('.') { - if int32(t)&int32(0x02) != 0 { + if libc.Int32FromUint8(t)&int32(0x02) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = j return -int32(1) } @@ -174743,7 +168658,7 @@ parse_number_2: } if int32(c) == int32('e') || int32(c) == int32('E') { if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(1))))) < int32('0') { - if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(1))))) == int32('.') && j-uint32(2) >= i && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(2)))))])&int32(0x04) != 0 { + if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(1))))) == int32('.') && j-uint32(2) >= i && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(2)))))])&int32(0x04) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) t = Tu8(int32(t) | libc.Int32FromInt32(0x01)) } else { @@ -174775,7 +168690,7 @@ parse_number_2: j++ } if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(1))))) < int32('0') { - if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(1))))) == int32('.') && j-uint32(2) >= i && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(2)))))])&int32(0x04) != 0 { + if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(1))))) == int32('.') && j-uint32(2) >= i && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(2)))))])&int32(0x04) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) t = Tu8(int32(t) | libc.Int32FromInt32(0x01)) } else { @@ -174786,14 +168701,11 @@ parse_number_2: goto parse_number_finish parse_number_finish: ; - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('+') { i++ } - _jsonBlobAppendNode(tls, pParse, uint8(int32(JSONB_INT)+int32(t)), j-i, z+uintptr(i)) - return int32(j) + _jsonBlobAppendNode(tls, pParse, libc.Uint8FromInt32(int32(JSONB_INT)+libc.Int32FromUint8(t)), j-i, z+uintptr(i)) + return libc.Int32FromUint32(j) _20: ; (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = i @@ -174839,7 +168751,7 @@ _30: ; _29: ; - j = uint32(_json5Whitespace(tls, z+uintptr(i))) + j = libc.Uint32FromInt32(_json5Whitespace(tls, z+uintptr(i))) if j > uint32(0) { i += j (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) @@ -174849,9 +168761,9 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1648, uint32(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1648, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) - return int32(i + uint32(4)) + return libc.Int32FromUint32(i + uint32(4)) } _38: ; @@ -174868,16 +168780,16 @@ _38: if Xsqlite3_strnicmp(tls, z+uintptr(i), _aNanInfName[k1].FzMatch, nn) != 0 { goto _51 } - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(nn)))))])&int32(0x06) != 0 { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+libc.Uint32FromInt32(nn)))))])&int32(0x06) != 0 { goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25164) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25193) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) - return int32(i + uint32(nn)) + return libc.Int32FromUint32(i + libc.Uint32FromInt32(nn)) goto _51 _51: ; @@ -174910,14 +168822,14 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i = -int32(1) } if i > 0 { - for _jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(zJson + uintptr(i))))] != 0 { + for _jsonIsSpace[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zJson + uintptr(i))))] != 0 { i++ } if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25088, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -174930,7 +168842,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25088, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -174957,16 +168869,14 @@ func _jsonReturnStringAsBlob(tls *libc.TLS, pStr uintptr) { return } (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = (*TJsonString)(unsafe.Pointer(pStr)).FzBuf - (*(*TJsonParse)(unsafe.Pointer(bp))).FnJson = int32((*TJsonString)(unsafe.Pointer(pStr)).FnUsed) + (*(*TJsonParse)(unsafe.Pointer(bp))).FnJson = libc.Int32FromUint64((*TJsonString)(unsafe.Pointer(pStr)).FnUsed) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, (*TJsonString)(unsafe.Pointer(pStr)).FpCtx) _jsonTranslateTextToBlob(tls, bp, uint32(0)) if (*(*TJsonParse)(unsafe.Pointer(bp))).Foom != 0 { _sqlite3DbFree(tls, (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb, (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob) Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(pStr)).FpCtx) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - Xsqlite3_result_blob(tls, (*TJsonString)(unsafe.Pointer(pStr)).FpCtx, (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob, int32((*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob), __ccgo_fp(_sqlite3OomClear)) + Xsqlite3_result_blob(tls, (*TJsonString)(unsafe.Pointer(pStr)).FpCtx, (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob, libc.Int32FromUint32((*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob), __ccgo_fp(_sqlite3OomClear)) } } @@ -174985,12 +168895,12 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) - if int32(x) <= int32(11) { + x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) + if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) n = uint32(1) } else { - if int32(x) == int32(12) { + if libc.Int32FromUint8(x) == int32(12) { if i+uint32(1) >= (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) @@ -174998,33 +168908,33 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu sz = uint32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(1))))) n = uint32(2) } else { - if int32(x) == int32(13) { + if libc.Int32FromUint8(x) == int32(13) { if i+uint32(2) >= (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = uint32(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(1)))))<<int32(8) + int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(2)))))) + sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(1)))))<<int32(8) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(2)))))) n = uint32(3) } else { - if int32(x) == int32(14) { + if libc.Int32FromUint8(x) == int32(14) { if i+uint32(4) >= (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = uint32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(1)))))<<libc.Int32FromInt32(24) + uint32(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(2)))))<<libc.Int32FromInt32(16)) + uint32(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(3)))))<<libc.Int32FromInt32(8)) + uint32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(4))))) + sz = uint32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(1)))))<<libc.Int32FromInt32(24) + libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(2)))))<<libc.Int32FromInt32(16)) + libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(3)))))<<libc.Int32FromInt32(8)) + uint32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(4))))) n = uint32(5) } else { - if i+uint32(8) >= (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob || int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(1))))) != 0 || int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(2))))) != 0 || int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(3))))) != 0 || int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(4))))) != 0 { + if i+uint32(8) >= (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(1))))) != 0 || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(2))))) != 0 || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(3))))) != 0 || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(4))))) != 0 { *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = uint32(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))<<int32(24) + int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(6)))))<<int32(16) + int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(7)))))<<int32(8) + int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(8)))))) + sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))<<int32(24) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(6)))))<<int32(16) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(7)))))<<int32(8) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(8)))))) n = uint32(9) } } } } - if int64(i)+int64(sz)+int64(n) > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && int64(i)+int64(sz)+int64(n) > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-uint32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { + if libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { sz = uint32(0) n = uint32(0) } @@ -175062,7 +168972,7 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(JSTRING_MALFORMED)) return (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob + uint32(1) } - switch int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { case JSONB_NULL: goto _2 case int32(JSONB_TRUE): @@ -175135,7 +169045,7 @@ _7: if !(k < *(*Tu32)(unsafe.Pointer(bp))) { break } - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(k))))])&libc.Int32FromInt32(0x08) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn + uintptr(k))))])&libc.Int32FromInt32(0x08) != 0) { p18 = pOut + 25 *(*Tu8)(unsafe.Pointer(p18)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p18))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break @@ -175152,7 +169062,7 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25078 + v19 = __ccgo_ts + 25107 } else { v19 = __ccgo_ts + 11878 } @@ -175177,7 +169087,7 @@ _8: break } _jsonAppendChar(tls, pOut, *(*int8)(unsafe.Pointer(zIn1 + uintptr(k1)))) - if int32(*(*int8)(unsafe.Pointer(zIn1 + uintptr(k1)))) == int32('.') && (k1+uint32(1) == *(*Tu32)(unsafe.Pointer(bp)) || !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn1 + uintptr(k1+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0)) { + if int32(*(*int8)(unsafe.Pointer(zIn1 + uintptr(k1)))) == int32('.') && (k1+uint32(1) == *(*Tu32)(unsafe.Pointer(bp)) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn1 + uintptr(k1+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0)) { _jsonAppendChar(tls, pOut, int8('0')) } goto _20 @@ -175202,7 +169112,7 @@ _11: for sz2 > uint32(0) { k2 = uint32(0) for { - if !(k2 < sz2 && (_jsonIsOk[uint8(*(*int8)(unsafe.Pointer(zIn2 + uintptr(k2))))] != 0 || int32(*(*int8)(unsafe.Pointer(zIn2 + uintptr(k2)))) == int32('\''))) { + if !(k2 < sz2 && (_jsonIsOk[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn2 + uintptr(k2))))] != 0 || int32(*(*int8)(unsafe.Pointer(zIn2 + uintptr(k2)))) == int32('\''))) { break } goto _21 @@ -175219,7 +169129,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25176, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25205, uint32(2)) zIn2++ sz2-- continue @@ -175228,23 +169138,21 @@ _11: if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(7) > (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc && _jsonStringGrow(tls, pOut, uint32(7)) != 0 { break } - _jsonAppendControlChar(tls, pOut, uint8(*(*int8)(unsafe.Pointer(zIn2)))) + _jsonAppendControlChar(tls, pOut, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn2)))) zIn2++ sz2-- continue } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if sz2 < uint32(2) { p22 = pOut + 25 *(*Tu8)(unsafe.Pointer(p22)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p22))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - switch int32(uint8(*(*int8)(unsafe.Pointer(zIn2 + 1)))) { + switch libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn2 + 1)))) { case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25179, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25208, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 25 @@ -175252,12 +169160,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25186, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25215, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25191, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25220, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -175268,7 +169176,7 @@ _11: /* '\' followed by either U+2028 or U+2029 is ignored as ** whitespace. Not that in UTF8, U+2028 is 0xe2 0x80 0x29. ** U+2029 is the same except for the last byte */ - if sz2 < uint32(4) || int32(0x80) != int32(uint8(*(*int8)(unsafe.Pointer(zIn2 + 2)))) || int32(0xa8) != int32(uint8(*(*int8)(unsafe.Pointer(zIn2 + 3)))) && int32(0xa9) != int32(uint8(*(*int8)(unsafe.Pointer(zIn2 + 3)))) { + if sz2 < uint32(4) || int32(0x80) != libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn2 + 2)))) || int32(0xa8) != libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn2 + 3)))) && int32(0xa9) != libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn2 + 3)))) { p24 = pOut + 25 *(*Tu8)(unsafe.Pointer(p24)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p24))) | libc.Int32FromInt32(JSTRING_MALFORMED)) sz2 = uint32(2) @@ -175280,7 +169188,6 @@ _11: _jsonAppendRawNZ(tls, pOut, zIn2, uint32(2)) break } - _ = libc.Int32FromInt32(0) zIn2 += uintptr(2) sz2 -= uint32(2) } @@ -175295,7 +169202,7 @@ _13: _jsonAppendChar(tls, pOut, int8('[')) j = i + n iEnd = j + *(*Tu32)(unsafe.Pointer(bp)) - for j < iEnd && int32((*TJsonString)(unsafe.Pointer(pOut)).FeErr) == 0 { + for j < iEnd && libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(pOut)).FeErr) == 0 { j = _jsonTranslateBlobToText(tls, pParse, j, pOut) _jsonAppendChar(tls, pOut, int8(',')) } @@ -175314,7 +169221,7 @@ _14: _jsonAppendChar(tls, pOut, int8('{')) j = i + n iEnd = j + *(*Tu32)(unsafe.Pointer(bp)) - for j < iEnd && int32((*TJsonString)(unsafe.Pointer(pOut)).FeErr) == 0 { + for j < iEnd && libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(pOut)).FeErr) == 0 { j = _jsonTranslateBlobToText(tls, pParse, j, pOut) v27 = x x++ @@ -175424,7 +169331,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(JSTRING_MALFORMED)) return (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob + uint32(1) } - switch int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { case int32(JSONB_ARRAY): j = i + n iEnd = j + *(*Tu32)(unsafe.Pointer(bp)) @@ -175432,13 +169339,13 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j < iEnd { _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent++ - for int32((*TJsonString)(unsafe.Pointer(pOut)).FeErr) == 0 { + for libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(pOut)).FeErr) == 0 { _jsonPrettyIndent(tls, pPretty) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25198, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25227, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -175453,7 +169360,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j < iEnd { _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent++ - for int32((*TJsonString)(unsafe.Pointer(pOut)).FeErr) == 0 { + for libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(pOut)).FeErr) == 0 { _jsonPrettyIndent(tls, pPretty) j = _jsonTranslateBlobToText(tls, pParse, j, pOut) if j > iEnd { @@ -175461,12 +169368,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25201, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25230, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25198, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25227, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -175506,23 +169413,23 @@ func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { if nBlob < int32(1) { return 0 } - if aBlob == uintptr(0) || int32(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { + if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { return 0 } libc.Xmemset(tls, bp+4, 0, uint32(56)) (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FnBlob = uint32(nBlob) + (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FnBlob = libc.Uint32FromInt32(nBlob) n = _jsonbPayloadSize(tls, bp+4, uint32(0), bp) if n == uint32(0) { return 0 } - if *(*Tu32)(unsafe.Pointer(bp))+n != uint32(nBlob) { + if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { return 0 } - if int32(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { return 0 } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == uint32(nBlob)) + return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) } // C documentation @@ -175568,13 +169475,11 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { var _ /* sz at bp+0 */ Tu32 _ = nBlob *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) nBlob = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc _jsonbPayloadSize(tls, pParse, iRoot, bp) (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = nBlob - *(*Tu32)(unsafe.Pointer(bp)) += uint32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta) + *(*Tu32)(unsafe.Pointer(bp)) += libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta) *(*int32)(unsafe.Pointer(pParse + 40)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } @@ -175597,10 +169502,10 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var d Ti64 var p1, p2 uintptr _, _, _ = d, p1, p2 - d = int64(nIns) - int64(nDel) + d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) if d != 0 { - if int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { - _jsonBlobExpand(tls, pParse, uint32(int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) + if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { + _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return } @@ -175648,7 +169553,7 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { } continue } - if int32(0xe2) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1)))))) && i+uint32(3) < n && int32(0x80) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2)))))) && (int32(0xa8) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(3)))))) || int32(0xa9) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(3))))))) { + if int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1)))))) && i+uint32(3) < n && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(3)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(3))))))) { i += uint32(4) continue } @@ -175673,13 +169578,11 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu var sz int32 var v2 bool _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n } - switch int32(uint8(*(*int8)(unsafe.Pointer(z + 1)))) { + switch libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 1)))) { case int32('u'): if n < uint32(6) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) @@ -175726,14 +169629,14 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu case int32('/'): fallthrough case int32('\\'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(*(*int8)(unsafe.Pointer(z + 1))) + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(z + 1))) return uint32(2) case int32('x'): if n < uint32(4) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n } - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(int32(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 2)))))<<int32(4) | int32(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 3)))))) + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(libc.Int32FromUint8(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 2)))))<<int32(4) | libc.Int32FromUint8(_jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 3)))))) return uint32(4) case int32(0xe2): fallthrough @@ -175752,8 +169655,8 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu if int32(*(*int8)(unsafe.Pointer(z + uintptr(nSkip)))) == int32('\\') { return nSkip + _jsonUnescapeOneChar(tls, z+uintptr(nSkip), n-nSkip, piOut) } else { - sz = _sqlite3Utf8ReadLimited(tls, z+uintptr(nSkip), int32(n-nSkip), piOut) - return nSkip + uint32(sz) + sz = _sqlite3Utf8ReadLimited(tls, z+uintptr(nSkip), libc.Int32FromUint32(n-nSkip), piOut) + return nSkip + libc.Uint32FromInt32(sz) } } } @@ -175782,7 +169685,6 @@ func _jsonLabelCompareEscaped(tls *libc.TLS, zLeft uintptr, nLeft Tu32, rawLeft var _ /* cLeft at bp+0 */ Tu32 var _ /* cRight at bp+4 */ Tu32 _, _, _, _ = n, n1, sz, sz1 - _ = libc.Int32FromInt32(0) for int32(1) != 0 { if nLeft == uint32(0) { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) @@ -175790,9 +169692,9 @@ func _jsonLabelCompareEscaped(tls *libc.TLS, zLeft uintptr, nLeft Tu32, rawLeft if rawLeft != 0 || int32(*(*int8)(unsafe.Pointer(zLeft))) != int32('\\') { *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(zLeft))) if *(*Tu32)(unsafe.Pointer(bp)) >= uint32(0xc0) { - sz = _sqlite3Utf8ReadLimited(tls, zLeft, int32(nLeft), bp) + sz = _sqlite3Utf8ReadLimited(tls, zLeft, libc.Int32FromUint32(nLeft), bp) zLeft += uintptr(sz) - nLeft -= uint32(sz) + nLeft -= libc.Uint32FromInt32(sz) } else { zLeft++ nLeft-- @@ -175800,7 +169702,6 @@ func _jsonLabelCompareEscaped(tls *libc.TLS, zLeft uintptr, nLeft Tu32, rawLeft } else { n = _jsonUnescapeOneChar(tls, zLeft, nLeft, bp) zLeft += uintptr(n) - _ = libc.Int32FromInt32(0) nLeft -= n } } @@ -175810,9 +169711,9 @@ func _jsonLabelCompareEscaped(tls *libc.TLS, zLeft uintptr, nLeft Tu32, rawLeft if rawRight != 0 || int32(*(*int8)(unsafe.Pointer(zRight))) != int32('\\') { *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(*(*Tu8)(unsafe.Pointer(zRight))) if *(*Tu32)(unsafe.Pointer(bp + 4)) >= uint32(0xc0) { - sz1 = _sqlite3Utf8ReadLimited(tls, zRight, int32(nRight), bp+4) + sz1 = _sqlite3Utf8ReadLimited(tls, zRight, libc.Int32FromUint32(nRight), bp+4) zRight += uintptr(sz1) - nRight -= uint32(sz1) + nRight -= libc.Uint32FromInt32(sz1) } else { zRight++ nRight-- @@ -175820,7 +169721,6 @@ func _jsonLabelCompareEscaped(tls *libc.TLS, zLeft uintptr, nLeft Tu32, rawLeft } else { n1 = _jsonUnescapeOneChar(tls, zRight, nRight, bp+4) zRight += uintptr(n1) - _ = libc.Int32FromInt32(0) nRight -= n1 } } @@ -175893,11 +169793,11 @@ func _jsonCreateEditSubstructure(tls *libc.TLS, pParse uintptr, pIns uintptr, zT (*TJsonParse)(unsafe.Pointer(pIns)).FeEdit = (*TJsonParse)(unsafe.Pointer(pParse)).FeEdit (*TJsonParse)(unsafe.Pointer(pIns)).FnIns = (*TJsonParse)(unsafe.Pointer(pParse)).FnIns (*TJsonParse)(unsafe.Pointer(pIns)).FaIns = (*TJsonParse)(unsafe.Pointer(pParse)).FaIns - rc = int32(_jsonLookupStep(tls, pIns, uint32(0), zTail, uint32(0))) + rc = libc.Int32FromUint32(_jsonLookupStep(tls, pIns, uint32(0), zTail, uint32(0))) p1 = pParse + 35 - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | int32((*TJsonParse)(unsafe.Pointer(pIns)).Foom)) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromUint8((*TJsonParse)(unsafe.Pointer(pIns)).Foom)) } - return uint32(rc) /* Error code only */ + return libc.Uint32FromInt32(rc) /* Error code only */ } var _emptyObject = [2]Tu8{ @@ -175941,14 +169841,14 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i if (*TJsonParse)(unsafe.Pointer(pParse)).FeEdit != 0 && _jsonBlobMakeEditable(tls, pParse, (*TJsonParse)(unsafe.Pointer(pParse)).FnIns) != 0 { n = _jsonbPayloadSize(tls, pParse, iRoot, bp) *(*Tu32)(unsafe.Pointer(bp)) += n - if int32((*TJsonParse)(unsafe.Pointer(pParse)).FeEdit) == int32(JEDIT_DEL) { + if libc.Int32FromUint8((*TJsonParse)(unsafe.Pointer(pParse)).FeEdit) == int32(JEDIT_DEL) { if iLabel > uint32(0) { *(*Tu32)(unsafe.Pointer(bp)) += iRoot - iLabel iRoot = iLabel } _jsonBlobEdit(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp)), uintptr(0), uint32(0)) } else { - if int32((*TJsonParse)(unsafe.Pointer(pParse)).FeEdit) == int32(JEDIT_INS) { + if libc.Int32FromUint8((*TJsonParse)(unsafe.Pointer(pParse)).FeEdit) == int32(JEDIT_INS) { /* Already exists, so json_insert() is a no-op */ } else { /* json_set() or json_replace() */ @@ -175999,15 +169899,15 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i return uint32(JSON_LOOKUP_PATHERROR) } } - if int32(x)&int32(0x0f) != int32(JSONB_OBJECT) { + if libc.Int32FromUint8(x)&int32(0x0f) != int32(JSONB_OBJECT) { return uint32(JSON_LOOKUP_NOTFOUND) } n = _jsonbPayloadSize(tls, pParse, iRoot, bp) j = iRoot + n /* j is the index of a label */ iEnd = j + *(*Tu32)(unsafe.Pointer(bp)) for j < iEnd { - x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(j)))) & int32(0x0f)) - if int32(x) < int32(JSONB_TEXT) || int32(x) > int32(JSONB_TEXTRAW) { + x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(j)))) & int32(0x0f)) + if libc.Int32FromUint8(x) < int32(JSONB_TEXT) || libc.Int32FromUint8(x) > int32(JSONB_TEXTRAW) { return uint32(JSON_LOOKUP_ERROR) } n = _jsonbPayloadSize(tls, pParse, j, bp) @@ -176019,17 +169919,16 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i return uint32(JSON_LOOKUP_ERROR) } zLabel = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(k) - rawLabel = libc.BoolInt32(int32(x) == int32(JSONB_TEXT) || int32(x) == int32(JSONB_TEXTRAW)) + rawLabel = libc.BoolInt32(libc.Int32FromUint8(x) == int32(JSONB_TEXT) || libc.Int32FromUint8(x) == int32(JSONB_TEXTRAW)) if _jsonLabelCompare(tls, zKey, nKey, rawKey, zLabel, *(*Tu32)(unsafe.Pointer(bp)), rawLabel) != 0 { v = k + *(*Tu32)(unsafe.Pointer(bp)) /* v is the index of the value */ - if int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(v))))&int32(0x0f) > int32(JSONB_OBJECT) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(v))))&int32(0x0f) > int32(JSONB_OBJECT) { return uint32(JSON_LOOKUP_ERROR) } n = _jsonbPayloadSize(tls, pParse, v, bp) if n == uint32(0) || v+n+*(*Tu32)(unsafe.Pointer(bp)) > iEnd { return uint32(JSON_LOOKUP_ERROR) } - _ = libc.Int32FromInt32(0) rc = _jsonLookupStep(tls, pParse, v, zPath+uintptr(i), j) if (*TJsonParse)(unsafe.Pointer(pParse)).Fdelta != 0 { _jsonAfterEditSizeAdjust(tls, pParse, iRoot) @@ -176037,7 +169936,7 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i return rc } j = k + *(*Tu32)(unsafe.Pointer(bp)) - if int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(j))))&int32(0x0f) > int32(JSONB_OBJECT) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(j))))&int32(0x0f) > int32(JSONB_OBJECT) { return uint32(JSON_LOOKUP_ERROR) } n = _jsonbPayloadSize(tls, pParse, j, bp) @@ -176049,7 +169948,7 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i if j > iEnd { return uint32(JSON_LOOKUP_ERROR) } - if int32((*TJsonParse)(unsafe.Pointer(pParse)).FeEdit) >= int32(JEDIT_INS) { /* Header of the label to be inserted */ + if libc.Int32FromUint8((*TJsonParse)(unsafe.Pointer(pParse)).FeEdit) >= int32(JEDIT_INS) { /* Header of the label to be inserted */ libc.Xmemset(tls, bp+60, 0, uint32(56)) (*(*TJsonParse)(unsafe.Pointer(bp + 60))).Fdb = (*TJsonParse)(unsafe.Pointer(pParse)).Fdb if rawKey != 0 { @@ -176057,17 +169956,16 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i } else { v3 = int32(JSONB_TEXT5) } - _jsonBlobAppendNode(tls, bp+60, uint8(v3), nKey, uintptr(0)) + _jsonBlobAppendNode(tls, bp+60, libc.Uint8FromInt32(v3), nKey, uintptr(0)) p4 = pParse + 35 - *(*Tu8)(unsafe.Pointer(p4)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p4))) | int32((*(*TJsonParse)(unsafe.Pointer(bp + 60))).Foom)) + *(*Tu8)(unsafe.Pointer(p4)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p4))) | libc.Int32FromUint8((*(*TJsonParse)(unsafe.Pointer(bp + 60))).Foom)) rc = _jsonCreateEditSubstructure(tls, pParse, bp+4, zPath+uintptr(i)) if !(rc >= libc.Uint32FromUint32(JSON_LOOKUP_PATHERROR)) && _jsonBlobMakeEditable(tls, pParse, (*(*TJsonParse)(unsafe.Pointer(bp + 60))).FnBlob+nKey+(*(*TJsonParse)(unsafe.Pointer(bp + 4))).FnBlob) != 0 { - _ = libc.Int32FromInt32(0) nIns = (*(*TJsonParse)(unsafe.Pointer(bp + 60))).FnBlob + nKey + (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FnBlob _jsonBlobEdit(tls, pParse, j, uint32(0), uintptr(0), nIns) if !((*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0) { - _ = libc.Int32FromInt32(0) /* Because pParse->oom!=0 */ - _ = libc.Int32FromInt32(0) /* Because pPasre->oom!=0 */ + /* Because pParse->oom!=0 */ + /* Because pPasre->oom!=0 */ libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(j), (*(*TJsonParse)(unsafe.Pointer(bp + 60))).FaBlob, (*(*TJsonParse)(unsafe.Pointer(bp + 60))).FnBlob) k = j + (*(*TJsonParse)(unsafe.Pointer(bp + 60))).FnBlob libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(k), zKey, nKey) @@ -176084,26 +169982,26 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i } } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') { - x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(iRoot)))) & int32(0x0f)) - if int32(x) != int32(JSONB_ARRAY) { + x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(iRoot)))) & int32(0x0f)) + if libc.Int32FromUint8(x) != int32(JSONB_ARRAY) { return uint32(JSON_LOOKUP_NOTFOUND) } n = _jsonbPayloadSize(tls, pParse, iRoot, bp) k = uint32(0) i = uint32(1) - for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath + uintptr(i))))])&int32(0x04) != 0 { - k = k*uint32(10) + uint32(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) - uint32('0') + for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zPath + uintptr(i))))])&int32(0x04) != 0 { + k = k*uint32(10) + libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) - uint32('0') i++ } if i < uint32(2) || int32(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) != int32(']') { if int32(*(*int8)(unsafe.Pointer(zPath + 1))) == int32('#') { k = _jsonbArrayCount(tls, pParse, iRoot) i = uint32(2) - if int32(*(*int8)(unsafe.Pointer(zPath + 2))) == int32('-') && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath + 3)))])&int32(0x04) != 0 { + if int32(*(*int8)(unsafe.Pointer(zPath + 2))) == int32('-') && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zPath + 3)))])&int32(0x04) != 0 { nn = uint32(0) i = uint32(3) - for cond := true; cond; cond = int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath + uintptr(i))))])&int32(0x04) != 0 { - nn = nn*uint32(10) + uint32(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) - uint32('0') + for cond := true; cond; cond = libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zPath + uintptr(i))))])&int32(0x04) != 0 { + nn = nn*uint32(10) + libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) - uint32('0') i++ } if nn > k { @@ -176141,10 +170039,9 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i if k > uint32(0) { return uint32(JSON_LOOKUP_NOTFOUND) } - if int32((*TJsonParse)(unsafe.Pointer(pParse)).FeEdit) >= int32(JEDIT_INS) { + if libc.Int32FromUint8((*TJsonParse)(unsafe.Pointer(pParse)).FeEdit) >= int32(JEDIT_INS) { rc = _jsonCreateEditSubstructure(tls, pParse, bp+116, zPath+uintptr(i+uint32(1))) if !(rc >= libc.Uint32FromUint32(JSON_LOOKUP_PATHERROR)) && _jsonBlobMakeEditable(tls, pParse, (*(*TJsonParse)(unsafe.Pointer(bp + 116))).FnBlob) != 0 { - _ = libc.Int32FromInt32(0) _jsonBlobEdit(tls, pParse, j, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp + 116))).FaBlob, (*(*TJsonParse)(unsafe.Pointer(bp + 116))).FnBlob) } _jsonParseReset(tls, bp+116) @@ -176208,10 +170105,10 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25088, -int32(1)) return } - switch int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { case JSONB_NULL: goto _1 case int32(JSONB_TRUE): @@ -176272,7 +170169,7 @@ _4: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } - x = int8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n)))) + x = libc.Int8FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n)))) if int32(x) == int32('-') { if *(*Tu32)(unsafe.Pointer(bp)) < uint32(2) { goto returnfromblob_malformed @@ -176281,7 +170178,7 @@ _4: *(*Tu32)(unsafe.Pointer(bp))-- bNeg = int32(1) } - z = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) + z = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), libc.Uint64FromInt32(libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))))) if z == uintptr(0) { goto returnfromblob_oom } @@ -176320,7 +170217,7 @@ _6: goto to_double to_double: ; - z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) + z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), libc.Uint64FromInt32(libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))))) if z1 == uintptr(0) { goto returnfromblob_oom } @@ -176335,7 +170232,7 @@ _9: ; _8: ; - Xsqlite3_result_text(tls, pCtx, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), int32(*(*Tu32)(unsafe.Pointer(bp))), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, pCtx, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))), uintptr(-libc.Int32FromInt32(1))) goto _15 _11: ; @@ -176360,45 +170257,42 @@ _10: if *(*Tu32)(unsafe.Pointer(bp + 24)) <= uint32(0x7f) { v19 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v19))) = int8(*(*Tu32)(unsafe.Pointer(bp + 24))) + *(*int8)(unsafe.Pointer(zOut + uintptr(v19))) = libc.Int8FromUint32(*(*Tu32)(unsafe.Pointer(bp + 24))) } else { if *(*Tu32)(unsafe.Pointer(bp + 24)) <= uint32(0x7ff) { - _ = libc.Int32FromInt32(0) v20 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v20))) = int8(libc.Uint32FromInt32(0xc0) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(6)) + *(*int8)(unsafe.Pointer(zOut + uintptr(v20))) = libc.Int8FromUint32(libc.Uint32FromInt32(0xc0) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(6)) v21 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v21))) = int8(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))&uint32(0x3f)) + *(*int8)(unsafe.Pointer(zOut + uintptr(v21))) = libc.Int8FromUint32(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))&uint32(0x3f)) } else { if *(*Tu32)(unsafe.Pointer(bp + 24)) < uint32(0x10000) { - _ = libc.Int32FromInt32(0) v22 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v22))) = int8(uint32(0xe0) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(12)) + *(*int8)(unsafe.Pointer(zOut + uintptr(v22))) = libc.Int8FromUint32(uint32(0xe0) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(12)) v23 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v23))) = int8(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(6)&uint32(0x3f)) + *(*int8)(unsafe.Pointer(zOut + uintptr(v23))) = libc.Int8FromUint32(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(6)&uint32(0x3f)) v24 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v24))) = int8(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))&uint32(0x3f)) + *(*int8)(unsafe.Pointer(zOut + uintptr(v24))) = libc.Int8FromUint32(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))&uint32(0x3f)) } else { if *(*Tu32)(unsafe.Pointer(bp + 24)) == uint32(JSON_INVALID_CHAR) { /* Silently ignore illegal unicode */ } else { - _ = libc.Int32FromInt32(0) v25 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v25))) = int8(uint32(0xf0) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(18)) + *(*int8)(unsafe.Pointer(zOut + uintptr(v25))) = libc.Int8FromUint32(uint32(0xf0) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(18)) v26 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v26))) = int8(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(12)&uint32(0x3f)) + *(*int8)(unsafe.Pointer(zOut + uintptr(v26))) = libc.Int8FromUint32(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(12)&uint32(0x3f)) v27 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v27))) = int8(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(6)&uint32(0x3f)) + *(*int8)(unsafe.Pointer(zOut + uintptr(v27))) = libc.Int8FromUint32(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))>>libc.Int32FromInt32(6)&uint32(0x3f)) v28 = iOut iOut++ - *(*int8)(unsafe.Pointer(zOut + uintptr(v28))) = int8(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))&uint32(0x3f)) + *(*int8)(unsafe.Pointer(zOut + uintptr(v28))) = libc.Int8FromUint32(uint32(0x80) | *(*Tu32)(unsafe.Pointer(bp + 24))&uint32(0x3f)) } } } @@ -176414,9 +170308,8 @@ _10: ; iIn++ } /* end for() */ - _ = libc.Int32FromInt32(0) *(*int8)(unsafe.Pointer(zOut + uintptr(iOut))) = 0 - Xsqlite3_result_text(tls, pCtx, zOut, int32(iOut), __ccgo_fp(_sqlite3OomClear)) + Xsqlite3_result_text(tls, pCtx, zOut, libc.Int32FromUint32(iOut), __ccgo_fp(_sqlite3OomClear)) goto _15 _13: ; @@ -176429,7 +170322,7 @@ _12: } flags = v30 if flags&int32(JSON_BLOB) != 0 { - Xsqlite3_result_blob(tls, pCtx, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i), int32(*(*Tu32)(unsafe.Pointer(bp))+n), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_blob(tls, pCtx, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i), libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+n), uintptr(-libc.Int32FromInt32(1))) } else { _jsonReturnTextJsonFromBlob(tls, pCtx, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i), *(*Tu32)(unsafe.Pointer(bp))+n) } @@ -176448,7 +170341,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25088, -int32(1)) return } @@ -176487,9 +170380,9 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin case int32(SQLITE_BLOB): if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(Xsqlite3_value_bytes(tls, pArg)) + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25030, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -176502,13 +170395,13 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint32(56)) return int32(1) } } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_TEXTRAW), uint32(nJson), zJson) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_TEXTRAW), libc.Uint32FromInt32(nJson), zJson) } case int32(SQLITE_FLOAT): r = Xsqlite3_value_double(tls, pArg) @@ -176521,12 +170414,12 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if int32(*(*int8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25164) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25193) } else { if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25157) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25186) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(n), z) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } } } @@ -176536,7 +170429,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin if z1 == uintptr(0) { return int32(1) } - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_INT), uint32(n1), z1) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_INT), libc.Uint32FromInt32(n1), z1) break } if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { @@ -176563,7 +170456,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25204, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25233, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -176596,14 +170489,13 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _, _, _, _, _, _ = flgs, i, p, rc, zPath, v1 rc = uint32(0) zPath = uintptr(0) - _ = libc.Int32FromInt32(0) if argc == int32(1) { v1 = 0 } else { v1 = int32(JSON_EDITABLE) } flgs = v1 - p = _jsonParseFuncArg(tls, ctx, *(*uintptr)(unsafe.Pointer(argv)), uint32(flgs)) + p = _jsonParseFuncArg(tls, ctx, *(*uintptr)(unsafe.Pointer(argv)), libc.Uint32FromInt32(flgs)) if p == uintptr(0) { return } @@ -176635,7 +170527,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e } rc = uint32(0) } else { - (*TJsonParse)(unsafe.Pointer(p)).FeEdit = uint8(eEdit) + (*TJsonParse)(unsafe.Pointer(p)).FeEdit = libc.Uint8FromInt32(eEdit) (*TJsonParse)(unsafe.Pointer(p)).FnIns = (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob (*TJsonParse)(unsafe.Pointer(p)).FaIns = (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob (*TJsonParse)(unsafe.Pointer(p)).Fdelta = 0 @@ -176661,7 +170553,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -176688,7 +170580,7 @@ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { _, _, _ = n, v1, v2 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = uint32(Xsqlite3_value_bytes(tls, pArg)) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) return 0 @@ -176696,11 +170588,11 @@ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { return 0 } - if v2 = int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { + if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) n = v1 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -176733,7 +170625,6 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u _, _, _, _, _, _, _, _, _, _ = db, eType, isRCStr, nBlob, p, pFromCache, rc, zNew, v1, v2 /* Datatype of pArg */ p = uintptr(0) /* Value to be returned */ pFromCache = uintptr(0) /* The database connection */ - _ = libc.Int32FromInt32(0) eType = Xsqlite3_value_type(tls, pArg) if eType == int32(SQLITE_NULL) { return uintptr(0) @@ -176798,7 +170689,6 @@ rebuild_from_cache: if (*TJsonParse)(unsafe.Pointer(p)).FnJson == 0 { goto json_pfa_malformed } - _ = libc.Int32FromInt32(0) if flgs&uint32(JSON_KEEPERROR) != 0 { v2 = uintptr(0) } else { @@ -176815,11 +170705,11 @@ rebuild_from_cache: } else { isRCStr = _sqlite3ValueIsOfClass(tls, pArg, __ccgo_fp(_sqlite3RCStrUnref)) if !(isRCStr != 0) { - zNew = _sqlite3RCStrNew(tls, uint64((*TJsonParse)(unsafe.Pointer(p)).FnJson)) + zNew = _sqlite3RCStrNew(tls, libc.Uint64FromInt32((*TJsonParse)(unsafe.Pointer(p)).FnJson)) if zNew == uintptr(0) { goto json_pfa_oom } - libc.Xmemcpy(tls, zNew, (*TJsonParse)(unsafe.Pointer(p)).FzJson, uint32((*TJsonParse)(unsafe.Pointer(p)).FnJson)) + libc.Xmemcpy(tls, zNew, (*TJsonParse)(unsafe.Pointer(p)).FzJson, libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(p)).FnJson)) (*TJsonParse)(unsafe.Pointer(p)).FzJson = zNew *(*int8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FzJson + uintptr((*TJsonParse)(unsafe.Pointer(p)).FnJson))) = 0 } else { @@ -176845,7 +170735,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -176877,10 +170767,10 @@ func _jsonReturnParse(tls *libc.TLS, ctx uintptr, p uintptr) { flgs = int32(Xsqlite3_user_data(tls, ctx)) if flgs&int32(JSON_BLOB) != 0 { if (*TJsonParse)(unsafe.Pointer(p)).FnBlobAlloc > uint32(0) && !((*TJsonParse)(unsafe.Pointer(p)).FbReadOnly != 0) { - Xsqlite3_result_blob(tls, ctx, (*TJsonParse)(unsafe.Pointer(p)).FaBlob, int32((*TJsonParse)(unsafe.Pointer(p)).FnBlob), __ccgo_fp(_sqlite3OomClear)) + Xsqlite3_result_blob(tls, ctx, (*TJsonParse)(unsafe.Pointer(p)).FaBlob, libc.Int32FromUint32((*TJsonParse)(unsafe.Pointer(p)).FnBlob), __ccgo_fp(_sqlite3OomClear)) (*TJsonParse)(unsafe.Pointer(p)).FnBlobAlloc = uint32(0) } else { - Xsqlite3_result_blob(tls, ctx, (*TJsonParse)(unsafe.Pointer(p)).FaBlob, int32((*TJsonParse)(unsafe.Pointer(p)).FnBlob), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_blob(tls, ctx, (*TJsonParse)(unsafe.Pointer(p)).FaBlob, libc.Int32FromUint32((*TJsonParse)(unsafe.Pointer(p)).FnBlob), uintptr(-libc.Int32FromInt32(1))) } } else { _jsonStringInit(tls, bp, ctx) @@ -176980,7 +170870,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25222 + v1 = __ccgo_ts + 25251 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -176990,7 +170880,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) } } eErr = uint8(1) @@ -176999,8 +170889,8 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) } else { i = uint32(0) } - if int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f) == int32(JSONB_ARRAY) { - cnt = int64(_jsonbArrayCount(tls, p, i)) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f) == int32(JSONB_ARRAY) { + cnt = libc.Int64FromUint32(_jsonbArrayCount(tls, p, i)) } if !(eErr != 0) { Xsqlite3_result_int64(tls, ctx, cnt) @@ -177016,7 +170906,7 @@ func _jsonAllAlphanum(tls *libc.TLS, z uintptr, n int32) (r int32) { _ = i i = 0 for { - if !(i < n && (int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&int32(0x06) != 0 || int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('_'))) { + if !(i < n && (libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&int32(0x06) != 0 || int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('_'))) { break } goto _1 @@ -177095,20 +170985,20 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25224, uint32(1)) - _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25253, uint32(1)) + _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) _jsonAppendRawNZ(tls, bp, __ccgo_ts+5225, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { _jsonAppendRawNZ(tls, bp, __ccgo_ts+1675, uint32(1)) - _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) + _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { - _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) + _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25226, uint32(2)) - _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25229, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25255, uint32(2)) + _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25258, uint32(1)) } } } @@ -177127,11 +171017,10 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonTranslateBlobToText(tls, p, j, bp) _jsonReturnString(tls, bp, uintptr(0), uintptr(0)) _jsonStringReset(tls, bp) - _ = libc.Int32FromInt32(0) Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } else { _jsonReturnFromBlob(tls, p, j, ctx, 0) - if flags&(libc.Int32FromInt32(JSON_SQL)|libc.Int32FromInt32(JSON_BLOB)) == 0 && int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(j))))&int32(0x0f) >= int32(JSONB_ARRAY) { + if flags&(libc.Int32FromInt32(JSON_SQL)|libc.Int32FromInt32(JSON_BLOB)) == 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(j))))&int32(0x0f) >= int32(JSONB_ARRAY) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } @@ -177149,7 +171038,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -177248,10 +171137,8 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt iTValue = uint32(0) /* Index of the target value */ nTValue = uint32(0) /* Header size of the target value */ *(*Tu32)(unsafe.Pointer(bp + 8)) = uint32(0) /* Payload size of the patch value */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPatch)))) & int32(0x0f)) - if int32(x) != int32(JSONB_OBJECT) { /* Total size of the target, header+payload */ + x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPatch)))) & int32(0x0f)) + if libc.Int32FromUint8(x) != int32(JSONB_OBJECT) { /* Total size of the target, header+payload */ n = _jsonbPayloadSize(tls, pPatch, iPatch, bp) szPatch = n + *(*Tu32)(unsafe.Pointer(bp)) *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) @@ -177265,12 +171152,12 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt } return v1 /* Line 03 */ } - x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTarget)))) & int32(0x0f)) - if int32(x) != int32(JSONB_OBJECT) { /* Algorithm line 05 */ + x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTarget)))) & int32(0x0f)) + if libc.Int32FromUint8(x) != int32(JSONB_OBJECT) { /* Algorithm line 05 */ n = _jsonbPayloadSize(tls, pTarget, iTarget, bp) _jsonBlobEdit(tls, pTarget, iTarget+n, *(*Tu32)(unsafe.Pointer(bp)), uintptr(0), uint32(0)) x = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTarget))) - *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTarget))) = uint8(int32(x)&int32(0xf0) | int32(JSONB_OBJECT)) + *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTarget))) = libc.Uint8FromInt32(libc.Int32FromUint8(x)&int32(0xf0) | int32(JSONB_OBJECT)) } n = _jsonbPayloadSize(tls, pPatch, iPatch, bp) if n == uint32(0) { @@ -177286,8 +171173,8 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt iTEndBE = iTStart + *(*Tu32)(unsafe.Pointer(bp)) for iPCursor < iPEnd { /* Algorithm line 07 */ iPLabel = iPCursor - ePLabel = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPCursor)))) & int32(0x0f)) - if int32(ePLabel) < int32(JSONB_TEXT) || int32(ePLabel) > int32(JSONB_TEXTRAW) { + ePLabel = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPCursor)))) & int32(0x0f)) + if libc.Int32FromUint8(ePLabel) < int32(JSONB_TEXT) || libc.Int32FromUint8(ePLabel) > int32(JSONB_TEXTRAW) { return int32(JSON_MERGE_BADPATCH) } nPLabel = _jsonbPayloadSize(tls, pPatch, iPCursor, bp+12) @@ -177307,11 +171194,11 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt return int32(JSON_MERGE_BADPATCH) } iTCursor = iTStart - iTEnd = iTEndBE + uint32((*TJsonParse)(unsafe.Pointer(pTarget)).Fdelta) + iTEnd = iTEndBE + libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pTarget)).Fdelta) for iTCursor < iTEnd { /* true if the patch and target labels match */ iTLabel = iTCursor - eTLabel = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTCursor)))) & int32(0x0f)) - if int32(eTLabel) < int32(JSONB_TEXT) || int32(eTLabel) > int32(JSONB_TEXTRAW) { + eTLabel = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTCursor)))) & int32(0x0f)) + if libc.Int32FromUint8(eTLabel) < int32(JSONB_TEXT) || libc.Int32FromUint8(eTLabel) > int32(JSONB_TEXTRAW) { return int32(JSON_MERGE_BADTARGET) } nTLabel = _jsonbPayloadSize(tls, pTarget, iTCursor, bp+4) @@ -177329,16 +171216,16 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt if iTValue+nTValue+*(*Tu32)(unsafe.Pointer(bp + 8)) > iTEnd { return int32(JSON_MERGE_BADTARGET) } - isEqual = _jsonLabelCompare(tls, (*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob+uintptr(iPLabel+nPLabel), *(*Tu32)(unsafe.Pointer(bp + 12)), libc.BoolInt32(int32(ePLabel) == int32(JSONB_TEXT) || int32(ePLabel) == int32(JSONB_TEXTRAW)), (*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob+uintptr(iTLabel+nTLabel), *(*Tu32)(unsafe.Pointer(bp + 4)), libc.BoolInt32(int32(eTLabel) == int32(JSONB_TEXT) || int32(eTLabel) == int32(JSONB_TEXTRAW))) + isEqual = _jsonLabelCompare(tls, (*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob+uintptr(iPLabel+nPLabel), *(*Tu32)(unsafe.Pointer(bp + 12)), libc.BoolInt32(libc.Int32FromUint8(ePLabel) == int32(JSONB_TEXT) || libc.Int32FromUint8(ePLabel) == int32(JSONB_TEXTRAW)), (*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob+uintptr(iTLabel+nTLabel), *(*Tu32)(unsafe.Pointer(bp + 4)), libc.BoolInt32(libc.Int32FromUint8(eTLabel) == int32(JSONB_TEXT) || libc.Int32FromUint8(eTLabel) == int32(JSONB_TEXTRAW))) if isEqual != 0 { break } iTCursor = iTValue + nTValue + *(*Tu32)(unsafe.Pointer(bp + 8)) } - x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPValue)))) & int32(0x0f)) + x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPValue)))) & int32(0x0f)) if iTCursor < iTEnd { /* A match was found. Algorithm line 08 */ - if int32(x) == 0 { + if libc.Int32FromUint8(x) == 0 { /* Patch value is NULL. Algorithm line 09 */ _jsonBlobEdit(tls, pTarget, iTLabel, nTLabel+*(*Tu32)(unsafe.Pointer(bp + 4))+nTValue+*(*Tu32)(unsafe.Pointer(bp + 8)), uintptr(0), uint32(0)) /* vvvvvv----- No OOM on a delete-only edit */ @@ -177355,10 +171242,10 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt *(*int32)(unsafe.Pointer(pTarget + 40)) += savedDelta } } else { - if int32(x) > 0 { /* Algorithm line 13 */ + if libc.Int32FromUint8(x) > 0 { /* Algorithm line 13 */ /* No match and patch value is not NULL */ szNew = *(*Tu32)(unsafe.Pointer(bp + 12)) + nPLabel - if int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPValue))))&int32(0x0f) != int32(JSONB_OBJECT) { /* Line 14 */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPValue))))&int32(0x0f) != int32(JSONB_OBJECT) { /* Line 14 */ _jsonBlobEdit(tls, pTarget, iTEnd, uint32(0), uintptr(0), *(*Tu32)(unsafe.Pointer(bp + 16))+nPValue+szNew) if (*TJsonParse)(unsafe.Pointer(pTarget)).Foom != 0 { return int32(JSON_MERGE_OOM) @@ -177406,7 +171293,6 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var rc int32 _, _, _ = pPatch, pTarget, rc /* Result code */ _ = argc - _ = libc.Int32FromInt32(0) pTarget = _jsonParseFuncArg(tls, ctx, *(*uintptr)(unsafe.Pointer(argv)), uint32(JSON_EDITABLE)) if pTarget == uintptr(0) { return @@ -177420,7 +171306,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -177444,7 +171330,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25231, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25260, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -177455,13 +171341,13 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25282, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25311, -int32(1)) _jsonStringReset(tls, bp) return } _jsonAppendSeparator(tls, bp) z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) - n = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))) + n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))) _jsonAppendString(tls, bp, z, n) _jsonAppendChar(tls, bp, int8(':')) _jsonAppendSqlValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(i+int32(1))*4))) @@ -177497,7 +171383,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } else { v1 = 0 } - p = _jsonParseFuncArg(tls, ctx, *(*uintptr)(unsafe.Pointer(argv)), uint32(v1)) + p = _jsonParseFuncArg(tls, ctx, *(*uintptr)(unsafe.Pointer(argv)), libc.Uint32FromInt32(v1)) if p == uintptr(0) { return } @@ -177527,7 +171413,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) } } goto json_remove_done @@ -177595,9 +171481,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25316 + v1 = __ccgo_ts + 25345 } else { - v1 = __ccgo_ts + 25320 + v1 = __ccgo_ts + 25349 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -177645,7 +171531,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) } } goto json_type_done @@ -177653,7 +171539,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } else { i = uint32(0) } - Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, _jsonbType[libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) goto json_type_done json_type_done: ; @@ -177692,7 +171578,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 25327 + (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 25356 (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent) @@ -177776,25 +171662,25 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25332, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25361, -int32(1)) return } - flags = uint8(f & int64(0x0f)) + flags = libc.Uint8FromInt64(f & int64(0x0f)) } switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - if int32(flags)&int32(0x04) != 0 { + if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the ** jsonFuncArgMightBeBinary() call above. */ res = uint8(1) } else { - if int32(flags)&int32(0x08) != 0 { + if libc.Int32FromUint8(flags)&int32(0x08) != 0 { libc.Xmemset(tls, bp, 0, uint32(56)) (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) res = libc.BoolUint8(iErr == uint32(0)) } @@ -177803,7 +171689,7 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } fallthrough default: - if int32(flags)&int32(0x3) == 0 { + if libc.Int32FromUint8(flags)&int32(0x3) == 0 { break } libc.Xmemset(tls, bp+56, 0, uint32(56)) @@ -177815,7 +171701,7 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if (*TJsonParse)(unsafe.Pointer(p)).FnErr != 0 { /* no-op */ } else { - if int32(flags)&int32(0x02) != 0 || int32((*TJsonParse)(unsafe.Pointer(p)).FhasNonstd) == 0 { + if libc.Int32FromUint8(flags)&int32(0x02) != 0 || libc.Int32FromUint8((*TJsonParse)(unsafe.Pointer(p)).FhasNonstd) == 0 { res = uint8(1) } } @@ -177826,7 +171712,7 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } break } - Xsqlite3_result_int(tls, ctx, int32(res)) + Xsqlite3_result_int(tls, ctx, libc.Int32FromUint8(res)) } // C documentation @@ -177853,14 +171739,13 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* s at bp+0 */ TJsonParse _, _ = iErrPos, k iErrPos = 0 - _ = libc.Int32FromInt32(0) _ = argc libc.Xmemset(tls, bp, 0, uint32(56)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErrPos = int64(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) + (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson == uintptr(0) { @@ -177871,7 +171756,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if (*(*TJsonParse)(unsafe.Pointer(bp))).Foom != 0 { iErrPos = int64(-int32(1)) } else { - _ = libc.Int32FromInt32(0) /* Because s.oom is false */ + /* Because s.oom is false */ k = uint32(0) for { if !(k < (*(*TJsonParse)(unsafe.Pointer(bp))).FiErr && *(*int8)(unsafe.Pointer((*(*TJsonParse)(unsafe.Pointer(bp))).FzJson + uintptr(k))) != 0) { @@ -177957,16 +171842,16 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } else { v1 = __ccgo_fp(_sqlite3RCStrUnref) } - Xsqlite3_result_text(tls, ctx, (*TJsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*TJsonString)(unsafe.Pointer(pStr)).FnUsed), v1) + Xsqlite3_result_text(tls, ctx, (*TJsonString)(unsafe.Pointer(pStr)).FzBuf, libc.Int32FromUint64((*TJsonString)(unsafe.Pointer(pStr)).FnUsed), v1) (*TJsonString)(unsafe.Pointer(pStr)).FbStatic = uint8(1) } else { - Xsqlite3_result_text(tls, ctx, (*TJsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*TJsonString)(unsafe.Pointer(pStr)).FnUsed), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, ctx, (*TJsonString)(unsafe.Pointer(pStr)).FzBuf, libc.Int32FromUint64((*TJsonString)(unsafe.Pointer(pStr)).FnUsed), uintptr(-libc.Int32FromInt32(1))) _jsonStringTrimOneChar(tls, pStr) } } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25389, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25418, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -178068,7 +171953,7 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = uint32(_sqlite3Strlen30(tls, z)) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) _jsonAppendString(tls, pStr, z, n) _jsonAppendChar(tls, pStr, int8(':')) _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*4))) @@ -178106,16 +171991,16 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } else { v1 = __ccgo_fp(_sqlite3RCStrUnref) } - Xsqlite3_result_text(tls, ctx, (*TJsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*TJsonString)(unsafe.Pointer(pStr)).FnUsed), v1) + Xsqlite3_result_text(tls, ctx, (*TJsonString)(unsafe.Pointer(pStr)).FzBuf, libc.Int32FromUint64((*TJsonString)(unsafe.Pointer(pStr)).FnUsed), v1) (*TJsonString)(unsafe.Pointer(pStr)).FbStatic = uint8(1) } else { - Xsqlite3_result_text(tls, ctx, (*TJsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*TJsonString)(unsafe.Pointer(pStr)).FnUsed), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, ctx, (*TJsonString)(unsafe.Pointer(pStr)).FzBuf, libc.Int32FromUint64((*TJsonString)(unsafe.Pointer(pStr)).FnUsed), uintptr(-libc.Int32FromInt32(1))) _jsonStringTrimOneChar(tls, pStr) } } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25392, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25421, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -178218,7 +172103,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25395) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25424) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(16)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -178328,12 +172213,12 @@ func _jsonSkipLabel(tls *libc.TLS, p uintptr) (r int32) { var n Tu32 var _ /* sz at bp+0 */ Tu32 _ = n - if int32((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_OBJECT) { + if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_OBJECT) { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) n = _jsonbPayloadSize(tls, p+168, (*TJsonEachCursor)(unsafe.Pointer(p)).Fi, bp) - return int32((*TJsonEachCursor)(unsafe.Pointer(p)).Fi + n + *(*Tu32)(unsafe.Pointer(bp))) + return libc.Int32FromUint32((*TJsonEachCursor)(unsafe.Pointer(p)).Fi + n + *(*Tu32)(unsafe.Pointer(bp))) } else { - return int32((*TJsonEachCursor)(unsafe.Pointer(p)).Fi) + return libc.Int32FromUint32((*TJsonEachCursor)(unsafe.Pointer(p)).Fi) } return r } @@ -178351,17 +172236,15 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var z uintptr var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if int32((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+40, __ccgo_ts+25478, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { + _jsonPrintf(tls, int32(30), p+40, __ccgo_ts+25507, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 n = _jsonbPayloadSize(tls, p+168, (*TJsonEachCursor)(unsafe.Pointer(p)).Fi, bp) k = (*TJsonEachCursor)(unsafe.Pointer(p)).Fi + n z = (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(k) - if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) || !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&libc.Int32FromInt32(0x02) != 0) { + if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z)))])&libc.Int32FromInt32(0x02) != 0) { needQuote = int32(1) } else { i = uint32(0) @@ -178369,7 +172252,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { if !(i < *(*Tu32)(unsafe.Pointer(bp))) { break } - if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x06) != 0) { + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x06) != 0) { needQuote = int32(1) break } @@ -178380,9 +172263,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+25485, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+25514, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25493, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25522, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -178406,10 +172289,10 @@ func _jsonEachNext(tls *libc.TLS, cur uintptr) (r int32) { if (*TJsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 { levelChange = uint8(0) *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - i = uint32(_jsonSkipLabel(tls, p)) - x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i)))) & int32(0x0f)) + i = libc.Uint32FromInt32(_jsonSkipLabel(tls, p)) + x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i)))) & int32(0x0f)) n = _jsonbPayloadSize(tls, p+168, i, bp) - if int32(x) == int32(JSONB_OBJECT) || int32(x) == int32(JSONB_ARRAY) { + if libc.Int32FromUint8(x) == int32(JSONB_OBJECT) || libc.Int32FromUint8(x) == int32(JSONB_ARRAY) { if (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent >= (*TJsonEachCursor)(unsafe.Pointer(p)).FnParentAlloc { nNew = uint64((*TJsonEachCursor)(unsafe.Pointer(p)).FnParentAlloc*uint32(2) + uint32(3)) pNew = _sqlite3DbRealloc(tls, (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb, (*TJsonEachCursor)(unsafe.Pointer(p)).FaParent, uint64(24)*nNew) @@ -178446,18 +172329,18 @@ func _jsonEachNext(tls *libc.TLS, cur uintptr) (r int32) { if (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent > uint32(0) { pParent1 = (*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24 iVal = (*TJsonParent)(unsafe.Pointer(pParent1)).FiValue - (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(iVal)))) & int32(0x0f)) + (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(iVal)))) & int32(0x0f)) } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) } } } else { *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(0) - i1 = uint32(_jsonSkipLabel(tls, p)) + i1 = libc.Uint32FromInt32(_jsonSkipLabel(tls, p)) n1 = _jsonbPayloadSize(tls, p+168, i1, bp+4) (*TJsonEachCursor)(unsafe.Pointer(p)).Fi = i1 + n1 + *(*Tu32)(unsafe.Pointer(bp + 4)) } - if int32((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) && (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent != 0 { + if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) && (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent != 0 { (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey++ } (*TJsonEachCursor)(unsafe.Pointer(p)).FiRowid++ @@ -178485,7 +172368,6 @@ func _jsonEachPathLength(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) cSaved = *(*int8)(unsafe.Pointer(z + uintptr(n))) *(*int8)(unsafe.Pointer(z + uintptr(n))) = 0 - _ = libc.Int32FromInt32(0) x = _jsonLookupStep(tls, p+168, uint32(0), z+uintptr(1), uint32(0)) *(*int8)(unsafe.Pointer(z + uintptr(n))) = cSaved if x >= uint32(JSON_LOOKUP_PATHERROR) { @@ -178497,7 +172379,7 @@ func _jsonEachPathLength(tls *libc.TLS, p uintptr) (r int32) { } } } - return int32(n) + return libc.Int32FromUint32(n) } // C documentation @@ -178519,50 +172401,49 @@ func _jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, iColumn int32) (r if (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot == uint32(1) { break } - j = uint32(_jsonEachPathLength(tls, p)) + j = libc.Uint32FromInt32(_jsonEachPathLength(tls, p)) n = (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot - j if n == uint32(0) { break } else { if int32(*(*int8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf + uintptr(j)))) == int32('[') { - _sqlite3Atoi64(tls, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf+uintptr(j+uint32(1)), bp, int32(n-uint32(1)), uint8(SQLITE_UTF8)) + _sqlite3Atoi64(tls, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf+uintptr(j+uint32(1)), bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8)) Xsqlite3_result_int64(tls, ctx, *(*Ti64)(unsafe.Pointer(bp))) } else { if int32(*(*int8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf + uintptr(j+uint32(1))))) == int32('"') { - Xsqlite3_result_text(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf+uintptr(j+uint32(2)), int32(n-uint32(3)), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf+uintptr(j+uint32(2)), libc.Int32FromUint32(n-uint32(3)), uintptr(-libc.Int32FromInt32(1))) } else { - Xsqlite3_result_text(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf+uintptr(j+uint32(1)), int32(n-uint32(1)), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf+uintptr(j+uint32(1)), libc.Int32FromUint32(n-uint32(1)), uintptr(-libc.Int32FromInt32(1))) } } } break } - if int32((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_OBJECT) { + if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_OBJECT) { _jsonReturnFromBlob(tls, p+168, (*TJsonEachCursor)(unsafe.Pointer(p)).Fi, ctx, int32(1)) } else { - _ = libc.Int32FromInt32(0) Xsqlite3_result_int64(tls, ctx, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey) } case int32(JEACH_VALUE): - i = uint32(_jsonSkipLabel(tls, p)) + i = libc.Uint32FromInt32(_jsonSkipLabel(tls, p)) _jsonReturnFromBlob(tls, p+168, i, ctx, int32(1)) - if int32(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i))))&int32(0x0f) >= int32(JSONB_ARRAY) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i))))&int32(0x0f) >= int32(JSONB_ARRAY) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } case int32(JEACH_TYPE): - i1 = uint32(_jsonSkipLabel(tls, p)) - eType = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i1)))) & int32(0x0f)) + i1 = libc.Uint32FromInt32(_jsonSkipLabel(tls, p)) + eType = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i1)))) & int32(0x0f)) Xsqlite3_result_text(tls, ctx, _jsonbType[eType], -int32(1), libc.UintptrFromInt32(0)) case int32(JEACH_ATOM): - i2 = uint32(_jsonSkipLabel(tls, p)) - if int32(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i2))))&int32(0x0f) < int32(JSONB_ARRAY) { + i2 = libc.Uint32FromInt32(_jsonSkipLabel(tls, p)) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i2))))&int32(0x0f) < int32(JSONB_ARRAY) { _jsonReturnFromBlob(tls, p+168, i2, ctx, int32(1)) } case int32(JEACH_ID): - Xsqlite3_result_int64(tls, ctx, int64((*TJsonEachCursor)(unsafe.Pointer(p)).Fi)) + Xsqlite3_result_int64(tls, ctx, libc.Int64FromUint32((*TJsonEachCursor)(unsafe.Pointer(p)).Fi)) case int32(JEACH_PARENT): if (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent > uint32(0) && (*TJsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 { - Xsqlite3_result_int64(tls, ctx, int64((*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiHead)) + Xsqlite3_result_int64(tls, ctx, libc.Int64FromUint32((*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiHead)) } case int32(JEACH_FULLKEY): nBase = (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FnUsed @@ -178572,13 +172453,13 @@ func _jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, iColumn int32) (r Xsqlite3_result_text64(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FnUsed, uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FnUsed = nBase case int32(JEACH_PATH): - n1 = uint32(_jsonEachPathLength(tls, p)) + n1 = libc.Uint32FromInt32(_jsonEachPathLength(tls, p)) Xsqlite3_result_text64(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf, uint64(n1), uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) default: - Xsqlite3_result_text(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf, int32((*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf, libc.Int32FromUint32((*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot), libc.UintptrFromInt32(0)) case int32(JEACH_JSON): if (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson == uintptr(0) { - Xsqlite3_result_blob(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob, int32((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_blob(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob, libc.Int32FromUint32((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob), uintptr(-libc.Int32FromInt32(1))) } else { Xsqlite3_result_text(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson, -int32(1), uintptr(-libc.Int32FromInt32(1))) } @@ -178594,7 +172475,7 @@ func _jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) (r int32) { var p uintptr _ = p p = cur - *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = int64((*TJsonEachCursor)(unsafe.Pointer(p)).FiRowid) + *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = libc.Int64FromUint32((*TJsonEachCursor)(unsafe.Pointer(p)).FiRowid) return SQLITE_OK } @@ -178614,7 +172495,6 @@ func _jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) idxMask = 0 /* This implementation assumes that JSON and ROOT are the last two ** columns in the table */ - _ = libc.Int32FromInt32(0) _ = tab v1 = -libc.Int32FromInt32(1) aIdx[int32(1)] = v1 @@ -178629,12 +172509,11 @@ func _jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) goto _2 } iCol = (*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - int32(JEACH_JSON) - _ = libc.Int32FromInt32(0) iMask = int32(1) << iCol - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fusable) == 0 { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fusable) == 0 { unusableMask |= iMask } else { - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) { aIdx[iCol] = i idxMask |= iMask } @@ -178645,7 +172524,7 @@ func _jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) i++ pConstraint += 12 } - if (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy > 0 && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).FiColumn < 0 && int32((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).Fdesc) == 0 { + if (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy > 0 && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).FiColumn < 0 && libc.Int32FromUint8((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).Fdesc) == 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = int32(1) } if unusableMask & ^idxMask != 0 { @@ -178698,7 +172577,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -178732,7 +172611,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a } return v2 } - (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(_sqlite3Strlen30(tls, zRoot)) + (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zRoot)) if int32(*(*int8)(unsafe.Pointer(zRoot + 1))) == 0 { v3 = libc.Uint32FromInt32(0) (*TJsonEachCursor)(unsafe.Pointer(p)).Fi = v3 @@ -178772,14 +172651,14 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+40, __ccgo_ts+25499, uint32(1)) + _jsonAppendRaw(tls, p+40, __ccgo_ts+25528, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+168, i, bp) (*TJsonEachCursor)(unsafe.Pointer(p)).FiEnd = i + n + *(*Tu32)(unsafe.Pointer(bp)) - if int32(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i))))&int32(0x0f) >= int32(JSONB_ARRAY) && !((*TJsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i))))&int32(0x0f) >= int32(JSONB_ARRAY) && !((*TJsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0) { (*TJsonEachCursor)(unsafe.Pointer(p)).Fi = i + n - (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i)))) & int32(0x0f)) + (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i)))) & int32(0x0f)) (*TJsonEachCursor)(unsafe.Pointer(p)).FaParent = _sqlite3DbMallocZero(tls, (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb, uint64(24)) if (*TJsonEachCursor)(unsafe.Pointer(p)).FaParent == uintptr(0) { return int32(SQLITE_NOMEM) @@ -178796,7 +172675,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25059, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25088, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -178850,193 +172729,193 @@ func init() { // ** Register JSON functions. // */ func _sqlite3RegisterJsonFunctions(tls *libc.TLS) { - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aJsonFunc)), int32(libc.Uint32FromInt64(1360)/libc.Uint32FromInt64(40))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aJsonFunc)), libc.Int32FromUint32(libc.Uint32FromInt64(1360)/libc.Uint32FromInt64(40))) } var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25501, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25530, }, 1: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25506, + FzName: __ccgo_ts + 25535, }, 2: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25512, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25541, }, 3: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25523, + FzName: __ccgo_ts + 25552, }, 4: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25535, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25564, }, 5: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25535, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25564, }, 6: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25553, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25582, }, 7: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25573, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25602, }, 8: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25586, + FzName: __ccgo_ts + 25615, }, 9: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25600, + FzName: __ccgo_ts + 25629, }, 10: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25603, + FzName: __ccgo_ts + 25632, }, 11: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25607, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25636, }, 12: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25619, + FzName: __ccgo_ts + 25648, }, 13: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25632, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25661, }, 14: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25644, + FzName: __ccgo_ts + 25673, }, 15: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25657, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25686, }, 16: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25668, + FzName: __ccgo_ts + 25697, }, 17: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25680, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25709, }, 18: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25680, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25709, }, 19: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25692, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25721, }, 20: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25703, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25732, }, 21: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25715, + FzName: __ccgo_ts + 25744, }, 22: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25728, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25757, }, 23: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25741, + FzName: __ccgo_ts + 25770, }, 24: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25755, + FzName: __ccgo_ts + 25784, }, 25: { FnArg: int8(-int32(1)), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25764, + FzName: __ccgo_ts + 25793, }, 26: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25774, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25803, }, 27: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25774, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25803, }, 28: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25784, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25813, }, 29: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25784, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), + FzName: __ccgo_ts + 25813, }, 30: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25795, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), + FzName: __ccgo_ts + 25824, }, 31: { FnArg: int8(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25812, + FzName: __ccgo_ts + 25841, }, 32: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25830, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), + FzName: __ccgo_ts + 25859, }, 33: { FnArg: int8(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25848, + FzName: __ccgo_ts + 25877, }, } @@ -179119,11 +172998,11 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25867, + FzName: __ccgo_ts + 25896, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25877, + FzName: __ccgo_ts + 25906, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } @@ -179560,11 +173439,10 @@ type RtreeMatchArg1 = TRtreeMatchArg1 // ** 64 bit integer. The deserialized value is returned. // */ func _readInt16(tls *libc.TLS, p uintptr) (r int32) { - return int32(*(*Tu8)(unsafe.Pointer(p)))<<int32(8) + int32(*(*Tu8)(unsafe.Pointer(p + 1))) + return libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p)))<<int32(8) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p + 1))) } func _readCoord(tls *libc.TLS, p uintptr, pCoord uintptr) { - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(pCoord)) = libc.X__builtin_bswap32(tls, *(*Tu32)(unsafe.Pointer(p))) } @@ -179573,7 +173451,7 @@ func _readInt64(tls *libc.TLS, p uintptr) (r Ti64) { defer tls.Free(16) var _ /* x at bp+0 */ Tu64 libc.Xmemcpy(tls, bp, p, uint32(8)) - return int64(libc.X__builtin_bswap64(tls, *(*Tu64)(unsafe.Pointer(bp)))) + return libc.Int64FromUint64(libc.X__builtin_bswap64(tls, *(*Tu64)(unsafe.Pointer(bp)))) } // C documentation @@ -179584,17 +173462,14 @@ func _readInt64(tls *libc.TLS, p uintptr) (r Ti64) { // ** to the argument buffer (always 2, 4 and 8 respectively). // */ func _writeInt16(tls *libc.TLS, p uintptr, i int32) { - *(*Tu8)(unsafe.Pointer(p)) = uint8(i >> int32(8) & int32(0xFF)) - *(*Tu8)(unsafe.Pointer(p + 1)) = uint8(i >> 0 & int32(0xFF)) + *(*Tu8)(unsafe.Pointer(p)) = libc.Uint8FromInt32(i >> int32(8) & int32(0xFF)) + *(*Tu8)(unsafe.Pointer(p + 1)) = libc.Uint8FromInt32(i >> 0 & int32(0xFF)) } func _writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ Tu32 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*Tu32)(unsafe.Pointer(bp)) = libc.X__builtin_bswap32(tls, *(*Tu32)(unsafe.Pointer(pCoord))) libc.Xmemcpy(tls, p, bp, uint32(4)) return int32(4) @@ -179604,7 +173479,7 @@ func _writeInt64(tls *libc.TLS, p uintptr, _i Ti64) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*Ti64)(unsafe.Pointer(bp)) = _i - *(*Ti64)(unsafe.Pointer(bp)) = int64(libc.X__builtin_bswap64(tls, uint64(*(*Ti64)(unsafe.Pointer(bp))))) + *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp))))) libc.Xmemcpy(tls, p, bp, uint32(8)) return int32(8) } @@ -179616,7 +173491,6 @@ func _writeInt64(tls *libc.TLS, p uintptr, _i Ti64) (r int32) { // */ func _nodeReference(tls *libc.TLS, p uintptr) { if p != 0 { - _ = libc.Int32FromInt32(0) (*TRtreeNode)(unsafe.Pointer(p)).FnRef++ } } @@ -179627,7 +173501,7 @@ func _nodeReference(tls *libc.TLS, p uintptr) { // ** Clear the content of node p (set all bytes to 0x00). // */ func _nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { - libc.Xmemset(tls, (*TRtreeNode)(unsafe.Pointer(p)).FzData+2, 0, uint32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(2))) + libc.Xmemset(tls, (*TRtreeNode)(unsafe.Pointer(p)).FzData+2, 0, libc.Uint32FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(2))) (*TRtreeNode)(unsafe.Pointer(p)).FisDirty = int32(1) } @@ -179638,7 +173512,7 @@ func _nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { // ** in the Rtree.aHash table. // */ func _nodeHash(tls *libc.TLS, iNode Ti64) (r uint32) { - return uint32(iNode) % uint32(HASHSIZE) + return libc.Uint32FromInt64(iNode) % uint32(HASHSIZE) } // C documentation @@ -179671,8 +173545,7 @@ func _nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode Ti64) (r uintptr) { func _nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { var iHash int32 _ = iHash - _ = libc.Int32FromInt32(0) - iHash = int32(_nodeHash(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FiNode)) + iHash = libc.Int32FromUint32(_nodeHash(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FiNode)) (*TRtreeNode)(unsafe.Pointer(pNode)).FpNext = *(*uintptr)(unsafe.Pointer(pRtree + 112 + uintptr(iHash)*4)) *(*uintptr)(unsafe.Pointer(pRtree + 112 + uintptr(iHash)*4)) = pNode } @@ -179691,7 +173564,6 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { if !(*(*uintptr)(unsafe.Pointer(pp)) != pNode) { break } - _ = libc.Int32FromInt32(0) goto _1 _1: ; @@ -179713,9 +173585,9 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(uint32(28)+uint32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) + pNode = Xsqlite3_malloc64(tls, uint64(uint32(28)+libc.Uint32FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { - libc.Xmemset(tls, pNode, 0, uint32(28)+uint32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + libc.Xmemset(tls, pNode, 0, uint32(28)+libc.Uint32FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*28 (*TRtreeNode)(unsafe.Pointer(pNode)).FnRef = int32(1) (*TRtree)(unsafe.Pointer(pRtree)).FnNodeRef++ @@ -179776,7 +173648,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+25887, iNode, 0, pRtree+72) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+25916, iNode, 0, pRtree+72) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -179787,7 +173659,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(uint32(28)+uint32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) + pNode = Xsqlite3_malloc64(tls, uint64(uint32(28)+libc.Uint32FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -179819,7 +173691,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp ** SQLITE_CORRUPT_VTAB. */ if pNode != 0 && rc == SQLITE_OK { - if _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) > ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(4))/int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) { + if _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) > ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(4))/libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } } @@ -179851,11 +173723,11 @@ func _nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uint var ii int32 var p uintptr _, _ = ii, p - p = (*TRtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(int32(4)+int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell) + p = (*TRtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(int32(4)+libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell) p += uintptr(_writeInt64(tls, p, (*TRtreeCell)(unsafe.Pointer(pCell)).FiRowid)) ii = 0 for { - if !(ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)) { + if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)) { break } p += uintptr(_writeCoord(tls, p, pCell+8+uintptr(ii)*4)) @@ -179876,10 +173748,10 @@ func _nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) var nByte int32 var pDst, pSrc uintptr _, _, _ = nByte, pDst, pSrc - pDst = (*TRtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(int32(4)+int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell) + pDst = (*TRtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(int32(4)+libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell) pSrc = pDst + uintptr((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) - nByte = (_readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) - iCell - int32(1)) * int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) - libc.Xmemmove(tls, pDst, pSrc, uint32(nByte)) + nByte = (_readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) - iCell - int32(1)) * libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) + libc.Xmemmove(tls, pDst, pSrc, libc.Uint32FromInt32(nByte)) _writeInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2, _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2)-int32(1)) (*TRtreeNode)(unsafe.Pointer(pNode)).FisDirty = int32(1) } @@ -179895,9 +173767,8 @@ func _nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) func _nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) (r int32) { var nCell, nMaxCell int32 _, _ = nCell, nMaxCell /* Maximum number of cells for pNode */ - nMaxCell = ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize - int32(4)) / int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) + nMaxCell = ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize - int32(4)) / libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) nCell = _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) - _ = libc.Int32FromInt32(0) if nCell < nMaxCell { _nodeOverwriteCell(tls, pRtree, pNode, pCell, nCell) _writeInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2, nCell+int32(1)) @@ -179947,8 +173818,6 @@ func _nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) (r int32) { _ = rc rc = SQLITE_OK if pNode != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TRtreeNode)(unsafe.Pointer(pNode)).FnRef-- if (*TRtreeNode)(unsafe.Pointer(pNode)).FnRef == 0 { (*TRtree)(unsafe.Pointer(pRtree)).FnNodeRef-- @@ -179976,8 +173845,7 @@ func _nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) (r int32) { // ** an internal node, then the 64-bit integer is a child page number. // */ func _nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) (r Ti64) { - _ = libc.Int32FromInt32(0) - return _readInt64(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+uintptr(int32(4)+int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell)) + return _readInt64(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+uintptr(int32(4)+libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell)) } // C documentation @@ -179986,8 +173854,7 @@ func _nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) (r // ** Return coordinate iCoord from cell iCell in node pNode. // */ func _nodeGetCoord(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iCoord int32, pCoord uintptr) { - _ = libc.Int32FromInt32(0) - _readCoord(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+uintptr(int32(12)+int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell+int32(4)*iCoord), pCoord) + _readCoord(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+uintptr(int32(12)+libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell+int32(4)*iCoord), pCoord) } // C documentation @@ -180002,9 +173869,9 @@ func _nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCe _, _, _ = ii, pCoord, pData ii = 0 (*TRtreeCell)(unsafe.Pointer(pCell)).FiRowid = _nodeGetRowid(tls, pRtree, pNode, iCell) - pData = (*TRtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(libc.Int32FromInt32(12)+int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell) + pData = (*TRtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(libc.Int32FromInt32(12)+libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell) pCoord = pCell + 8 - for cond := true; cond; cond = ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { + for cond := true; cond; cond = ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { _readCoord(tls, pData, pCoord+uintptr(ii)*4) _readCoord(tls, pData+uintptr(4), pCoord+uintptr(ii+int32(1))*4) pData += uintptr(8) @@ -180049,9 +173916,7 @@ func _rtreeRelease(tls *libc.TLS, pRtree uintptr) { (*TRtree)(unsafe.Pointer(pRtree)).FnBusy-- if (*TRtree)(unsafe.Pointer(pRtree)).FnBusy == uint32(0) { (*TRtree)(unsafe.Pointer(pRtree)).FinWrTrans = uint8(0) - _ = libc.Int32FromInt32(0) _nodeBlobReset(tls, pRtree) - _ = libc.Int32FromInt32(0) Xsqlite3_finalize(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpWriteNode) Xsqlite3_finalize(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpDeleteNode) Xsqlite3_finalize(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpReadRowid) @@ -180088,7 +173953,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+25892, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+25921, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -180183,12 +174048,11 @@ func _rtreeClose(tls *libc.TLS, cur uintptr) (r int32) { _, _ = pCsr, pRtree pRtree = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab pCsr = cur - _ = libc.Int32FromInt32(0) _resetCursor(tls, pCsr) Xsqlite3_finalize(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux) Xsqlite3_free(tls, pCsr) (*TRtree)(unsafe.Pointer(pRtree)).FnCursor-- - if (*TRtree)(unsafe.Pointer(pRtree)).FnCursor == uint32(0) && int32((*TRtree)(unsafe.Pointer(pRtree)).FinWrTrans) == 0 { + if (*TRtree)(unsafe.Pointer(pRtree)).FnCursor == uint32(0) && libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FinWrTrans) == 0 { _nodeBlobReset(tls, pRtree) } return SQLITE_OK @@ -180206,7 +174070,7 @@ func _rtreeEof(tls *libc.TLS, cur uintptr) (r int32) { var pCsr uintptr _ = pCsr pCsr = cur - return int32((*TRtreeCursor)(unsafe.Pointer(pCsr)).FatEOF) + return libc.Int32FromUint8((*TRtreeCursor)(unsafe.Pointer(pCsr)).FatEOF) } /* @@ -180239,9 +174103,7 @@ func _rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pC _, _, _, _, _ = nCoord, pInfo, rc, v1, v2 pInfo = (*TRtreeConstraint)(unsafe.Pointer(pConstraint)).FpInfo /* Callback info */ nCoord = (*Tsqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FnCoord /* Decoded coordinates */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TRtreeConstraint)(unsafe.Pointer(pConstraint)).Fop == int32(RTREE_QUERY) && int32((*TRtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) == int32(1) { + if (*TRtreeConstraint)(unsafe.Pointer(pConstraint)).Fop == int32(RTREE_QUERY) && libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) == int32(1) { (*Tsqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiRowid = _readInt64(tls, pCellData) } pCellData += uintptr(8) @@ -180319,11 +174181,11 @@ func _rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pC *(*Tsqlite3_rtree_dbl)(unsafe.Pointer(prScore)) = float64(0) } else { (*Tsqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FaCoord = bp + 4 - (*Tsqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiLevel = int32((*TRtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) - int32(1) + (*Tsqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiLevel = libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) - int32(1) v1 = (*TRtreeSearchPoint)(unsafe.Pointer(pSearch)).FrScore (*Tsqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrParentScore = v1 (*Tsqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore = v1 - v2 = int32((*TRtreeSearchPoint)(unsafe.Pointer(pSearch)).FeWithin) + v2 = libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(pSearch)).FeWithin) (*Tsqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeParentWithin = v2 (*Tsqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin = v2 rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*TRtreeConstraint)(unsafe.Pointer(pConstraint)).Fu))})))(tls, pInfo) @@ -180357,8 +174219,6 @@ func _rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uin ** in a coordinate pair. But make pCellData point to the lower bound. */ pCellData += uintptr(int32(8) + int32(4)*((*TRtreeConstraint)(unsafe.Pointer(p)).FiCoord&int32(0xfe))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) switch (*TRtreeConstraint)(unsafe.Pointer(p)).Fop { case int32(RTREE_TRUE): return /* Always satisfied */ @@ -180437,10 +174297,9 @@ func _rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintpt var v1 Tsqlite3_rtree_dbl var _ /* c at bp+0 */ TRtreeCoord _, _ = xN, v1 /* Coordinate value converted to a double */ - _ = libc.Int32FromInt32(0) pCellData += uintptr(int32(8) + (*TRtreeConstraint)(unsafe.Pointer(p)).FiCoord*int32(4)) - _ = libc.Int32FromInt32(0) - /* Coordinate decoded */ *(*Tu32)(unsafe.Pointer(bp)) = libc.X__builtin_bswap32(tls, *(*Tu32)(unsafe.Pointer(pCellData))) + /* Coordinate decoded */ + *(*Tu32)(unsafe.Pointer(bp)) = libc.X__builtin_bswap32(tls, *(*Tu32)(unsafe.Pointer(pCellData))) if eInt != 0 { v1 = float64(*(*int32)(unsafe.Pointer(bp))) } else { @@ -180486,7 +174345,6 @@ func _nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid Ti64, var ii, nCell int32 _, _ = ii, nCell nCell = _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) - _ = libc.Int32FromInt32(0) ii = 0 for { if !(ii < nCell) { @@ -180542,10 +174400,10 @@ func _rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) (r int32) { if (*TRtreeSearchPoint)(unsafe.Pointer(pA)).FrScore > (*TRtreeSearchPoint)(unsafe.Pointer(pB)).FrScore { return +libc.Int32FromInt32(1) } - if int32((*TRtreeSearchPoint)(unsafe.Pointer(pA)).FiLevel) < int32((*TRtreeSearchPoint)(unsafe.Pointer(pB)).FiLevel) { + if libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(pA)).FiLevel) < libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(pB)).FiLevel) { return -int32(1) } - if int32((*TRtreeSearchPoint)(unsafe.Pointer(pA)).FiLevel) > int32((*TRtreeSearchPoint)(unsafe.Pointer(pB)).FiLevel) { + if libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(pA)).FiLevel) > libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(pB)).FiLevel) { return +libc.Int32FromInt32(1) } return 0 @@ -180561,7 +174419,6 @@ func _rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { var t TRtreeSearchPoint _, _ = pTemp, t t = *(*TRtreeSearchPoint)(unsafe.Pointer((*TRtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*20)) - _ = libc.Int32FromInt32(0) *(*TRtreeSearchPoint)(unsafe.Pointer((*TRtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*20)) = *(*TRtreeSearchPoint)(unsafe.Pointer((*TRtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(j)*20)) *(*TRtreeSearchPoint)(unsafe.Pointer((*TRtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(j)*20)) = t i++ @@ -180609,11 +174466,8 @@ func _rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) (r u var ii int32 var v1 int64 _, _, _ = id, ii, v1 - ii = int32(1) - int32((*TRtreeCursor)(unsafe.Pointer(pCur)).FbPoint) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + ii = int32(1) - libc.Int32FromUint8((*TRtreeCursor)(unsafe.Pointer(pCur)).FbPoint) if *(*uintptr)(unsafe.Pointer(pCur + 60 + uintptr(ii)*4)) == uintptr(0) { - _ = libc.Int32FromInt32(0) if ii != 0 { v1 = (*(*TRtreeSearchPoint)(unsafe.Pointer((*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint))).Fid } else { @@ -180636,7 +174490,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(uint32(nNew)*uint32(20))) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint32FromInt32(nNew)*uint32(20))) if pNew == uintptr(0) { return uintptr(0) } @@ -180650,7 +174504,6 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) pNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(i)*20 (*TRtreeSearchPoint)(unsafe.Pointer(pNew)).FrScore = rScore (*TRtreeSearchPoint)(unsafe.Pointer(pNew)).FiLevel = iLevel - _ = libc.Int32FromInt32(0) for i > 0 { j = (i - int32(1)) / int32(2) pParent = (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(j)*20 @@ -180676,16 +174529,14 @@ func _rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLev _, _, _ = ii, pFirst, pNew pFirst = _rtreeSearchPointFirst(tls, pCur) *(*Tu32)(unsafe.Pointer(pCur + 80 + uintptr(iLevel)*4))++ - if pFirst == uintptr(0) || (*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore > rScore || (*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore == rScore && int32((*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FiLevel) > int32(iLevel) { + if pFirst == uintptr(0) || (*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore > rScore || (*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore == rScore && libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FiLevel) > libc.Int32FromUint8(iLevel) { if (*TRtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 { pNew = _rtreeEnqueue(tls, pCur, rScore, iLevel) if pNew == uintptr(0) { return uintptr(0) } ii = (int32(pNew)-int32((*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint))/20 + int32(1) - _ = libc.Int32FromInt32(0) if ii < int32(RTREE_CACHE_SZ) { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pCur + 60 + uintptr(ii)*4)) = *(*uintptr)(unsafe.Pointer(pCur + 60)) } else { _nodeRelease(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer(pCur + 60))) @@ -180711,8 +174562,7 @@ func _rtreeSearchPointPop(tls *libc.TLS, p uintptr) { var i, j, k, n, v1, v3 int32 var v2 uintptr _, _, _, _, _, _, _ = i, j, k, n, v1, v2, v3 - i = int32(1) - int32((*TRtreeCursor)(unsafe.Pointer(p)).FbPoint) - _ = libc.Int32FromInt32(0) + i = int32(1) - libc.Int32FromUint8((*TRtreeCursor)(unsafe.Pointer(p)).FbPoint) if *(*uintptr)(unsafe.Pointer(p + 60 + uintptr(i)*4)) != 0 { _nodeRelease(tls, (*TRtreeCursor)(unsafe.Pointer(p)).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer(p + 60 + uintptr(i)*4))) *(*uintptr)(unsafe.Pointer(p + 60 + uintptr(i)*4)) = uintptr(0) @@ -180781,11 +174631,11 @@ func _rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) (r int32) { pRtree = (*TRtreeCursor)(unsafe.Pointer(pCur)).Fbase.FpVtab *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK nConstraint = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnConstraint - eInt = libc.BoolInt32(int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == int32(RTREE_COORD_INT32)) + eInt = libc.BoolInt32(libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == int32(RTREE_COORD_INT32)) for { v1 = _rtreeSearchPointFirst(tls, pCur) p = v1 - if !(v1 != uintptr(0) && int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) > 0) { + if !(v1 != uintptr(0) && libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) > 0) { break } pNode = _rtreeNodeOfFirstSearchPoint(tls, pCur, bp+4) @@ -180793,9 +174643,8 @@ func _rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) (r int32) { return *(*int32)(unsafe.Pointer(bp + 4)) } nCell = _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) - _ = libc.Int32FromInt32(0) - pCellData = (*TRtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(libc.Int32FromInt32(4)+int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell)) - for int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) < nCell { + pCellData = (*TRtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(libc.Int32FromInt32(4)+libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell)) + for libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) < nCell { *(*Tsqlite3_rtree_dbl)(unsafe.Pointer(bp + 8)) = float64(-libc.Int32FromInt32(1)) *(*int32)(unsafe.Pointer(bp)) = int32(FULLY_WITHIN) ii = 0 @@ -180810,7 +174659,7 @@ func _rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) (r int32) { return *(*int32)(unsafe.Pointer(bp + 4)) } } else { - if int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) == int32(1) { + if libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) == int32(1) { _rtreeLeafConstraint(tls, pConstraint, eInt, pCellData, bp) } else { _rtreeNonleafConstraint(tls, pConstraint, eInt, pCellData, bp) @@ -180830,7 +174679,7 @@ func _rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) (r int32) { continue } (*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell++ - x.FiLevel = uint8(int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) - int32(1)) + x.FiLevel = libc.Uint8FromInt32(libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) - int32(1)) if x.FiLevel != 0 { x.Fid = _readInt64(tls, pCellData) ii = 0 @@ -180849,9 +174698,9 @@ func _rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) (r int32) { x.FiCell = uint8(0) } else { x.Fid = (*TRtreeSearchPoint)(unsafe.Pointer(p)).Fid - x.FiCell = uint8(int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) - int32(1)) + x.FiCell = libc.Uint8FromInt32(libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) - int32(1)) } - if int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= nCell { + if libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= nCell { _rtreeSearchPointPop(tls, pCur) } if *(*Tsqlite3_rtree_dbl)(unsafe.Pointer(bp + 8)) < float64(0) { @@ -180861,12 +174710,12 @@ func _rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) (r int32) { if p == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TRtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = uint8(*(*int32)(unsafe.Pointer(bp))) + (*TRtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp))) (*TRtreeSearchPoint)(unsafe.Pointer(p)).Fid = x.Fid (*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell = x.FiCell break } - if int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= nCell { + if libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= nCell { _rtreeSearchPointPop(tls, pCur) } } @@ -180911,10 +174760,10 @@ func _rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK pNode = _rtreeNodeOfFirstSearchPoint(tls, pCsr, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && p != 0 { - if int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) { + if libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ABORT) } else { - *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = _nodeGetRowid(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, pNode, int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell)) + *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = _nodeGetRowid(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, pNode, libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell)) } } return *(*int32)(unsafe.Pointer(bp)) @@ -180943,18 +174792,17 @@ func _rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) (r int32) { if p == uintptr(0) { return SQLITE_OK } - if int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) { + if libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) { return int32(SQLITE_ABORT) } if i == 0 { - Xsqlite3_result_int64(tls, ctx, _nodeGetRowid(tls, pRtree, pNode, int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell))) + Xsqlite3_result_int64(tls, ctx, _nodeGetRowid(tls, pRtree, pNode, libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell))) } else { - if i <= int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { - _nodeGetCoord(tls, pRtree, pNode, int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell), i-int32(1), bp) - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if i <= libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { + _nodeGetCoord(tls, pRtree, pNode, libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell), i-int32(1), bp) + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { Xsqlite3_result_double(tls, ctx, float64(*(*TRtreeValue)(unsafe.Pointer(bp)))) } else { - _ = libc.Int32FromInt32(0) Xsqlite3_result_int(tls, ctx, *(*int32)(unsafe.Pointer(bp))) } } else { @@ -180965,7 +174813,7 @@ func _rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) (r int32) { return *(*int32)(unsafe.Pointer(bp + 4)) } } - Xsqlite3_bind_int64(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, int32(1), _nodeGetRowid(tls, pRtree, pNode, int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell))) + Xsqlite3_bind_int64(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, int32(1), _nodeGetRowid(tls, pRtree, pNode, libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell))) *(*int32)(unsafe.Pointer(bp + 4)) = Xsqlite3_step(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux) if *(*int32)(unsafe.Pointer(bp + 4)) == int32(SQLITE_ROW) { (*TRtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = uint8(1) @@ -180977,7 +174825,7 @@ func _rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) (r int32) { return *(*int32)(unsafe.Pointer(bp + 4)) } } - Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, i-int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)+int32(1))) + Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, i-libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)+int32(1))) } } return SQLITE_OK @@ -181022,7 +174870,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+25974) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26003) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -181085,12 +174933,12 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp } if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0) { p = _rtreeSearchPointNew(tls, pCsr, float64(0), uint8(0)) - _ = libc.Int32FromInt32(0) /* Always returns pCsr->sPoint */ + /* Always returns pCsr->sPoint */ *(*uintptr)(unsafe.Pointer(pCsr + 60)) = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TRtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*Ti64)(unsafe.Pointer(bp + 16)) (*TRtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = uint8(PARTLY_WITHIN) rc = _nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 8)), iRowid, bp+4) - (*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell = uint8(*(*int32)(unsafe.Pointer(bp + 4))) + (*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) } else { (*TRtreeCursor)(unsafe.Pointer(pCsr)).FatEOF = uint8(1) } @@ -181100,14 +174948,13 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint32(20)*uint32(argc))) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint32(20)*libc.Uint32FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, uint32(20)*uint32(argc)) - libc.Xmemset(tls, pCsr+80, 0, uint32(4)*uint32((*TRtree)(unsafe.Pointer(pRtree)).FiDepth+libc.Int32FromInt32(1))) - _ = libc.Int32FromInt32(0) + libc.Xmemset(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, uint32(20)*libc.Uint32FromInt32(argc)) + libc.Xmemset(tls, pCsr+80, 0, uint32(4)*libc.Uint32FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiDepth+libc.Int32FromInt32(1))) ii = 0 for { if !(ii < argc) { @@ -181126,7 +174973,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp if rc != SQLITE_OK { break } - (*Tsqlite3_rtree_query_info)(unsafe.Pointer((*TRtreeConstraint)(unsafe.Pointer(p1)).FpInfo)).FnCoord = int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) + (*Tsqlite3_rtree_query_info)(unsafe.Pointer((*TRtreeConstraint)(unsafe.Pointer(p1)).FpInfo)).FnCoord = libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) (*Tsqlite3_rtree_query_info)(unsafe.Pointer((*TRtreeConstraint)(unsafe.Pointer(p1)).FpInfo)).FanQueue = pCsr + 80 (*Tsqlite3_rtree_query_info)(unsafe.Pointer((*TRtreeConstraint)(unsafe.Pointer(p1)).FpInfo)).FmxLevel = (*TRtree)(unsafe.Pointer(pRtree)).FiDepth + int32(1) } else { @@ -181166,15 +175013,14 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp } } if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) /* Due to the resetCursor() call above */ - pNew = _rtreeSearchPointNew(tls, pCsr, float64(0), uint8((*TRtree)(unsafe.Pointer(pRtree)).FiDepth+libc.Int32FromInt32(1))) + /* Due to the resetCursor() call above */ + pNew = _rtreeSearchPointNew(tls, pCsr, float64(0), libc.Uint8FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiDepth+libc.Int32FromInt32(1))) if pNew == uintptr(0) { /* Because pCsr->bPoint was FALSE */ return int32(SQLITE_NOMEM) } (*TRtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*TRtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = uint8(0) (*TRtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = uint8(PARTLY_WITHIN) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pCsr + 60)) = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _rtreeStepToLeaf(tls, pCsr) @@ -181244,7 +175090,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { if !(ii < (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) { break } - if int32((*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12))).Fop) == int32(SQLITE_INDEX_CONSTRAINT_MATCH) { + if libc.Int32FromUint8((*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12))).Fop) == int32(SQLITE_INDEX_CONSTRAINT_MATCH) { bMatch = int32(1) } goto _1 @@ -181252,14 +175098,13 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { ; ii++ } - _ = libc.Int32FromInt32(0) ii = 0 for { - if !(ii < (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint && iIdx < int32(libc.Uint32FromInt64(41)-libc.Uint32FromInt32(1))) { + if !(ii < (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint && iIdx < libc.Int32FromUint32(libc.Uint32FromInt64(41)-libc.Uint32FromInt32(1))) { break } p = (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12 - if bMatch == 0 && (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 && (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= 0 && int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) { + if bMatch == 0 && (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 && (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= 0 && libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) { jj = 0 for { if !(jj < ii) { @@ -181286,9 +175131,9 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = int32(SQLITE_INDEX_SCAN_UNIQUE) return SQLITE_OK } - if (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 && ((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn > 0 && (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) || int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_MATCH)) { + if (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 && ((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn > 0 && (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_MATCH)) { doOmit = uint8(1) - switch int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) { + switch libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) { case int32(SQLITE_INDEX_CONSTRAINT_EQ): op = uint8(RTREE_EQ) doOmit = uint8(0) @@ -181311,7 +175156,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { if op != 0 { v4 = iIdx iIdx++ - (*(*[41]int8)(unsafe.Pointer(bp)))[v4] = int8(op) + (*(*[41]int8)(unsafe.Pointer(bp)))[v4] = libc.Int8FromUint8(op) v5 = iIdx iIdx++ (*(*[41]int8)(unsafe.Pointer(bp)))[v5] = int8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn - libc.Int32FromInt32(1) + libc.Int32FromUint8('0')) @@ -181331,7 +175176,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { if (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr == uintptr(0) { return int32(SQLITE_NOMEM) } - libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, uint32(iIdx+int32(1))) + libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint32FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) @@ -181348,9 +175193,8 @@ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue _ = area area = libc.Float64FromInt32(1) - _ = libc.Int32FromInt32(0) - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { - switch int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim) { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + switch libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim) { case int32(5): area = float64(*(*TRtreeValue)(unsafe.Pointer(p + 8 + 9*4)) - *(*TRtreeValue)(unsafe.Pointer(p + 8 + 8*4))) fallthrough @@ -181367,7 +175211,7 @@ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { area *= float64(*(*TRtreeValue)(unsafe.Pointer(p + 8 + 1*4)) - *(*TRtreeValue)(unsafe.Pointer(p + 8))) } } else { - switch int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim) { + switch libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim) { case int32(5): area = float64(int64(*(*int32)(unsafe.Pointer(p + 8 + 9*4))) - int64(*(*int32)(unsafe.Pointer(p + 8 + 8*4)))) fallthrough @@ -181399,14 +175243,14 @@ func _cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var v1, v2 float64 _, _, _, _ = ii, margin, v1, v2 margin = libc.Float64FromInt32(0) - ii = int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) - int32(2) + ii = libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) - int32(2) for cond := true; cond; cond = ii >= 0 { - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v1 = float64(*(*TRtreeValue)(unsafe.Pointer(p + 8 + uintptr(ii+int32(1))*4))) } else { v1 = float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(ii+int32(1))*4))) } - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v2 = float64(*(*TRtreeValue)(unsafe.Pointer(p + 8 + uintptr(ii)*4))) } else { v2 = float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(ii)*4))) @@ -181427,8 +175271,8 @@ func _cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { var v1, v2 TRtreeValue _, _, _, _, _ = ii, v1, v2, v3, v4 ii = 0 - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { - for cond := true; cond; cond = ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + for cond := true; cond; cond = ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { if *(*TRtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) < *(*TRtreeValue)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4)) { v1 = *(*TRtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) } else { @@ -181444,7 +175288,7 @@ func _cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { ii += int32(2) } } else { - for cond := true; cond; cond = ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { + for cond := true; cond; cond = ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { if *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) < *(*int32)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4)) { v3 = *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) } else { @@ -181472,10 +175316,10 @@ func _cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) (r int var a1, a11, a2, a21 uintptr var ii int32 _, _, _, _, _ = a1, a11, a2, a21, ii - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == int32(RTREE_COORD_INT32) { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == int32(RTREE_COORD_INT32) { ii = 0 for { - if !(ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)) { + if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)) { break } a1 = p1 + 8 + uintptr(ii)*4 @@ -181491,7 +175335,7 @@ func _cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) (r int } else { ii = 0 for { - if !(ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)) { + if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)) { break } a11 = p1 + 8 + uintptr(ii)*4 @@ -181522,28 +175366,28 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(1) jj = 0 for { - if !(jj < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)) { + if !(jj < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)) { break } - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v4 = float64(*(*TRtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj)*4))) } else { v4 = float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj)*4))) } - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v5 = float64(*(*TRtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4))) } else { v5 = float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4))) } if v4 > v5 { - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v6 = float64(*(*TRtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj)*4))) } else { v6 = float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj)*4))) } v3 = v6 } else { - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v7 = float64(*(*TRtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4))) } else { v7 = float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4))) @@ -181551,25 +175395,25 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell v3 = v7 } x1 = v3 - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v9 = float64(*(*TRtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj+int32(1))*4))) } else { v9 = float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj+int32(1))*4))) } - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v10 = float64(*(*TRtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+int32(1))*4))) } else { v10 = float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+int32(1))*4))) } if v9 < v10 { - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v11 = float64(*(*TRtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj+int32(1))*4))) } else { v11 = float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj+int32(1))*4))) } v8 = v11 } else { - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v12 = float64(*(*TRtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+int32(1))*4))) } else { v12 = float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+int32(1))*4))) @@ -181776,28 +175620,28 @@ func _SortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, i aRight = aIdx + uintptr(nLeft)*4 _SortByDimension(tls, pRtree, aLeft, nLeft, iDim, aCell, aSpare) _SortByDimension(tls, pRtree, aRight, nRight, iDim, aCell, aSpare) - libc.Xmemcpy(tls, aSpare, aLeft, uint32(4)*uint32(nLeft)) + libc.Xmemcpy(tls, aSpare, aLeft, uint32(4)*libc.Uint32FromInt32(nLeft)) aLeft = aSpare for iLeft < nLeft || iRight < nRight { - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v1 = float64(*(*TRtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*int32(2))*4))) } else { v1 = float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*int32(2))*4))) } xleft1 = v1 - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v2 = float64(*(*TRtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*int32(2)+int32(1))*4))) } else { v2 = float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*int32(2)+int32(1))*4))) } xleft2 = v2 - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v3 = float64(*(*TRtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*int32(2))*4))) } else { v3 = float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*int32(2))*4))) } xright1 = v3 - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { v4 = float64(*(*TRtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*int32(2)+int32(1))*4))) } else { v4 = float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*int32(2)+int32(1))*4))) @@ -181832,16 +175676,16 @@ func _splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int3 iBestDim = 0 iBestSplit = 0 fBestMargin = float64(0) - nByte = int64(uint32(int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim)+libc.Int32FromInt32(1)) * (uint32(4) + uint32(nCell)*uint32(4))) - aaSorted = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt32(libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim)+libc.Int32FromInt32(1)) * (uint32(4) + libc.Uint32FromInt32(nCell)*uint32(4))) + aaSorted = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if !(aaSorted != 0) { return int32(SQLITE_NOMEM) } - aSpare = aaSorted + uintptr((*TRtree)(unsafe.Pointer(pRtree)).FnDim)*4 + uintptr(int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim)*nCell)*4 - libc.Xmemset(tls, aaSorted, 0, uint32(nByte)) + aSpare = aaSorted + uintptr((*TRtree)(unsafe.Pointer(pRtree)).FnDim)*4 + uintptr(libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim)*nCell)*4 + libc.Xmemset(tls, aaSorted, 0, libc.Uint32FromInt64(nByte)) ii = 0 for { - if !(ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim)) { + if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim)) { break } *(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) = aaSorted + uintptr((*TRtree)(unsafe.Pointer(pRtree)).FnDim)*4 + uintptr(ii*nCell)*4 @@ -181864,16 +175708,16 @@ func _splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int3 } ii = 0 for { - if !(ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim)) { + if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim)) { break } margin = float64(0) fBestOverlap = float64(0) fBestArea = float64(0) iBestLeft = 0 - nLeft = ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize - int32(4)) / int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) / int32(3) + nLeft = ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize - int32(4)) / libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) / int32(3) for { - if !(nLeft <= nCell-((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(4))/int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/int32(3)) { + if !(nLeft <= nCell-((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(4))/libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/int32(3)) { break } libc.Xmemcpy(tls, bp, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)))))*48, uint32(48)) @@ -181897,7 +175741,7 @@ func _splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int3 margin += _cellMargin(tls, pRtree, bp+48) overlap = _cellOverlap(tls, pRtree, bp, bp+48, int32(1)) area = _cellArea(tls, pRtree, bp) + _cellArea(tls, pRtree, bp+48) - if nLeft == ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(4))/int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/int32(3) || overlap < fBestOverlap || overlap == fBestOverlap && area < fBestArea { + if nLeft == ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(4))/libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/int32(3) || overlap < fBestOverlap || overlap == fBestOverlap && area < fBestArea { iBestLeft = nLeft fBestOverlap = overlap fBestArea = area @@ -182003,13 +175847,13 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint32FromInt64(48)+libc.Uint32FromInt64(4))*uint32(nCell+libc.Int32FromInt32(1)))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint32FromInt64(48)+libc.Uint32FromInt64(4))*libc.Uint32FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out } aiUsed = aCell + uintptr(nCell+int32(1))*48 - libc.Xmemset(tls, aiUsed, 0, uint32(4)*uint32(nCell+libc.Int32FromInt32(1))) + libc.Xmemset(tls, aiUsed, 0, uint32(4)*libc.Uint32FromInt32(nCell+libc.Int32FromInt32(1))) i = 0 for { if !(i < nCell) { @@ -182039,8 +175883,8 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = int32(SQLITE_NOMEM) goto splitnode_out } - libc.Xmemset(tls, (*TRtreeNode)(unsafe.Pointer(pLeft)).FzData, 0, uint32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) - libc.Xmemset(tls, (*TRtreeNode)(unsafe.Pointer(pRight)).FzData, 0, uint32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + libc.Xmemset(tls, (*TRtreeNode)(unsafe.Pointer(pLeft)).FzData, 0, libc.Uint32FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + libc.Xmemset(tls, (*TRtreeNode)(unsafe.Pointer(pRight)).FzData, 0, libc.Uint32FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) rc = _splitNodeStartree(tls, pRtree, aCell, nCell, pLeft, pRight, bp, bp+48) if rc != SQLITE_OK { goto splitnode_out @@ -182074,7 +175918,6 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe if rc == SQLITE_OK { _nodeOverwriteCell(tls, pRtree, pParent, bp, *(*int32)(unsafe.Pointer(bp + 96))) rc = _AdjustTree(tls, pRtree, pParent, bp) - _ = libc.Int32FromInt32(0) } if rc != SQLITE_OK { goto splitnode_out @@ -182206,7 +176049,6 @@ func _removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) (r var _ /* iCell at bp+0 */ int32 _, _, _, _, _ = pParent, rc, rc2, v1, v2 pParent = uintptr(0) - _ = libc.Int32FromInt32(0) /* Remove the entry in the parent cell. */ rc = _nodeParentIndex(tls, pRtree, pNode, bp) if rc == SQLITE_OK { @@ -182309,9 +176151,8 @@ func _deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHei ** node. */ pParent = (*TRtreeNode)(unsafe.Pointer(pNode)).FpParent - _ = libc.Int32FromInt32(0) if pParent != 0 { - if _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) < ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(4))/int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/int32(3) { + if _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) < ((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize-int32(4))/libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/int32(3) { rc = _removeNode(tls, pRtree, pNode, iHeight) } else { rc = _fixBoundingBox(tls, pRtree, pNode) @@ -182429,7 +176270,6 @@ func _rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Tsqlite3_int64) (r if rc == SQLITE_OK { rc = _findLeafNode(tls, pRtree, iDelete, bp, uintptr(0)) } - _ = libc.Int32FromInt32(0) /* Delete the cell in question from the leaf node. */ if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) != 0 { rc = _nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp)), iDelete, bp+4) @@ -182565,8 +176405,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - _ = libc.Int32FromInt32(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+25988, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26017, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -182576,11 +176415,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26008, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26037, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26040, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26069, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -182615,7 +176454,6 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow return libc.Int32FromInt32(SQLITE_LOCKED) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) } _rtreeReference(tls, pRtree) - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp, 0, uint32(48)) /* Constraint handling. A write operation on an r-tree table may return ** SQLITE_CONSTRAINT for two reasons: @@ -182630,8 +176468,8 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow */ if nData > int32(1) { nn = nData - int32(4) - if nn > int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { - nn = int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) + if nn > libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) { + nn = libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) } /* Populate the cell.aCoord[] array. The first coordinate is aData[3]. ** @@ -182641,7 +176479,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow ** This problem was discovered after years of use, so we silently ignore ** these kinds of misdeclared tables to avoid breaking any legacy. */ - if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { ii = 0 for { if !(ii < nn) { @@ -182730,10 +176568,10 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow Xsqlite3_bind_int64(tls, pUp, int32(1), *(*Tsqlite_int64)(unsafe.Pointer(pRowid))) jj = 0 for { - if !(jj < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { + if !(jj < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_bind_value(tls, pUp, jj+int32(2), *(*uintptr)(unsafe.Pointer(aData + uintptr(int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)+int32(3)+jj)*4))) + Xsqlite3_bind_value(tls, pUp, jj+int32(2), *(*uintptr)(unsafe.Pointer(aData + uintptr(libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)+int32(3)+jj)*4))) goto _3 _3: ; @@ -182759,7 +176597,6 @@ func _rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) (r int32) { var pRtree uintptr _ = pRtree pRtree = pVtab - _ = libc.Int32FromInt32(0) (*TRtree)(unsafe.Pointer(pRtree)).FinWrTrans = uint8(1) return SQLITE_OK } @@ -182796,7 +176633,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26077, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26106, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -182850,7 +176687,7 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26222 + zFmt = __ccgo_ts + 26251 nRow = int64(RTREE_MIN_ROWEST) rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11707, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { @@ -182910,7 +176747,7 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26278, + 0: __ccgo_ts + 26307, 1: __ccgo_ts + 5548, 2: __ccgo_ts + 16781, } @@ -182956,21 +176793,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26692, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26721, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { - if !(ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { + if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26754, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26783, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26759, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26823, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26893, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26788, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26852, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26922, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -182995,16 +176832,16 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref if !(i < int32(N_STATEMENT) && rc == SQLITE_OK) { break } - if i != int32(3) || int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux) == 0 { + if i != int32(3) || libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) == 0 { zFormat = _azSql[i] } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 26942 + zFormat = __ccgo_ts + 26971 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { - rc = Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(f), appStmt[i], uintptr(0)) + rc = Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), libc.Uint32FromInt32(f), appStmt[i], uintptr(0)) } else { rc = int32(SQLITE_NOMEM) } @@ -183015,36 +176852,36 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27050, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27079, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27095, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27124, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { - if !(ii1 < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { + if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { Xsqlite3_str_append(tls, p1, __ccgo_ts+13215, int32(1)) } - if ii1 < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27122, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27151, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27144, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27173, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27152, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27181, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - rc = Xsqlite3_prepare_v3(tls, db, zSql1, -int32(1), uint32(f), pRtree+108, uintptr(0)) + rc = Xsqlite3_prepare_v3(tls, db, zSql1, -int32(1), libc.Uint32FromInt32(f), pRtree+108, uintptr(0)) Xsqlite3_free(tls, zSql1) } } @@ -183053,14 +176890,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26283, - 1: __ccgo_ts + 26336, - 2: __ccgo_ts + 26381, - 3: __ccgo_ts + 26433, - 4: __ccgo_ts + 26487, - 5: __ccgo_ts + 26532, - 6: __ccgo_ts + 26590, - 7: __ccgo_ts + 26645, + 0: __ccgo_ts + 26312, + 1: __ccgo_ts + 26365, + 2: __ccgo_ts + 26410, + 3: __ccgo_ts + 26462, + 4: __ccgo_ts + 26516, + 5: __ccgo_ts + 26561, + 6: __ccgo_ts + 26619, + 7: __ccgo_ts + 26674, } // C documentation @@ -183118,25 +176955,25 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27168, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27197, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) - if int32(4)+int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) < (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize { - (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) + if int32(4)+libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) < (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize { + (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27188, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27217, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+16) if rc != SQLITE_OK { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+27245, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+27274, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) } } } @@ -183184,12 +177021,12 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt eCoordType = v1 ii = int32(4) aErrMsg = [5]uintptr{ - 1: __ccgo_ts + 27280, - 2: __ccgo_ts + 27323, - 3: __ccgo_ts + 27358, - 4: __ccgo_ts + 27394, + 1: __ccgo_ts + 27309, + 2: __ccgo_ts + 27352, + 3: __ccgo_ts + 27387, + 4: __ccgo_ts + 27423, } - _ = libc.Int32FromInt32(0) /* Aux columns counted by a u8 */ + /* Aux columns counted by a u8 */ if argc < int32(6) || argc > libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) @@ -183197,29 +177034,29 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_INNOCUOUS), 0) /* Allocate the sqlite3_vtab structure */ - nDb = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))) - nName = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) - pRtree = Xsqlite3_malloc64(tls, uint64(uint32(500)+uint32(nDb)+uint32(nName*int32(2))+uint32(8))) + nDb = libc.Int32FromUint32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))) + nName = libc.Int32FromUint32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) + pRtree = Xsqlite3_malloc64(tls, uint64(uint32(500)+libc.Uint32FromInt32(nDb)+libc.Uint32FromInt32(nName*int32(2))+uint32(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint32(500)+uint32(nDb)+uint32(nName*int32(2))+uint32(8)) + libc.Xmemset(tls, pRtree, 0, uint32(500)+libc.Uint32FromInt32(nDb)+libc.Uint32FromInt32(nName*int32(2))+uint32(8)) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*500 (*TRtree)(unsafe.Pointer(pRtree)).FzName = (*TRtree)(unsafe.Pointer(pRtree)).FzDb + uintptr(nDb+int32(1)) (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName = (*TRtree)(unsafe.Pointer(pRtree)).FzName + uintptr(nName+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).FeCoordType = uint8(eCoordType) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(nDb)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), uint32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), uint32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27431, uint32(6)) + (*TRtree)(unsafe.Pointer(pRtree)).FeCoordType = libc.Uint8FromInt32(eCoordType) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), libc.Uint32FromInt32(nDb)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt32(nName)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt32(nName)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27460, uint32(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27437, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))), *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27466, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))), *(*uintptr)(unsafe.Pointer(argv + 3*4)))) ii = int32(4) for { if !(ii < argc) { @@ -183228,9 +177065,9 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)) if int32(*(*int8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27461, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27490, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { - if int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break } else { (*TRtree)(unsafe.Pointer(pRtree)).FnDim2++ @@ -183242,7 +177079,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27488, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27517, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -183262,14 +177099,14 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt if rc != 0 { goto rtreeInit_fail } - (*TRtree)(unsafe.Pointer(pRtree)).FnDim = uint8(int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) / int32(2)) - if int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim) < int32(1) { + (*TRtree)(unsafe.Pointer(pRtree)).FnDim = libc.Uint8FromInt32(libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) / int32(2)) + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim) < int32(1) { iErr = int32(2) } else { - if int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) > libc.Int32FromInt32(RTREE_MAX_DIMENSIONS)*libc.Int32FromInt32(2) { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2) > libc.Int32FromInt32(RTREE_MAX_DIMENSIONS)*libc.Int32FromInt32(2) { iErr = int32(3) } else { - if int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)%int32(2) != 0 { + if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)%int32(2) != 0 { iErr = int32(1) } else { iErr = 0 @@ -183280,7 +177117,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } - (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = uint8(int32(8) + int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) + (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) /* Figure out the node size to use. */ rc = _getNodeSize(tls, db, pRtree, isCreate, pzErr) if rc != 0 { @@ -183299,15 +177136,13 @@ rtreeInit_fail: if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _rtreeRelease(tls, pRtree) return rc } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27467, - 1: __ccgo_ts + 27478, + 0: __ccgo_ts + 27496, + 1: __ccgo_ts + 27507, } // C documentation @@ -183340,12 +177175,12 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = nArg libc.Xmemset(tls, bp, 0, uint32(28)) libc.Xmemset(tls, bp+28, 0, uint32(500)) - (*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim = uint8(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apArg)))) - if int32((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim) < int32(1) || int32((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim) > int32(5) { + (*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim = libc.Uint8FromInt32(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apArg)))) + if libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim) < int32(1) || libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim) > int32(5) { return } - (*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim2 = uint8(int32((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim) * int32(2)) - (*(*TRtree)(unsafe.Pointer(bp + 28))).FnBytesPerCell = uint8(int32(8) + int32(8)*int32((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim)) + (*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim2 = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim) * int32(2)) + (*(*TRtree)(unsafe.Pointer(bp + 28))).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + int32(8)*libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim)) (*(*TRtreeNode)(unsafe.Pointer(bp))).FzData = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*4))) if (*(*TRtreeNode)(unsafe.Pointer(bp))).FzData == uintptr(0) { return @@ -183354,7 +177189,7 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if nData < int32(4) { return } - if nData < _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(bp)).FzData+2)*int32((*(*TRtree)(unsafe.Pointer(bp + 28))).FnBytesPerCell) { + if nData < _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(bp)).FzData+2)*libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 28))).FnBytesPerCell) { return } pOut = Xsqlite3_str_new(tls, uintptr(0)) @@ -183367,19 +177202,19 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if ii > 0 { Xsqlite3_str_append(tls, pOut, __ccgo_ts+11327, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27491, libc.VaList(bp+584, (*(*TRtreeCell)(unsafe.Pointer(bp + 528))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27520, libc.VaList(bp+584, (*(*TRtreeCell)(unsafe.Pointer(bp + 528))).FiRowid)) jj = 0 for { - if !(jj < int32((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim2)) { + if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27497, libc.VaList(bp+584, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 528 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27526, libc.VaList(bp+584, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 528 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27501, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27530, int32(1)) goto _1 _1: ; @@ -183406,7 +177241,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27532, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -183528,7 +177363,7 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt } else { v1 = __ccgo_ts + 1662 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27536, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27565, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -183562,24 +177397,24 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27543, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27572, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) if Xsqlite3_step(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) == int32(SQLITE_ROW) { nNode = Xsqlite3_column_bytes(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 0) pNode = Xsqlite3_column_blob(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 0) - pRet = Xsqlite3_malloc64(tls, uint64(nNode)) + pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNode)) if pRet == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pRet, pNode, uint32(nNode)) + libc.Xmemcpy(tls, pRet, pNode, libc.Uint32FromInt32(nNode)) *(*int32)(unsafe.Pointer(pnNode)) = nNode } } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27588, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27617, libc.VaList(bp+8, iNode)) } } return pRet @@ -183608,10 +177443,9 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27620, - 1: __ccgo_ts + 27674, + 0: __ccgo_ts + 27649, + 1: __ccgo_ts + 27703, } - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } @@ -183623,21 +177457,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27722 + v1 = __ccgo_ts + 27751 } else { - v1 = __ccgo_ts + 27730 + v1 = __ccgo_ts + 27759 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27739, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27768, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27722 + v2 = __ccgo_ts + 27751 } else { - v2 = __ccgo_ts + 27730 + v2 = __ccgo_ts + 27759 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27784, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27813, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -183682,7 +177516,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27842, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27871, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -183700,7 +177534,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27890, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27919, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -183730,24 +177564,22 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt _, _, _, _, _ = aNode, i, iVal, nCell, pCell aNode = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27957, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27986, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27991, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28020, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28021, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28050, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -183792,12 +177624,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28076, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28105, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28107, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28136, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -183826,7 +177658,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28174, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28203, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -183836,11 +177668,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+25988, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26017, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28202, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28231, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -183856,8 +177688,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28233, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28240, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28262, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28269, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -183879,13 +177711,12 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt var rc int32 _, _ = pRtree, rc pRtree = pVtab - _ = libc.Int32FromInt32(0) _ = zSchema _ = zName _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28248, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28277, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -183936,7 +177767,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28267, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28296, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) @@ -184108,7 +177939,7 @@ func _geopolySkipSpace(tls *libc.TLS, p uintptr) (r int8) { for _geopolyIsSpace[*(*uint8)(unsafe.Pointer((*TGeoParse)(unsafe.Pointer(p)).Fz))] != 0 { (*TGeoParse)(unsafe.Pointer(p)).Fz++ } - return int8(*(*uint8)(unsafe.Pointer((*TGeoParse)(unsafe.Pointer(p)).Fz))) + return libc.Int8FromUint8(*(*uint8)(unsafe.Pointer((*TGeoParse)(unsafe.Pointer(p)).Fz))) } // C documentation @@ -184131,18 +177962,18 @@ func _geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) (r int32) { seenE = 0 if int32(c) == int32('-') { j = int32(1) - c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j)))) + c = libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j)))) } - if int32(c) == int32('0') && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) >= int32('0') && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) <= int32('9') { + if int32(c) == int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) <= int32('9') { return 0 } for { - c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j)))) - if int32(_sqlite3CtypeMap[uint8(c)])&int32(0x04) != 0 { + c = libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j)))) + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(c)])&int32(0x04) != 0 { goto _1 } if int32(c) == int32('.') { - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-int32(1))))) == int32('-') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j-int32(1))))) == int32('-') { return 0 } if seenDP != 0 { @@ -184152,7 +177983,7 @@ func _geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) (r int32) { goto _1 } if int32(c) == int32('e') || int32(c) == int32('E') { - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-int32(1))))) < int32('0') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j-int32(1))))) < int32('0') { return 0 } if seenE != 0 { @@ -184161,10 +177992,10 @@ func _geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) (r int32) { v2 = libc.Int32FromInt32(1) seenE = v2 seenDP = v2 - c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) + c = libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) if int32(c) == int32('+') || int32(c) == int32('-') { j++ - c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) + c = libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) } if int32(c) < int32('0') || int32(c) > int32('9') { return 0 @@ -184177,7 +178008,7 @@ func _geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) (r int32) { ; j++ } - if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-int32(1))))) < int32('0') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j-int32(1))))) < int32('0') { return 0 } if pVal != 0 { @@ -184218,7 +178049,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(uint32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint32(4)*uint32(2))) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint32FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint32(4)*uint32(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -184263,17 +178094,17 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && int32(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 20)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, uint64(libc.Int64FromInt64(40)+int64(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2))*(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4)))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(libc.Int64FromInt64(40)+libc.Int64FromUint32(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2))*(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4)))) *(*int32)(unsafe.Pointer(bp + 20)) = int32(1) if pOut == uintptr(0) { goto parse_json_err } (*TGeoPoly)(unsafe.Pointer(pOut)).FnVertex = (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex - libc.Xmemcpy(tls, pOut+8, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint32((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex*int32(2))*uint32(4)) + libc.Xmemcpy(tls, pOut+8, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint32FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex*int32(2))*uint32(4)) *(*uint8)(unsafe.Pointer(pOut + 4)) = *(*uint8)(unsafe.Pointer(bp + 20)) - *(*uint8)(unsafe.Pointer(pOut + 4 + 1)) = uint8((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >> int32(16) & int32(0xff)) - *(*uint8)(unsafe.Pointer(pOut + 4 + 2)) = uint8((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >> int32(8) & int32(0xff)) - *(*uint8)(unsafe.Pointer(pOut + 4 + 3)) = uint8((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex & int32(0xff)) + *(*uint8)(unsafe.Pointer(pOut + 4 + 1)) = libc.Uint8FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >> int32(16) & int32(0xff)) + *(*uint8)(unsafe.Pointer(pOut + 4 + 2)) = libc.Uint8FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >> int32(8) & int32(0xff)) + *(*uint8)(unsafe.Pointer(pOut + 4 + 3)) = libc.Uint8FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex & int32(0xff)) Xsqlite3_free(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa) if pRc != 0 { *(*int32)(unsafe.Pointer(pRc)) = SQLITE_OK @@ -184315,7 +178146,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( v1 = Xsqlite3_value_bytes(tls, pVal) nByte = v1 } - if v2 && v1 >= int32(libc.Uint32FromInt32(4)+libc.Uint32FromInt32(6)*libc.Uint32FromInt64(4)) { + if v2 && v1 >= libc.Int32FromUint32(libc.Uint32FromInt32(4)+libc.Uint32FromInt32(6)*libc.Uint32FromInt64(4)) { a = Xsqlite3_value_blob(tls, pVal) if a == uintptr(0) { if pCtx != 0 { @@ -184323,9 +178154,9 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } return uintptr(0) } - nVertex = int32(*(*uint8)(unsafe.Pointer(a + 1)))<<int32(16) + int32(*(*uint8)(unsafe.Pointer(a + 2)))<<int32(8) + int32(*(*uint8)(unsafe.Pointer(a + 3))) - if (int32(*(*uint8)(unsafe.Pointer(a))) == 0 || int32(*(*uint8)(unsafe.Pointer(a))) == int32(1)) && uint32(nVertex*int32(2))*uint32(4)+uint32(4) == uint32(nByte) { - p = Xsqlite3_malloc64(tls, uint64(uint32(40)+uint32((nVertex-int32(1))*int32(2))*uint32(4))) + nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<<int32(16) + libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 2)))<<int32(8) + libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 3))) + if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a))) == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a))) == int32(1)) && libc.Uint32FromInt32(nVertex*int32(2))*uint32(4)+uint32(4) == libc.Uint32FromInt32(nByte) { + p = Xsqlite3_malloc64(tls, uint64(uint32(40)+libc.Uint32FromInt32((nVertex-int32(1))*int32(2))*uint32(4))) if p == uintptr(0) { if pRc != 0 { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) @@ -184336,8 +178167,8 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } else { *(*int32)(unsafe.Pointer(bp)) = int32(1) (*TGeoPoly)(unsafe.Pointer(p)).FnVertex = nVertex - libc.Xmemcpy(tls, p+4, a, uint32(nByte)) - if int32(*(*uint8)(unsafe.Pointer(a))) != int32(*(*uint8)(unsafe.Pointer(bp))) { + libc.Xmemcpy(tls, p+4, a, libc.Uint32FromInt32(nByte)) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a))) != libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) { ii = 0 for { if !(ii < nVertex) { @@ -184418,19 +178249,19 @@ func _geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if p != 0 { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) - Xsqlite3_str_append(tls, x, __ccgo_ts+25224, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+25253, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28318, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28347, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28329, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28358, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -184459,20 +178290,20 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) cSep = int8('\'') - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28340, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28369, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28358, libc.VaList(bp+8, int32(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28387, libc.VaList(bp+8, int32(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) cSep = int8(' ') goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28366, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28395, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) i = int32(1) for { if !(i < argc) { @@ -184480,14 +178311,14 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if z != 0 && *(*int8)(unsafe.Pointer(z)) != 0 { - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28374, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28403, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28378, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28407, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -184652,7 +178483,6 @@ func _geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { func _geopolySine(tls *libc.TLS, r float64) (r1 float64) { var r2, r3, r5 float64 _, _, _ = r2, r3, r5 - _ = libc.Int32FromInt32(0) if r >= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) } @@ -184694,7 +178524,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(uint32(40)+uint32((n-int32(1))*int32(2))*uint32(4))) + p = Xsqlite3_malloc64(tls, uint64(uint32(40)+libc.Uint32FromInt32((n-int32(1))*int32(2))*uint32(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -184702,8 +178532,8 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt *(*int32)(unsafe.Pointer(bp)) = int32(1) *(*uint8)(unsafe.Pointer(p + 4)) = *(*uint8)(unsafe.Pointer(bp)) *(*uint8)(unsafe.Pointer(p + 4 + 1)) = uint8(0) - *(*uint8)(unsafe.Pointer(p + 4 + 2)) = uint8(n >> int32(8) & int32(0xff)) - *(*uint8)(unsafe.Pointer(p + 4 + 3)) = uint8(n & int32(0xff)) + *(*uint8)(unsafe.Pointer(p + 4 + 2)) = libc.Uint8FromInt32(n >> int32(8) & int32(0xff)) + *(*uint8)(unsafe.Pointer(p + 4 + 3)) = libc.Uint8FromInt32(n & int32(0xff)) *(*int32)(unsafe.Pointer(bp)) = 0 for { if !(*(*int32)(unsafe.Pointer(bp)) < n) { @@ -184796,7 +178626,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint32FromInt64(40)+libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2)*uint32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint32FromInt64(40)+libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2)*libc.Uint32FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -185191,7 +179021,7 @@ func _geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { _, _ = i, x i = uint32(0) for { - if !(i < uint32((*TGeoPoly)(unsafe.Pointer(pPoly)).FnVertex)-uint32(1)) { + if !(i < libc.Uint32FromInt32((*TGeoPoly)(unsafe.Pointer(pPoly)).FnVertex)-uint32(1)) { break } x = pPoly + 8 + uintptr(i*uint32(2))*4 @@ -185397,7 +179227,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { needSort = 0 pActive = uintptr(0) nByte = int64(20)*nVertex*int64(2) + int64(40)*nVertex + int64(16) - p = Xsqlite3_malloc64(tls, uint64(nByte)) + p = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if p == uintptr(0) { return -int32(1) } @@ -185435,7 +179265,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { (*(*[4]uint8)(unsafe.Pointer(bp)))[iMask] = uint8(1) } } - iMask ^= int32((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) + iMask ^= libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) pPrev = pSeg goto _3 _3: @@ -185451,7 +179281,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { - if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && int32((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != int32((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { + if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { rc = int32(1) goto geopolyOverlapDone } else { @@ -185460,7 +179290,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } - iMask ^= int32((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) + iMask ^= libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) pPrev = pSeg goto _4 _4: @@ -185508,16 +179338,16 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } pThisEvent = (*TGeoEvent)(unsafe.Pointer(pThisEvent)).FpNext } - if int32((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(3)]) == 0 { + if libc.Int32FromUint8((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(3)]) == 0 { rc = 0 } else { - if int32((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)]) != 0 && int32((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(2)]) == 0 { + if libc.Int32FromUint8((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)]) != 0 && libc.Int32FromUint8((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(2)]) == 0 { rc = int32(3) } else { - if int32((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)]) == 0 && int32((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(2)]) != 0 { + if libc.Int32FromUint8((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)]) == 0 && libc.Int32FromUint8((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(2)]) != 0 { rc = int32(2) } else { - if int32((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)]) == 0 && int32((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(2)]) == 0 { + if libc.Int32FromUint8((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)]) == 0 && libc.Int32FromUint8((*(*[4]uint8)(unsafe.Pointer(bp)))[int32(2)]) == 0 { rc = int32(4) } else { rc = int32(1) @@ -185599,13 +179429,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_INNOCUOUS), 0) /* Allocate the sqlite3_vtab structure */ - nDb = int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))) - nName = int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) - pRtree = Xsqlite3_malloc64(tls, uint64(int64(500)+nDb+nName*int64(2)+int64(8))) + nDb = libc.Int64FromUint32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))) + nName = libc.Int64FromUint32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) + pRtree = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(int64(500)+nDb+nName*int64(2)+int64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint32(int64(500)+nDb+nName*int64(2)+int64(8))) + libc.Xmemset(tls, pRtree, 0, libc.Uint32FromInt64(int64(500)+nDb+nName*int64(2)+int64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*500 @@ -185614,16 +179444,16 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint (*TRtree)(unsafe.Pointer(pRtree)).FeCoordType = uint8(RTREE_COORD_REAL32) (*TRtree)(unsafe.Pointer(pRtree)).FnDim = uint8(2) (*TRtree)(unsafe.Pointer(pRtree)).FnDim2 = uint8(4) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(nDb)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), uint32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), uint32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27431, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), libc.Uint32FromInt64(nDb)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt64(nName)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt64(nName)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27460, uint32(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28391, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28420, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -185632,13 +179462,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28413, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28442, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27488, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27517, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -185653,7 +179483,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if rc != 0 { goto geopolyInit_fail } - (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = uint8(int32(8) + int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) + (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) /* Figure out the node size to use. */ rc = _getNodeSize(tls, db, pRtree, isCreate, pzErr) if rc != 0 { @@ -185672,8 +179502,6 @@ geopolyInit_fail: if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _rtreeRelease(tls, pRtree) return rc } @@ -185738,12 +179566,12 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 4)) = _findLeafNode(tls, pRtree, iRowid, bp+12, bp+16) if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp + 12)) != uintptr(0) { p = _rtreeSearchPointNew(tls, pCsr, float64(0), uint8(0)) - _ = libc.Int32FromInt32(0) /* Always returns pCsr->sPoint */ + /* Always returns pCsr->sPoint */ *(*uintptr)(unsafe.Pointer(pCsr + 60)) = *(*uintptr)(unsafe.Pointer(bp + 12)) (*TRtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*Ti64)(unsafe.Pointer(bp + 16)) (*TRtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = uint8(PARTLY_WITHIN) *(*int32)(unsafe.Pointer(bp + 4)) = _nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 12)), iRowid, bp+8) - (*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell = uint8(*(*int32)(unsafe.Pointer(bp + 8))) + (*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp + 8))) } else { (*TRtreeCursor)(unsafe.Pointer(pCsr)).FatEOF = uint8(1) } @@ -185753,13 +179581,11 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin */ *(*int32)(unsafe.Pointer(bp + 4)) = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && idxNum <= int32(3) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(argv)), bp+24, bp+4) if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { goto geopoly_filter_end } - v1 = Xsqlite3_malloc(tls, int32(libc.Uint32FromInt64(20)*libc.Uint32FromInt32(4))) + v1 = Xsqlite3_malloc(tls, libc.Int32FromUint32(libc.Uint32FromInt64(20)*libc.Uint32FromInt32(4))) p1 = v1 (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = v1 (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = int32(4) @@ -185767,7 +179593,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 4)) = int32(SQLITE_NOMEM) } else { libc.Xmemset(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, libc.Uint32FromInt64(20)*libc.Uint32FromInt32(4)) - libc.Xmemset(tls, pCsr+80, 0, uint32(4)*uint32((*TRtree)(unsafe.Pointer(pRtree)).FiDepth+libc.Int32FromInt32(1))) + libc.Xmemset(tls, pCsr+80, 0, uint32(4)*libc.Uint32FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiDepth+libc.Int32FromInt32(1))) if idxNum == int32(2) { /* Overlap query */ (*TRtreeConstraint)(unsafe.Pointer(p1)).Fop = int32('B') @@ -185806,7 +179632,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin } } if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { - pNew = _rtreeSearchPointNew(tls, pCsr, float64(0), uint8((*TRtree)(unsafe.Pointer(pRtree)).FiDepth+libc.Int32FromInt32(1))) + pNew = _rtreeSearchPointNew(tls, pCsr, float64(0), libc.Uint8FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiDepth+libc.Int32FromInt32(1))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp + 4)) = int32(SQLITE_NOMEM) goto geopoly_filter_end @@ -185814,7 +179640,6 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin (*TRtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*TRtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = uint8(0) (*TRtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = uint8(PARTLY_WITHIN) - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pCsr + 60)) = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = _rtreeStepToLeaf(tls, pCsr) @@ -185860,16 +179685,16 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { if !((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0) { goto _1 } - if (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0 && int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) { + if (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0 && libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) { iRowidTerm = ii break } - if (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0 && int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) >= int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) { + if (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0 && libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) >= int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) { /* p->op==SQLITE_INDEX_CONSTRAINT_FUNCTION for geopoly_overlap() ** p->op==(SQLITE_INDEX_CONTRAINT_FUNCTION+1) for geopoly_within(). ** See geopolyFindFunction() */ iFuncTerm = ii - idxNum = int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) - int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + int32(2) + idxNum = libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) - int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + int32(2) } goto _1 _1: @@ -185888,7 +179713,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28417 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28446 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -185896,7 +179721,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28423 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28452 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -185927,7 +179752,7 @@ func _geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) (r int32) if i == 0 && Xsqlite3_vtab_nochange(tls, ctx) != 0 { return SQLITE_OK } - if i <= int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux) { + if i <= libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) { if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid != 0) { if (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql, -int32(1), uint32(0), pCsr+36, uintptr(0)) @@ -185935,7 +179760,7 @@ func _geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) (r int32) return *(*int32)(unsafe.Pointer(bp)) } } - Xsqlite3_bind_int64(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, int32(1), _nodeGetRowid(tls, pRtree, pNode, int32((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell))) + Xsqlite3_bind_int64(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, int32(1), _nodeGetRowid(tls, pRtree, pNode, libc.Int32FromUint8((*TRtreeSearchPoint)(unsafe.Pointer(p)).FiCell))) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_step(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux) if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ROW) { (*TRtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = uint8(1) @@ -185997,7 +179822,6 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR return libc.Int32FromInt32(SQLITE_LOCKED) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) } _rtreeReference(tls, pRtree) - _ = libc.Int32FromInt32(0) oldRowidValid = libc.BoolInt32(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData))) != int32(SQLITE_NULL)) if oldRowidValid != 0 { v1 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData))) @@ -186014,11 +179838,10 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR newRowid = v2 (*(*TRtreeCell)(unsafe.Pointer(bp + 4))).FiRowid = newRowid if nData > int32(1) && (!(oldRowidValid != 0) || !(Xsqlite3_value_nochange(tls, *(*uintptr)(unsafe.Pointer(aData + 2*4))) != 0) || oldRowid != newRowid) { - _ = libc.Int32FromInt32(0) _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*4)), bp+4+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28432, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28461, 0) } goto geopoly_update_end } @@ -186072,7 +179895,6 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR pUp = (*TRtree)(unsafe.Pointer(pRtree)).FpWriteAux nChange = 0 Xsqlite3_bind_int64(tls, pUp, int32(1), (*(*TRtreeCell)(unsafe.Pointer(bp + 4))).FiRowid) - _ = libc.Int32FromInt32(0) if Xsqlite3_value_nochange(tls, *(*uintptr)(unsafe.Pointer(aData + 2*4))) != 0 { Xsqlite3_bind_null(tls, pUp, int32(2)) } else { @@ -186122,12 +179944,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28472) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28501) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28488) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28517) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -186198,7 +180020,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28665, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28694, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -186212,61 +180034,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28503, + FzName: __ccgo_ts + 28532, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28516, + FzName: __ccgo_ts + 28545, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28529, + FzName: __ccgo_ts + 28558, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28542, + FzName: __ccgo_ts + 28571, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28488, + FzName: __ccgo_ts + 28517, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28554, + FzName: __ccgo_ts + 28583, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28472, + FzName: __ccgo_ts + 28501, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28577, + FzName: __ccgo_ts + 28606, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28591, + FzName: __ccgo_ts + 28620, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28604, + FzName: __ccgo_ts + 28633, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28618, + FzName: __ccgo_ts + 28647, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28634, + FzName: __ccgo_ts + 28663, }, } @@ -186292,7 +180114,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28646, + FzName: __ccgo_ts + 28675, }, } @@ -186317,20 +180139,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28673, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28702, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28683, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28712, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28694, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28723, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28417, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28446, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28705, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28734, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -186404,12 +180226,12 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = int64(uint32(36) + uint32(nArg-libc.Int32FromInt32(1))*uint32(8) + uint32(nArg)*uint32(4)) - pBlob = Xsqlite3_malloc64(tls, uint64(nBlob)) + nBlob = libc.Int64FromUint32(uint32(36) + libc.Uint32FromInt32(nArg-libc.Int32FromInt32(1))*uint32(8) + libc.Uint32FromInt32(nArg)*uint32(4)) + pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) } else { - (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).FiSize = uint32(nBlob) + (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).FiSize = libc.Uint32FromInt64(nBlob) (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb = *(*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)) (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam = pBlob + 28 + uintptr(nArg)*8 (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).FnParam = nArg @@ -186432,7 +180254,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+25974, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26003, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -187370,12 +181192,12 @@ func _rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) (r uint32) { for { v2 = z z++ - v1 = int32(_zValue[int32(0x7f)&int32(*(*uint8)(unsafe.Pointer(v2)))]) + v1 = int32(_zValue[int32(0x7f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2)))]) c = v1 if !(v1 >= 0) { break } - v = v<<int32(6) + uint32(c) + v = v<<int32(6) + libc.Uint32FromInt32(c) } z-- *(*int32)(unsafe.Pointer(pLen)) -= int32(z) - int32(zStart) @@ -187568,7 +181390,7 @@ func _rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, _zDelta uintptr, /* ERROR: copy exceeds output file size */ return -int32(1) } - if int32(ofst+cnt) > lenSrc { + if libc.Int32FromUint32(ofst+cnt) > lenSrc { /* ERROR: copy extends past end of input */ return -int32(1) } @@ -187582,7 +181404,7 @@ func _rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, _zDelta uintptr, /* ERROR: insert command gives an output larger than predicted */ return -int32(1) } - if int32(cnt) > *(*int32)(unsafe.Pointer(bp + 4)) { + if libc.Int32FromUint32(cnt) > *(*int32)(unsafe.Pointer(bp + 4)) { /* ERROR: insert count exceeds size of delta */ return -int32(1) } @@ -187598,7 +181420,7 @@ func _rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, _zDelta uintptr, /* ERROR: generated size does not match predicted size */ return -int32(1) } - return int32(total) + return libc.Int32FromUint32(total) default: /* ERROR: unknown delta operator */ return -int32(1) @@ -187615,7 +181437,7 @@ func _rbuDeltaOutputSize(tls *libc.TLS, _zDelta uintptr, _lenDelta int32) (r int *(*int32)(unsafe.Pointer(bp + 4)) = _lenDelta var size int32 _ = size - size = int32(_rbuDeltaGetInt(tls, bp, bp+4)) + size = libc.Int32FromUint32(_rbuDeltaGetInt(tls, bp, bp+4)) if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != int32('\n') { /* ERROR: size integer not terminated by "\n" */ return -int32(1) @@ -187641,7 +181463,6 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt var aDelta, aOrig, aOut uintptr var nDelta, nOrig, nOut, nOut2 int32 _, _, _, _, _, _, _ = aDelta, aOrig, aOut, nDelta, nOrig, nOut, nOut2 - _ = libc.Int32FromInt32(0) nOrig = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) aOrig = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) nDelta = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) @@ -187649,7 +181470,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28715, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28744, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -187659,7 +181480,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28715, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28744, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -187733,7 +181554,6 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in func _prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) (r int32) { var rc int32 _ = rc - _ = libc.Int32FromInt32(0) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) @@ -187841,7 +181661,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28736, uintptr(0), uintptr(0), p+36) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28765, uintptr(0), uintptr(0), p+36) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187923,16 +181743,14 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var p, zIn uintptr _, _, _ = i, p, zIn p = Xsqlite3_user_data(tls, pCtx) - _ = libc.Int32FromInt32(0) zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _ = libc.Int32FromInt32(0) if argc == int32(1) || 0 == Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+25887, zIn, uint32(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+25916, zIn, uint32(4)) == 0 { i = int32(4) for { if !(int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -187969,13 +181787,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint32(108)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 28907 + v1 = __ccgo_ts + 28936 } else { v1 = __ccgo_ts + 1662 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+28948, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+28977, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29098) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29127) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188059,12 +181877,11 @@ func _rbuMalloc(tls *libc.TLS, p uintptr, nByte Tsqlite3_int64) (r uintptr) { _ = pRet pRet = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _ = libc.Int32FromInt32(0) - pRet = Xsqlite3_malloc64(tls, uint64(nByte)) + pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pRet, 0, uint32(nByte)) + libc.Xmemset(tls, pRet, 0, libc.Uint32FromInt64(nByte)) } } return pRet @@ -188081,7 +181898,7 @@ func _rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) var azNew uintptr var nByte Tsqlite3_int64 _, _ = azNew, nByte - nByte = int64((libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4) + libc.Uint32FromInt64(4) + libc.Uint32FromInt32(3)*libc.Uint32FromInt64(1)) * uint32(nCol)) + nByte = libc.Int64FromUint32((libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4) + libc.Uint32FromInt64(4) + libc.Uint32FromInt32(3)*libc.Uint32FromInt64(1)) * libc.Uint32FromInt32(nCol)) azNew = _rbuMalloc(tls, p, nByte) if azNew != 0 { (*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol = azNew @@ -188204,8 +182021,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - _ = libc.Int32FromInt32(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29223, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29252, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -188215,15 +182031,15 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29342, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29371, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)]) == int32(SQLITE_ROW) { zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) - if zOrig != 0 && zIdx != 0 && int32(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29363, libc.VaList(bp+24, zIdx))) + if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29392, libc.VaList(bp+24, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -188235,7 +182051,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29414, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29443, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -188278,8 +182094,8 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint32(1)*uint32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29435, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint32(1)*libc.Uint32FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29464, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -188290,16 +182106,16 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { break } if bPartial != 0 { - libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint32(1)*uint32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) + libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint32(1)*libc.Uint32FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29463, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+16, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(1)) if iCid >= 0 { *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(iCid))) = uint8(1) } if iCid == -int32(2) { - libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint32(1)*uint32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) + libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint32(1)*libc.Uint32FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -188342,7 +182158,6 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 iOrder = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Figure out the type of table this step will deal with. */ - _ = libc.Int32FromInt32(0) _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+36, bp+4, pIter+60) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) @@ -188354,11 +182169,10 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum = *(*int32)(unsafe.Pointer(bp + 4)) } - _ = libc.Int32FromInt32(0) /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29521, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -188369,7 +182183,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29511, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29540, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+32) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 8 @@ -188377,7 +182191,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*4)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29516, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29545, zName) { bRbuRowid = int32(1) } } @@ -188391,17 +182205,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29526 + v4 = __ccgo_ts + 29555 } else { - v4 = __ccgo_ts + 29539 + v4 = __ccgo_ts + 29568 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29548, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29606, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -188423,7 +182237,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29599, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29628, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -188437,16 +182251,13 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iOrder)*4)) = t1 } *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iOrder)*4)) = _rbuStrndup(tls, zType, p+32) - _ = libc.Int32FromInt32(0) - *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iOrder))) = uint8(iPk) - *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iOrder))) = libc.BoolUint8(uint8(bNotNull) != 0 || iPk != 0) + *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iOrder))) = libc.Uint8FromInt32(iPk) + *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iOrder))) = libc.BoolUint8(libc.Uint8FromInt32(bNotNull) != 0 || iPk != 0) iOrder++ } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuObjIterCacheIndexedCols(tls, p, pIter) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc } @@ -188472,7 +182283,7 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29626, libc.VaList(bp+8, zList, zSep, z)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+29655, libc.VaList(bp+8, zList, zSep, z)) zSep = __ccgo_ts + 15083 goto _1 _1: @@ -188505,9 +182316,9 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - if int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29635, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29664, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -188555,21 +182366,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29648, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29677, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29680, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29709, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1662, __ccgo_ts+15083, __ccgo_ts+29703) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29709, __ccgo_ts+29716, __ccgo_ts+5170) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1662, __ccgo_ts+15083, __ccgo_ts+29732) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29738, __ccgo_ts+29745, __ccgo_ts+5170) zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1662, __ccgo_ts+15083, __ccgo_ts+1662) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29724, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29753, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29766, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29795, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -188621,7 +182432,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zSep = __ccgo_ts + 1662 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29463, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -188633,7 +182444,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) { i = 0 for { - if !(int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0) { + if !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0) { break } goto _1 @@ -188641,17 +182452,16 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { ; i++ } - _ = libc.Int32FromInt32(0) zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) } else { - zCol = __ccgo_ts + 29786 + zCol = __ccgo_ts + 29815 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29794, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29815, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29851, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29823, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29844, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) zSep = __ccgo_ts + 15083 iCol++ } @@ -188661,7 +182471,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29878, libc.VaList(bp+16, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29907, libc.VaList(bp+16, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { zSep = __ccgo_ts + 1662 iCol = 0 @@ -188678,7 +182488,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+29926, libc.VaList(bp+16, zVector, zSep, zQuoted)) + zVector = _rbuMPrintf(tls, p, __ccgo_ts+29955, libc.VaList(bp+16, zVector, zSep, zQuoted)) zSep = __ccgo_ts + 15083 goto _2 _2: @@ -188686,7 +182496,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29933, libc.VaList(bp+16, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29962, libc.VaList(bp+16, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -188744,8 +182554,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zAnd = __ccgo_ts + 1662 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29463, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -188754,7 +182563,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+29945, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+29974, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) zType = __ccgo_ts + 1662 } else { if iCid < 0 { @@ -188763,7 +182572,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) { i = 0 for { - if !(int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0) { + if !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0) { break } goto _1 @@ -188771,13 +182580,12 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter ; i++ } - _ = libc.Int32FromInt32(0) zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29786 + zCol = __ccgo_ts + 29815 } else { - zCol = __ccgo_ts + 29516 + zCol = __ccgo_ts + 29545 } } zType = __ccgo_ts + 1136 @@ -188785,19 +182593,19 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+29967, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+29996, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29703 + v2 = __ccgo_ts + 29732 } else { v2 = __ccgo_ts + 1662 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+29987, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30016, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30008, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30041, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30037, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30070, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -188856,9 +182664,9 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30065, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30094, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30077, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30106, libc.VaList(bp+8, zList, zS)) } zS = __ccgo_ts + 15083 if zList == uintptr(0) { @@ -188872,7 +182680,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30086, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30115, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -188898,7 +182706,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30101, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30130, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { zSep = __ccgo_ts + 1662 @@ -188908,7 +182716,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30115, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30144, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) zSep = __ccgo_ts + 22158 } goto _1 @@ -188916,7 +182724,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30127, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30156, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1662 i1 = 0 @@ -188926,7 +182734,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30177, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30206, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) zSep1 = __ccgo_ts + 22158 } goto _2 @@ -188950,7 +182758,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30190, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30219, 0) } // C documentation @@ -188981,7 +182789,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt _, _, _, _ = c, i, zList, zSep zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - if int32(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { + if libc.Int32FromUint32(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { zSep = __ccgo_ts + 1662 @@ -188992,15 +182800,15 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30177, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30206, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) zSep = __ccgo_ts + 15083 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30216, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30245, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) zSep = __ccgo_ts + 15083 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30246, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30275, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) zSep = __ccgo_ts + 15083 } } @@ -189084,18 +182892,17 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { var _ /* pXList at bp+0 */ uintptr _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30283 + zSep = __ccgo_ts + 30312 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* PRAGMA index_xinfo = <pk-index> */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29435, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29464, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16669) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29463, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+16, zIdx))) } break } @@ -189106,16 +182913,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(3)) != 0 { - v1 = __ccgo_ts + 29703 + v1 = __ccgo_ts + 29732 } else { v1 = __ccgo_ts + 1662 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30296, libc.VaList(bp+16, z, zSep, zCol, zDesc)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30325, libc.VaList(bp+16, z, zSep, zCol, zDesc)) zSep = __ccgo_ts + 15083 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30307, libc.VaList(bp+16, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30336, libc.VaList(bp+16, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) } return z @@ -189161,7 +182968,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30311) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30340) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -189169,7 +182976,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29463, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+16, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { @@ -189178,20 +182985,20 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30361, libc.VaList(bp+16, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30390, libc.VaList(bp+16, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29703 + v1 = __ccgo_ts + 29732 } else { v1 = __ccgo_ts + 1662 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30383, libc.VaList(bp+16, zPk, zComma, iCid, v1)) + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30412, libc.VaList(bp+16, zPk, zComma, iCid, v1)) zComma = __ccgo_ts + 15083 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30393, libc.VaList(bp+16, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30422, libc.VaList(bp+16, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30408, libc.VaList(bp+16, zCols, zPk)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30437, libc.VaList(bp+16, zCols, zPk)) Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, 0, 0)) } } @@ -189242,14 +183049,14 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30470 + zPk = __ccgo_ts + 30499 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30483 + v2 = __ccgo_ts + 30512 } else { v2 = __ccgo_ts + 1662 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30493, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30522, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) zComma = __ccgo_ts + 15083 goto _1 _1: @@ -189259,16 +183066,16 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30520, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30549, libc.VaList(bp+16, zSql, zPk1)) } } Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30527 + v3 = __ccgo_ts + 30556 } else { v3 = __ccgo_ts + 1662 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30542, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30571, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, 0, 0)) } } @@ -189295,8 +183102,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - _ = libc.Int32FromInt32(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+88, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30574, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+88, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30603, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -189306,7 +183112,6 @@ func _rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { _, _, _ = i, p, rc p = Xsqlite3_user_data(tls, pCtx) rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal))) != 0 { *(*Ti64)(unsafe.Pointer(p + 176)) += int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) } @@ -189342,9 +183147,8 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30631) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30660) } if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 4)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -189367,7 +183171,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt c = *(*int8)(unsafe.Pointer(zSql + uintptr(i))) /* If necessary, grow the pIter->aIdxCol[] array */ if iIdxCol == nIdxAlloc { - aIdxCol = Xsqlite3_realloc(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol, int32(uint32(nIdxAlloc+libc.Int32FromInt32(16))*uint32(8))) + aIdxCol = Xsqlite3_realloc(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol, libc.Int32FromUint32(libc.Uint32FromInt32(nIdxAlloc+libc.Int32FromInt32(16))*uint32(8))) if aIdxCol == uintptr(0) { *(*int32)(unsafe.Pointer(bp + 4)) = int32(SQLITE_NOMEM) break @@ -189377,7 +183181,6 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt } if int32(c) == int32('(') { if nParen == 0 { - _ = libc.Int32FromInt32(0) (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol))).FzSpan = zSql + uintptr(i+int32(1)) } nParen++ @@ -189507,7 +183310,6 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 var _ /* zImposterPK at bp+4 */ uintptr var _ /* zWhere at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bRbuRowid, pz, tnum, zBind, zBindings, zCollist, zIdx, zLimit, zNewlist, zOldlist, zOrder, zPart, zRbuRowid, zRbuRowid1, zSql, zStart, zStart1, zTbl, zTbl1, zWhere1, zWrite, v1, v10, v2, v3, v4, v5, v6, v7, v8, v9 - _ = libc.Int32FromInt32(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect == uintptr(0) && _rbuObjIterCacheTableInfo(tls, p, pIter) == SQLITE_OK { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum zCollist = uintptr(0) /* List of indexed columns */ @@ -189515,7 +183317,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30697, libc.VaList(bp+24, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30726, libc.VaList(bp+24, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -189528,23 +183330,22 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zBind = uintptr(0) zPart = uintptr(0) *(*int32)(unsafe.Pointer(bp + 12)) = 0 - _ = libc.Int32FromInt32(0) zPart = _rbuObjIterGetIndexWhere(tls, p, pIter) zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+4, bp+8, bp+12) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 12))) /* Create the imposter table used to write to this index. */ Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, 0, int32(1))) Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30717, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30746, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 4)))) Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 12)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30782, libc.VaList(bp+24, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30811, libc.VaList(bp+24, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30818, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp + 8))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30847, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp + 8))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -189559,26 +183360,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30852 + v2 = __ccgo_ts + 30881 } else { - v2 = __ccgo_ts + 30856 + v2 = __ccgo_ts + 30885 } v1 = v2 } else { v1 = __ccgo_ts + 1662 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30862, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30891, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30923, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30952, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30852 + v3 = __ccgo_ts + 30881 } else { - v3 = __ccgo_ts + 30856 + v3 = __ccgo_ts + 30885 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30984, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31013, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -189607,39 +183408,39 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { v4 = __ccgo_ts + 1662 } else { - v4 = __ccgo_ts + 31143 + v4 = __ccgo_ts + 31172 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31152 + v5 = __ccgo_ts + 31181 } else { v5 = __ccgo_ts + 1662 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31162, libc.VaList(bp+24, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31191, libc.VaList(bp+24, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31198, libc.VaList(bp+24, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31227, libc.VaList(bp+24, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { zRbuRowid = __ccgo_ts + 1662 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31226 + zRbuRowid = __ccgo_ts + 31255 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31238 + v6 = __ccgo_ts + 31267 } else { v6 = __ccgo_ts + 1662 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31255, libc.VaList(bp+24, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31331, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31284, libc.VaList(bp+24, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31360, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31630, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31659, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -189650,9 +183451,9 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31729 + v7 = __ccgo_ts + 31758 } else { - v7 = __ccgo_ts + 31739 + v7 = __ccgo_ts + 31768 } zRbuRowid1 = v7 } @@ -189665,14 +183466,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29786, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29815, 0) } else { zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1662, __ccgo_ts+15083, __ccgo_ts+1662) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31750 + v8 = __ccgo_ts + 31779 } else { v8 = __ccgo_ts + 1662 } @@ -189682,11 +183483,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1662 } if zOrder != 0 { - v10 = __ccgo_ts + 23352 + v10 = __ccgo_ts + 23381 } else { v10 = __ccgo_ts + 1662 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31756, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31785, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -189746,7 +183547,6 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p ; pp = *(*uintptr)(unsafe.Pointer(pp)) + 8 } - _ = libc.Int32FromInt32(0) if nUp >= int32(SQLITE_RBU_UPDATE_CACHESIZE) { pp = pIter + 104 for { @@ -189762,22 +183562,22 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p Xsqlite3_finalize(tls, (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate) (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate = uintptr(0) } else { - pUp = _rbuMalloc(tls, p, int64(uint32(12)+uint32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)+uint32(1))) + pUp = _rbuMalloc(tls, p, libc.Int64FromUint32(uint32(12)+libc.Uint32FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)+uint32(1))) } if pUp != 0 { zWhere = _rbuObjIterGetWhere(tls, p, pIter) zSet = _rbuObjIterGetSetlist(tls, p, pIter, zMask) zUpdate = uintptr(0) (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask = pUp + 1*12 - libc.Xmemcpy(tls, (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask, zMask, uint32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) + libc.Xmemcpy(tls, (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask, zMask, libc.Uint32FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { zPrefix = __ccgo_ts + 1662 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31143 + zPrefix = __ccgo_ts + 31172 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31804, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31833, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+4, p+36, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -189851,7 +183651,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 4)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31834, libc.VaList(bp+16, p+24))) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31863, libc.VaList(bp+16, p+24))) for *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -189870,7 +183670,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { case int32(RBU_STATE_CKPT): (*TRbuState)(unsafe.Pointer(pRet)).FiWalCksum = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) case int32(RBU_STATE_COOKIE): - (*TRbuState)(unsafe.Pointer(pRet)).FiCookie = uint32(Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1))) + (*TRbuState)(unsafe.Pointer(pRet)).FiCookie = libc.Uint32FromInt64(Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1))) case int32(RBU_STATE_OALSZ): (*TRbuState)(unsafe.Pointer(pRet)).FiOalSz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) case int32(RBU_STATE_PHASEONESTEP): @@ -189906,9 +183706,6 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) var bOpen, rc int32 var pState, zExtra, zFile, zTarget, v1, v2, v3 uintptr _, _, _, _, _, _, _, _, _ = bOpen, pState, rc, zExtra, zFile, zTarget, v1, v2, v3 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Open the RBU database */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain @@ -189916,19 +183713,19 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31864, libc.VaList(bp+8, zFile, zFile)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31893, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31892, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31921, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) libc.Xmemcpy(tls, p+24, __ccgo_ts+3482, uint32(4)) } else { libc.Xmemcpy(tls, p+24, __ccgo_ts+6649, uint32(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31910, libc.VaList(bp+8, p+24)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31939, libc.VaList(bp+8, p+24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 @@ -189966,10 +183763,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31976, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32005, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24719, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24748, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -189985,14 +183782,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1662 } else { - v2 = __ccgo_ts + 32008 + v2 = __ccgo_ts + 32037 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1662 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32010, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32039, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -190003,18 +183800,18 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32042, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32071, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32057, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32086, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32074, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32103, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32090, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32119, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ @@ -190023,7 +183820,7 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32118, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32147, 0) } } @@ -190073,7 +183870,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - iRet = int64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))<<libc.Int32FromInt32(32) + uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+11*4))) + iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))<<libc.Int32FromInt32(32) + uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+11*4))) } } return iRet @@ -190107,7 +183904,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32090, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32119, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -190140,7 +183937,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32136, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32165, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -190163,7 +183960,6 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { } else { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal - _ = libc.Int32FromInt32(0) nSectorSize = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSectorSize})))(tls, pDb) if nSectorSize > (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz @@ -190191,7 +183987,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i var iFrame, mReq Tu32 var nNew, v1 int32 _, _, _, _, _ = aNew, iFrame, mReq, nNew, v1 - mReq = uint32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(WAL_LOCK_WRITE) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(WAL_LOCK_CKPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(WAL_LOCK_READ0)) + mReq = libc.Uint32FromInt32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(WAL_LOCK_WRITE) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(WAL_LOCK_CKPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(WAL_LOCK_READ0)) if (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FmLock != mReq { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).Frc = int32(SQLITE_BUSY) return libc.Int32FromInt32(SQLITE_NOTICE) | libc.Int32FromInt32(3)<<libc.Int32FromInt32(8) @@ -190204,14 +184000,14 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(uint32(nNew)*uint32(8))) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint32FromInt32(nNew)*uint32(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame = aNew (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc = nNew } - iFrame = uint32((iOff-libc.Int64FromInt32(32))/int64(iAmt+libc.Int32FromInt32(24))) + uint32(1) + iFrame = libc.Uint32FromInt64((iOff-libc.Int64FromInt32(32))/int64(iAmt+libc.Int32FromInt32(24))) + uint32(1) if (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FiMaxFrame < iFrame { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FiMaxFrame = iFrame } @@ -190229,7 +184025,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i // ** of the page being written in the aFrame[] array. // */ func _rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff Ti64) (r int32) { - (*(*TRbuFrame)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr((*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame-int32(1))*8))).FiDbPage = uint32(iOff/int64((*Tsqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz)) + uint32(1) + (*(*TRbuFrame)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr((*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame-int32(1))*8))).FiDbPage = libc.Uint32FromInt64(iOff/int64((*Tsqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz)) + uint32(1) return SQLITE_OK } @@ -190246,13 +184042,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { _, _, _ = iOff, pDb, pWal pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - _ = libc.Int32FromInt32(0) - iOff = int64((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) + iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } - iOff = int64((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) + iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } @@ -190306,7 +184101,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32171, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32200, 0) } // C documentation @@ -190328,10 +184123,8 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32196, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32203, libc.VaList(bp+8, zMove)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32225, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32232, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -190353,7 +184146,6 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = uintptr(0) dbMain = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget, int32(1)) if dbMain != 0 { - _ = libc.Int32FromInt32(0) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuLockDatabase(tls, dbMain) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -190442,9 +184234,6 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { var pIter, pVal, pWriter uintptr _, _, _, _ = i, pIter, pVal, pWriter pIter = p + 48 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If this is a delete, decrement nPhaseOneStep by nIndex. If the DELETE ** statement below does actually delete a row, nPhaseOneStep will be ** incremented by the same amount when SQL function rbu_tmp_insert() @@ -190467,10 +184256,10 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24276, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24305, 0) return } - if eType == int32(RBU_DELETE) && int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { + if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { goto _1 } pVal = Xsqlite3_column_value(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) @@ -190528,8 +184317,6 @@ func _rbuStep(tls *libc.TLS, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) eType = _rbuStepType(tls, p, bp) if eType != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (eType == int32(RBU_IDX_DELETE) || eType == int32(RBU_IDX_INSERT)) { _rbuBadControlError(tls, p) } else { @@ -190546,7 +184333,6 @@ func _rbuStep(tls *libc.TLS, p uintptr) (r int32) { _rbuStepOneOp(tls, p, eType) } else { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer(p + 176)) -= int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) _rbuGetUpdateStmt(tls, p, pIter, *(*uintptr)(unsafe.Pointer(bp)), bp+4) if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { @@ -190606,7 +184392,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+32210) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+32239) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -190619,7 +184405,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32232, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32261, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -190646,9 +184432,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - _ = libc.Int32FromInt32(0) - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32259, libc.VaList(bp+16, p+24, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), int64((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) - _ = libc.Int32FromInt32(0) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32288, libc.VaList(bp+16, p+24, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -190684,9 +184468,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32417, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32446, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32432, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32461, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -190709,10 +184493,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - _ = libc.Int32FromInt32(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32452, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32481, uintptr(0), uintptr(0), p+36) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32477) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32506) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -190723,10 +184506,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32585) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32614) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+32650) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+32679) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -190744,7 +184527,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32694, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32723, uintptr(0), uintptr(0), p+36) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -190780,7 +184563,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32719, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32748, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -190799,7 +184582,6 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuObjIterNext(tls, p, pIter) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _ = libc.Int32FromInt32(0) _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -190833,9 +184615,9 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_DONE) } } else { - for cond := true; cond; cond = (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep < (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame && iSector == ((*(*TRbuFrame)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FaFrame + uintptr((*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep)*8))).FiDbPage-uint32(1))/uint32((*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { + for cond := true; cond; cond = (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep < (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame && iSector == ((*(*TRbuFrame)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FaFrame + uintptr((*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep)*8))).FiDbPage-uint32(1))/libc.Uint32FromInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pFrame = (*Tsqlite3rbu)(unsafe.Pointer(p)).FaFrame + uintptr((*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep)*8 - iSector = ((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage - uint32(1)) / uint32((*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector) + iSector = ((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage - uint32(1)) / libc.Uint32FromInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector) _rbuCheckpointFrame(tls, p, pFrame) (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep++ } @@ -190885,7 +184667,6 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { var pIter uintptr var rc int32 _, _ = pIter, rc - _ = libc.Int32FromInt32(0) if (*TRbuState)(unsafe.Pointer(pState)).FzTbl != 0 { pIter = p + 48 rc = SQLITE_OK @@ -190894,7 +184675,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32747, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32776, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -190917,11 +184698,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32196, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32225, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(SQLITE_FCNTL_VFS_POINTER), bp) - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -190942,13 +184722,11 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* rnd at bp+0 */ int32 var _ /* zRnd at bp+4 */ [64]int8 _ = pVfs - _ = libc.Int32FromInt32(0) Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32772, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32801, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) - _ = libc.Int32FromInt32(0) (*Tsqlite3rbu)(unsafe.Pointer(p)).FzVfsName = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FzName (*Trbu_vfs)(unsafe.Pointer(pVfs)).FpRbu = p } @@ -190991,8 +184769,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain } db = v1 - _ = libc.Int32FromInt32(0) - rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+32783, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+32812, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 4)), -int32(1)) } else { @@ -191037,11 +184814,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32855, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32884, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32869) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32898) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -191050,7 +184827,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32926) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32955) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -191114,7 +184891,6 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pState = _rbuLoadState(tls, p) - _ = libc.Int32FromInt32(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 { _rbuDeleteOalFile(tls, p) @@ -191128,11 +184904,10 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz = (*TRbuState)(unsafe.Pointer(pState)).FiOalSz } } - _ = libc.Int32FromInt32(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33000, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33029, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -191154,11 +184929,11 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33032 + v3 = __ccgo_ts + 33061 } else { - v3 = __ccgo_ts + 33039 + v3 = __ccgo_ts + 33068 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33046, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33075, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -191182,7 +184957,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33078, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33107, uintptr(0), uintptr(0), p+36) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from @@ -191190,7 +184965,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6649, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33094, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33123, uintptr(0), uintptr(0), p+36) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -191267,8 +185042,8 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp return _rbuMisuseError(tls) } if zState != 0 { - n = int32(libc.Xstrlen(tls, zState)) - if n >= int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33118, zState+uintptr(n-int32(7)), uint32(7)) { + n = libc.Int32FromUint32(libc.Xstrlen(tls, zState)) + if n >= int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33147, zState+uintptr(n-int32(7)), uint32(7)) { return _rbuMisuseError(tls) } } @@ -191315,13 +185090,13 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(i < nErrmsg-uint32(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31143, uint32(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31172, uint32(8)) == 0 { nDel = int32(8) - for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) <= int32('9') { + for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ } - libc.Xmemmove(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i+uint32(nDel)), nErrmsg+uint32(1)-i-uint32(nDel)) - nErrmsg -= uint32(nDel) + libc.Xmemmove(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i+libc.Uint32FromInt32(nDel)), nErrmsg+uint32(1)-i-libc.Uint32FromInt32(nDel)) + nErrmsg -= libc.Uint32FromInt32(nDel) } goto _1 _1: @@ -191362,7 +185137,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33126, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33155, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -191370,7 +185145,6 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { /* Close the open database handle and VFS object. */ Xsqlite3_close(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu) Xsqlite3_close(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain) - _ = libc.Int32FromInt32(0) _rbuDeleteVfs(tls, p) Xsqlite3_free(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf) Xsqlite3_free(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaFrame) @@ -191429,7 +185203,6 @@ func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uint *(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS *(*int32)(unsafe.Pointer(pnTwo)) = MAX_PROGRESS default: - _ = libc.Int32FromInt32(0) } } @@ -191447,19 +185220,9 @@ func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) (r int32) { 4: int32(SQLITE_RBU_STATE_CHECKPOINT), 5: int32(SQLITE_RBU_STATE_DONE), } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != int32(SQLITE_DONE) { return int32(SQLITE_RBU_STATE_ERROR) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return aRes[(*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage] } return r @@ -191473,9 +185236,7 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { if rc == int32(SQLITE_DONE) { return SQLITE_OK } - _ = libc.Int32FromInt32(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK { rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+14987, uintptr(0), uintptr(0), uintptr(0)) } @@ -191489,7 +185250,6 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK { rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+14987, uintptr(0), uintptr(0), uintptr(0)) } @@ -191497,13 +185257,13 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { v1 = __ccgo_ts + 14972 } else { - v1 = __ccgo_ts + 33078 + v1 = __ccgo_ts + 33107 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33078, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33107, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -191601,7 +185361,6 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var i int32 var xShmLock uintptr _, _ = i, xShmLock - _ = libc.Int32FromInt32(0) if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 @@ -191609,7 +185368,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { if !(i < int32(SQLITE_SHM_NLOCK)) { break } - if uint32(libc.Int32FromInt32(1)<<i)&(*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FmLock != 0 { + if libc.Uint32FromInt32(libc.Int32FromInt32(1)<<i)&(*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FmLock != 0 { (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xShmLock})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, i, int32(1), libc.Int32FromInt32(SQLITE_SHM_UNLOCK)|libc.Int32FromInt32(SQLITE_SHM_EXCLUSIVE)) } goto _1 @@ -191633,7 +185392,6 @@ func _rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Tsqlite3_int64) (r int3 nDiff = nNew - (*Trbu_file)(unsafe.Pointer(pFd)).Fsz *(*Ti64)(unsafe.Pointer(pRbu + 228)) += nDiff (*Trbu_file)(unsafe.Pointer(pFd)).Fsz = nNew - _ = libc.Int32FromInt32(0) if (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp > (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit { return int32(SQLITE_FULL) } @@ -191654,7 +185412,6 @@ func _rbuMainlistAdd(tls *libc.TLS, p uintptr) { var pIter, pRbuVfs uintptr _, _ = pIter, pRbuVfs pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs - _ = libc.Int32FromInt32(0) Xsqlite3_mutex_enter(tls, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex) if (*Trbu_file)(unsafe.Pointer(p)).FpRbu == uintptr(0) { pIter = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain @@ -191807,7 +185564,6 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { _rbuUpdateTempSize(tls, p, 0) } } - _ = libc.Int32FromInt32(0) /* Close the underlying file handle */ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc @@ -191837,8 +185593,8 @@ func _rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal Tu32) { } func _rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal Tu16) { - *(*Tu8)(unsafe.Pointer(aBuf)) = uint8(int32(iVal) >> int32(8) & int32(0xFF)) - *(*Tu8)(unsafe.Pointer(aBuf + 1)) = uint8(int32(iVal) >> 0 & int32(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> int32(8) & int32(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> 0 & int32(0xFF)) } // C documentation @@ -191854,12 +185610,11 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T p = pFile pRbu = (*Trbu_file)(unsafe.Pointer(p)).FpRbu if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == int32(RBU_STAGE_CAPTURE) { - _ = libc.Int32FromInt32(0) rc = _rbuCaptureWalRead(tls, (*Trbu_file)(unsafe.Pointer(p)).FpRbu, iOfst, iAmt) } else { if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == int32(RBU_STAGE_OAL) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_WAL) != 0 && iOfst >= (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz { rc = SQLITE_OK - libc.Xmemset(tls, zBuf, 0, uint32(iAmt)) + libc.Xmemset(tls, zBuf, 0, libc.Uint32FromInt32(iAmt)) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target @@ -191876,15 +185631,15 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T } else { v1 = 0 } - iRoot = uint32(v1) + iRoot = libc.Uint32FromInt32(v1) _rbuPutU32(tls, aBuf+52, iRoot) /* largest root page number */ _rbuPutU32(tls, aBuf+36, uint32(0)) /* number of free pages */ _rbuPutU32(tls, aBuf+32, uint32(0)) /* first page on free list trunk */ _rbuPutU32(tls, aBuf+28, uint32(1)) /* size of db file in pages */ _rbuPutU32(tls, aBuf+24, (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd)).FiCookie+uint32(1)) /* Change counter */ if iAmt > int32(100) { - libc.Xmemset(tls, aBuf+100, 0, uint32(iAmt-int32(100))) - _rbuPutU16(tls, aBuf+105, uint16(iAmt&int32(0xFFFF))) + libc.Xmemset(tls, aBuf+100, 0, libc.Uint32FromInt32(iAmt-int32(100))) + _rbuPutU16(tls, aBuf+105, libc.Uint16FromInt32(iAmt&int32(0xFFFF))) *(*Tu8)(unsafe.Pointer(aBuf + 100)) = uint8(0x0D) } } @@ -191914,7 +185669,6 @@ func _rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst p = pFile pRbu = (*Trbu_file)(unsafe.Pointer(p)).FpRbu if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == int32(RBU_STAGE_CAPTURE) { - _ = libc.Int32FromInt32(0) rc = _rbuCaptureDbWrite(tls, (*Trbu_file)(unsafe.Pointer(p)).FpRbu, iOfst) } else { if pRbu != 0 { @@ -192014,7 +185768,6 @@ func _rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) (r int32) { p = pFile pRbu = (*Trbu_file)(unsafe.Pointer(p)).FpRbu rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if eLock == int32(SQLITE_LOCK_EXCLUSIVE) && ((*Trbu_file)(unsafe.Pointer(p)).FbNolock != 0 || pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FeStage != int32(RBU_STAGE_DONE)) { /* Do not allow EXCLUSIVE locks. Preventing SQLite from taking this ** prevents it from checkpointing the database from sqlite3_close(). */ @@ -192063,7 +185816,6 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r _, _, _, _, _, _, _, _ = p, pRbu, pRbu1, pRbuVfs, rc, xControl, zIn, zOut p = pFile xControl = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileControl - _ = libc.Int32FromInt32(0) if op == int32(SQLITE_FCNTL_RBU) { pRbu = pArg /* First try to find another RBU vfs lower down in the vfs stack. If @@ -192077,7 +185829,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33153, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33182, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -192103,7 +185855,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33176, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33205, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -192148,8 +185900,6 @@ func _rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int p = pFile pRbu = (*Trbu_file)(unsafe.Pointer(p)).FpRbu rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pRbu != 0 && ((*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == int32(RBU_STAGE_OAL) || (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == int32(RBU_STAGE_MOVE) || (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == int32(RBU_STAGE_DONE)) { /* Prevent SQLite from taking a shm-lock on the target file when it ** is supplying heap memory to the upper layer in place of *-shm @@ -192165,7 +185915,7 @@ func _rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int if bCapture == 0 || 0 == flags&int32(SQLITE_SHM_UNLOCK) { rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags) if bCapture != 0 && rc == SQLITE_OK { - *(*Tu32)(unsafe.Pointer(pRbu + 196)) |= uint32((int32(1)<<n - int32(1)) << ofst) + *(*Tu32)(unsafe.Pointer(pRbu + 196)) |= libc.Uint32FromInt32((int32(1)<<n - int32(1)) << ofst) } } } @@ -192193,28 +185943,26 @@ func _rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, /* If not in RBU_STAGE_OAL, allow this call to pass through. Or, if this ** rbu is in the RBU_STAGE_OAL state, use heap memory for *-shm space ** instead of a file on disk. */ - _ = libc.Int32FromInt32(0) if eStage == int32(RBU_STAGE_OAL) { - nByte = int64(uint32(iRegion+libc.Int32FromInt32(1)) * uint32(4)) - apNew = Xsqlite3_realloc64(tls, (*Trbu_file)(unsafe.Pointer(p)).FapShm, uint64(nByte)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt32(iRegion+libc.Int32FromInt32(1)) * uint32(4)) + apNew = Xsqlite3_realloc64(tls, (*Trbu_file)(unsafe.Pointer(p)).FapShm, libc.Uint64FromInt64(nByte)) /* This is an RBU connection that uses its own heap memory for the ** pages of the *-shm file. Since no other process can have run ** recovery, the connection must request *-shm pages in order ** from start to finish. */ - _ = libc.Int32FromInt32(0) if apNew == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, apNew+uintptr((*Trbu_file)(unsafe.Pointer(p)).FnShm)*4, 0, uint32(4)*uint32(libc.Int32FromInt32(1)+iRegion-(*Trbu_file)(unsafe.Pointer(p)).FnShm)) + libc.Xmemset(tls, apNew+uintptr((*Trbu_file)(unsafe.Pointer(p)).FnShm)*4, 0, uint32(4)*libc.Uint32FromInt32(libc.Int32FromInt32(1)+iRegion-(*Trbu_file)(unsafe.Pointer(p)).FnShm)) (*Trbu_file)(unsafe.Pointer(p)).FapShm = apNew (*Trbu_file)(unsafe.Pointer(p)).FnShm = iRegion + int32(1) } if rc == SQLITE_OK { - pNew = Xsqlite3_malloc64(tls, uint64(szRegion)) + pNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szRegion)) if pNew == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pNew, 0, uint32(szRegion)) + libc.Xmemset(tls, pNew, 0, libc.Uint32FromInt32(szRegion)) *(*uintptr)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FapShm + uintptr(iRegion)*4)) = pNew } } @@ -192224,7 +185972,6 @@ func _rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) } } else { - _ = libc.Int32FromInt32(0) rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmMap})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, iRegion, szRegion, isWrite, pp) } return rc @@ -192259,7 +186006,6 @@ func _rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) (r int32) { v1 = 0 } eStage = v1 - _ = libc.Int32FromInt32(0) if eStage == int32(RBU_STAGE_OAL) || eStage == int32(RBU_STAGE_MOVE) { /* no-op */ } else { @@ -192318,8 +186064,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33187, 0) != 0 { - _ = libc.Int32FromInt32(0) + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33216, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -192434,7 +186179,6 @@ func _rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pRes if rc == SQLITE_OK && flags == SQLITE_ACCESS_EXISTS { pDb = _rbuFindMaindb(tls, pRbuVfs, zPath, int32(1)) if pDb != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(pResOut)) != 0 { rc = int32(SQLITE_CANTOPEN) } else { @@ -192602,7 +186346,7 @@ func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) (r in } else { libc.Xmemcpy(tls, pNew, uintptr(unsafe.Pointer(&_vfs_template)), uint32(88)) (*Trbu_vfs)(unsafe.Pointer(pNew)).Fbase.FmxPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pParent)).FmxPathname - (*Trbu_vfs)(unsafe.Pointer(pNew)).Fbase.FszOsFile = int32(uint32(64) + uint32((*Tsqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile)) + (*Trbu_vfs)(unsafe.Pointer(pNew)).Fbase.FszOsFile = libc.Int32FromUint32(uint32(64) + libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile)) (*Trbu_vfs)(unsafe.Pointer(pNew)).FpRealVfs = pParent v1 = pNew + 1*108 zSpace = v1 @@ -192887,7 +186631,6 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint rc = int32(SQLITE_NOMEM) } } - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK { libc.Xmemset(tls, pTab, 0, uint32(20)) (*TStatTable)(unsafe.Pointer(pTab)).Fdb = db @@ -192936,10 +186679,10 @@ func _statBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { if !(i < (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) { break } - if int32((*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(i)*12))).Fop) != int32(SQLITE_INDEX_CONSTRAINT_EQ) { + if libc.Int32FromUint8((*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(i)*12))).Fop) != int32(SQLITE_INDEX_CONSTRAINT_EQ) { goto _1 } - if int32((*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(i)*12))).Fusable) == 0 { + if libc.Int32FromUint8((*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(i)*12))).Fusable) == 0 { /* Force DBSTAT table should always be the right-most table in a join */ return int32(SQLITE_CONSTRAINT) } @@ -192982,7 +186725,7 @@ func _statBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { ** If this will satisfy the client, set the orderByConsumed flag so that ** SQLite does not do an external sort. */ - if (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy == int32(1) && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).FiColumn == 0 && int32((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).Fdesc) == 0 || (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy == int32(2) && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).FiColumn == 0 && int32((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).Fdesc) == 0 && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy + 1*8))).FiColumn == int32(1) && int32((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy + 1*8))).Fdesc) == 0 { + if (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy == int32(1) && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).FiColumn == 0 && libc.Int32FromUint8((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).Fdesc) == 0 || (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy == int32(2) && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).FiColumn == 0 && libc.Int32FromUint8((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy))).Fdesc) == 0 && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy + 1*8))).FiColumn == int32(1) && libc.Int32FromUint8((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy + 1*8))).Fdesc) == 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = int32(1) *(*int32)(unsafe.Pointer(pIdxInfo + 20)) |= int32(0x08) } @@ -193050,7 +186793,7 @@ func _statResetCsr(tls *libc.TLS, pCsr uintptr) { ** this happens. dbsqlfuzz 9ed3e4e3816219d3509d711636c38542bf3f40b1. */ i = 0 for { - if !(i < int32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40))) { break } _statClearPage(tls, pCsr+16+uintptr(i)*40) @@ -193105,7 +186848,7 @@ func _statClose(tls *libc.TLS, pCursor uintptr) (r int32) { func _getLocalPayload(tls *libc.TLS, nUsable int32, flags Tu8, nTotal int32) (r int32) { var nLocal, nMaxLocal, nMinLocal int32 _, _, _ = nLocal, nMaxLocal, nMinLocal - if int32(flags) == int32(0x0D) { /* Table leaf node */ + if libc.Int32FromUint8(flags) == int32(0x0D) { /* Table leaf node */ nMinLocal = (nUsable-int32(12))*int32(32)/int32(255) - int32(23) nMaxLocal = nUsable - int32(35) } else { /* Index interior and leaf nodes */ @@ -193143,11 +186886,11 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } aHdr = aData + uintptr(v1) (*TStatPage)(unsafe.Pointer(p)).Fflags = *(*Tu8)(unsafe.Pointer(aHdr)) - if int32((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x0A) || int32((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x0D) { + if libc.Int32FromUint8((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x0A) || libc.Int32FromUint8((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x0D) { isLeaf = int32(1) nHdr = int32(8) } else { - if int32((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x05) || int32((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x02) { + if libc.Int32FromUint8((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x05) || libc.Int32FromUint8((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x02) { isLeaf = 0 nHdr = int32(12) } else { @@ -193157,18 +186900,18 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { if (*TStatPage)(unsafe.Pointer(p)).FiPgno == uint32(1) { nHdr += int32(100) } - (*TStatPage)(unsafe.Pointer(p)).FnCell = int32(*(*Tu8)(unsafe.Pointer(aHdr + 3)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(aHdr + 3 + 1))) + (*TStatPage)(unsafe.Pointer(p)).FnCell = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aHdr + 3)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aHdr + 3 + 1))) (*TStatPage)(unsafe.Pointer(p)).FnMxPayload = 0 szPage = _sqlite3BtreeGetPageSize(tls, pBt) - nUnused = int32(*(*Tu8)(unsafe.Pointer(aHdr + 5)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(aHdr + 5 + 1))) - nHdr - int32(2)*(*TStatPage)(unsafe.Pointer(p)).FnCell - nUnused += int32(*(*Tu8)(unsafe.Pointer(aHdr + 7))) - iOff = int32(*(*Tu8)(unsafe.Pointer(aHdr + 1)))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(aHdr + 1 + 1))) + nUnused = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aHdr + 5)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aHdr + 5 + 1))) - nHdr - int32(2)*(*TStatPage)(unsafe.Pointer(p)).FnCell + nUnused += libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aHdr + 7))) + iOff = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aHdr + 1)))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aHdr + 1 + 1))) for iOff != 0 { if iOff >= szPage { goto statPageIsCorrupt } - nUnused += int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff+int32(2)))))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff+int32(2)) + 1))) - iNext = int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff))))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff) + 1))) + nUnused += libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff+int32(2)) + 1))) + iNext = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff))))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff) + 1))) if iNext < iOff+int32(4) && iNext > 0 { goto statPageIsCorrupt } @@ -193185,18 +186928,18 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(uint32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint32(24))) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint32FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint32(24))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, (*TStatPage)(unsafe.Pointer(p)).FaCell, 0, uint32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint32(24)) + libc.Xmemset(tls, (*TStatPage)(unsafe.Pointer(p)).FaCell, 0, libc.Uint32FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint32(24)) i = 0 for { if !(i < (*TStatPage)(unsafe.Pointer(p)).FnCell) { break } pCell = (*TStatPage)(unsafe.Pointer(p)).FaCell + uintptr(i)*24 - iOff = int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(nHdr+i*int32(2)))))<<int32(8) | int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(nHdr+i*int32(2)) + 1))) + iOff = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(nHdr+i*int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(nHdr+i*int32(2)) + 1))) if iOff < nHdr || iOff >= szPage { goto statPageIsCorrupt } @@ -193204,37 +186947,35 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { (*TStatCell)(unsafe.Pointer(pCell)).FiChildPg = _sqlite3Get4byte(tls, aData+uintptr(iOff)) iOff += int32(4) } - if int32((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x05) { + if libc.Int32FromUint8((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x05) { /* A table interior node. nPayload==0. */ } else { /* Bytes of payload stored locally */ - if int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff)))) < int32(libc.Uint8FromInt32(0x80)) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff)))) < libc.Int32FromUint8(libc.Uint8FromInt32(0x80)) { *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(aData + uintptr(iOff)))) v4 = libc.Int32FromInt32(1) } else { - v4 = int32(_sqlite3GetVarint32(tls, aData+uintptr(iOff), bp)) + v4 = libc.Int32FromUint8(_sqlite3GetVarint32(tls, aData+uintptr(iOff), bp)) } - iOff += int32(uint8(v4)) - if int32((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x0D) { - iOff += int32(_sqlite3GetVarint(tls, aData+uintptr(iOff), bp+8)) + iOff += libc.Int32FromUint8(libc.Uint8FromInt32(v4)) + if libc.Int32FromUint8((*TStatPage)(unsafe.Pointer(p)).Fflags) == int32(0x0D) { + iOff += libc.Int32FromUint8(_sqlite3GetVarint(tls, aData+uintptr(iOff), bp+8)) } - if *(*Tu32)(unsafe.Pointer(bp)) > uint32((*TStatPage)(unsafe.Pointer(p)).FnMxPayload) { - (*TStatPage)(unsafe.Pointer(p)).FnMxPayload = int32(*(*Tu32)(unsafe.Pointer(bp))) + if *(*Tu32)(unsafe.Pointer(bp)) > libc.Uint32FromInt32((*TStatPage)(unsafe.Pointer(p)).FnMxPayload) { + (*TStatPage)(unsafe.Pointer(p)).FnMxPayload = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))) } - nLocal = _getLocalPayload(tls, nUsable, (*TStatPage)(unsafe.Pointer(p)).Fflags, int32(*(*Tu32)(unsafe.Pointer(bp)))) + nLocal = _getLocalPayload(tls, nUsable, (*TStatPage)(unsafe.Pointer(p)).Fflags, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)))) if nLocal < 0 { goto statPageIsCorrupt } (*TStatCell)(unsafe.Pointer(pCell)).FnLocal = nLocal - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if *(*Tu32)(unsafe.Pointer(bp)) > uint32(nLocal) { - nOvfl = int32((*(*Tu32)(unsafe.Pointer(bp)) - uint32(nLocal) + uint32(nUsable) - uint32(4) - uint32(1)) / uint32(nUsable-libc.Int32FromInt32(4))) + if *(*Tu32)(unsafe.Pointer(bp)) > libc.Uint32FromInt32(nLocal) { + nOvfl = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) + libc.Uint32FromInt32(nUsable) - uint32(4) - uint32(1)) / libc.Uint32FromInt32(nUsable-libc.Int32FromInt32(4))) if iOff+nLocal+int32(4) > nUsable || *(*Tu32)(unsafe.Pointer(bp)) > uint32(0x7fffffff) { goto statPageIsCorrupt } - (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = int32(*(*Tu32)(unsafe.Pointer(bp)) - uint32(nLocal) - uint32((nOvfl-int32(1))*(nUsable-int32(4)))) + (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint32(4)*uint32(nOvfl))) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint32(4)*libc.Uint32FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -193248,7 +186989,6 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) rc = _sqlite3PagerGet(tls, _sqlite3BtreePager(tls, pBt), iPrev, bp+16, 0) if rc != SQLITE_OK { - _ = libc.Int32FromInt32(0) return rc } *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(j)*4)) = _sqlite3Get4byte(tls, _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))) @@ -193294,14 +187034,14 @@ func _statSizeAndOffset(tls *libc.TLS, pCsr uintptr) { ** offset from ZIPVFS. */ fd = _sqlite3PagerFile(tls, pPager) - (*(*[2]Tsqlite3_int64)(unsafe.Pointer(bp)))[0] = int64((*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno) + (*(*[2]Tsqlite3_int64)(unsafe.Pointer(bp)))[0] = libc.Int64FromUint32((*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno) if _sqlite3OsFileControl(tls, fd, int32(230440), bp) == SQLITE_OK { (*TStatCursor)(unsafe.Pointer(pCsr)).FiOffset = (*(*[2]Tsqlite3_int64)(unsafe.Pointer(bp)))[0] *(*Ti64)(unsafe.Pointer(pCsr + 1352)) += (*(*[2]Tsqlite3_int64)(unsafe.Pointer(bp)))[int32(1)] } else { /* Not ZIPVFS: The default page size and offset */ *(*Ti64)(unsafe.Pointer(pCsr + 1352)) += int64(_sqlite3BtreeGetPageSize(tls, pBt)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FiOffset = (*TStatCursor)(unsafe.Pointer(pCsr)).FszPage * int64((*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno-libc.Uint32FromInt32(1)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FiOffset = (*TStatCursor)(unsafe.Pointer(pCsr)).FszPage * libc.Int64FromUint32((*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno-libc.Uint32FromInt32(1)) } } @@ -193331,7 +187071,7 @@ func _statGetPage(tls *libc.TLS, pBt uintptr, iPg Tu32, pPg uintptr) (r int32) { rc = _sqlite3PagerGet(tls, _sqlite3BtreePager(tls, pBt), iPg, bp, 0) if rc == SQLITE_OK { a = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) - libc.Xmemcpy(tls, (*TStatPage)(unsafe.Pointer(pPg)).FaPg, a, uint32(pgsz)) + libc.Xmemcpy(tls, (*TStatPage)(unsafe.Pointer(pPg)).FaPg, a, libc.Uint32FromInt32(pgsz)) _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -193366,7 +187106,7 @@ statNextRestart: _statResetCounts(tls, pCsr) rc = Xsqlite3_step(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == int32(SQLITE_ROW) { - iRoot = uint32(Xsqlite3_column_int64(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, int32(1))) + iRoot = libc.Uint32FromInt64(Xsqlite3_column_int64(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, int32(1))) _sqlite3PagerPagecount(tls, pPager, bp) if *(*int32)(unsafe.Pointer(bp)) == 0 { (*TStatCursor)(unsafe.Pointer(pCsr)).FisEof = uint8(1) @@ -193376,7 +187116,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33198, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33227, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FzPath = v1 if z == uintptr(0) { @@ -193414,8 +187154,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33200 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33209, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33229 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33238, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -193442,11 +187182,10 @@ statNextRestart: goto statNextRestart /* Tail recursion */ } (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ - if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= int32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40)) { + if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(224206)) + return _sqlite3CorruptError(tls, int32(224196)) } - _ = libc.Int32FromInt32(0) if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg } else { @@ -193456,7 +187195,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33221, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33250, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FzPath = v4 if z == uintptr(0) { @@ -193475,17 +187214,17 @@ statNextRestart: rc = _statDecodePage(tls, pBt, p1) if rc == SQLITE_OK { _statSizeAndOffset(tls, pCsr) - switch int32((*TStatPage)(unsafe.Pointer(p1)).Fflags) { + switch libc.Int32FromUint8((*TStatPage)(unsafe.Pointer(p1)).Fflags) { case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33229 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33258 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33238 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33267 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33243 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33272 break } *(*int32)(unsafe.Pointer(pCsr + 1320)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -193529,7 +187268,7 @@ func _statEof(tls *libc.TLS, pCursor uintptr) (r int32) { var pCsr uintptr _ = pCsr pCsr = pCursor - return int32((*TStatCursor)(unsafe.Pointer(pCsr)).FisEof) + return libc.Int32FromUint8((*TStatCursor)(unsafe.Pointer(pCsr)).FisEof) } // C documentation @@ -193583,12 +187322,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33253, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*16))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33282, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*16))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33408, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33437, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33422, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33451, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -193620,7 +187359,7 @@ func _statColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) (r int32) if (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0 { Xsqlite3_result_int64(tls, ctx, int64((*TStatCursor)(unsafe.Pointer(pCsr)).FnPage)) } else { - Xsqlite3_result_int64(tls, ctx, int64((*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno)) + Xsqlite3_result_int64(tls, ctx, libc.Int64FromUint32((*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno)) } case int32(3): /* pagetype */ if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { @@ -193645,7 +187384,7 @@ func _statColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) (r int32) iDb = (*TStatCursor)(unsafe.Pointer(pCsr)).FiDb Xsqlite3_result_text(tls, ctx, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, -int32(1), libc.UintptrFromInt32(0)) default: /* aggregate */ - Xsqlite3_result_int(tls, ctx, int32((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg)) + Xsqlite3_result_int(tls, ctx, libc.Int32FromUint8((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg)) break } return SQLITE_OK @@ -193655,7 +187394,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { var pCsr uintptr _ = pCsr pCsr = pCursor - *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = int64((*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno) + *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = libc.Int64FromUint32((*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno) return SQLITE_OK } @@ -193665,7 +187404,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33437, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33466, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -194109,13 +187848,13 @@ type SessionChange1 = TSessionChange1 func _sessionVarintPut(tls *libc.TLS, aBuf uintptr, iVal int32) (r int32) { var v1 int32 _ = v1 - if uint32(iVal) < libc.Uint32FromInt32(0x80) { - *(*Tu8)(unsafe.Pointer(aBuf)) = uint8(iVal) + if libc.Uint32FromInt32(iVal) < libc.Uint32FromInt32(0x80) { + *(*Tu8)(unsafe.Pointer(aBuf)) = libc.Uint8FromInt32(iVal) v1 = libc.Int32FromInt32(1) } else { - v1 = _sqlite3PutVarint(tls, aBuf, uint64(iVal)) + v1 = _sqlite3PutVarint(tls, aBuf, libc.Uint64FromInt32(iVal)) } - return int32(uint8(v1)) + return libc.Int32FromUint8(libc.Uint8FromInt32(v1)) } // C documentation @@ -194124,7 +187863,7 @@ func _sessionVarintPut(tls *libc.TLS, aBuf uintptr, iVal int32) (r int32) { // ** Return the number of bytes required to store value iVal as a varint. // */ func _sessionVarintLen(tls *libc.TLS, iVal int32) (r int32) { - return _sqlite3VarintLen(tls, uint64(iVal)) + return _sqlite3VarintLen(tls, libc.Uint64FromInt32(iVal)) } // C documentation @@ -194136,13 +187875,13 @@ func _sessionVarintLen(tls *libc.TLS, iVal int32) (r int32) { func _sessionVarintGet(tls *libc.TLS, aBuf uintptr, piVal uintptr) (r int32) { var v1 int32 _ = v1 - if int32(*(*Tu8)(unsafe.Pointer(aBuf))) < int32(libc.Uint8FromInt32(0x80)) { - *(*int32)(unsafe.Pointer(piVal)) = int32(uint32(*(*Tu8)(unsafe.Pointer(aBuf)))) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBuf))) < libc.Int32FromUint8(libc.Uint8FromInt32(0x80)) { + *(*int32)(unsafe.Pointer(piVal)) = libc.Int32FromUint32(uint32(*(*Tu8)(unsafe.Pointer(aBuf)))) v1 = libc.Int32FromInt32(1) } else { - v1 = int32(_sqlite3GetVarint32(tls, aBuf, piVal)) + v1 = libc.Int32FromUint8(_sqlite3GetVarint32(tls, aBuf, piVal)) } - return int32(uint8(v1)) + return libc.Int32FromUint8(libc.Uint8FromInt32(v1)) } /* Load an unaligned and unsigned 32-bit integer */ @@ -194157,10 +187896,10 @@ func _sessionGetI64(tls *libc.TLS, aRec uintptr) (r Tsqlite3_int64) { var x Tu64 var y Tu32 _, _ = x, y - x = uint64(uint32(*(*Tu8)(unsafe.Pointer(aRec)))<<libc.Int32FromInt32(24) | uint32(int32(*(*Tu8)(unsafe.Pointer(aRec + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*Tu8)(unsafe.Pointer(aRec + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aRec + 3)))) - y = uint32(*(*Tu8)(unsafe.Pointer(aRec + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24) | uint32(int32(*(*Tu8)(unsafe.Pointer(aRec + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16)) | uint32(int32(*(*Tu8)(unsafe.Pointer(aRec + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aRec + libc.UintptrFromInt32(4) + 3))) + x = uint64(uint32(*(*Tu8)(unsafe.Pointer(aRec)))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aRec + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aRec + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aRec + 3)))) + y = uint32(*(*Tu8)(unsafe.Pointer(aRec + libc.UintptrFromInt32(4))))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aRec + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(16)) | libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aRec + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(8)) | uint32(*(*Tu8)(unsafe.Pointer(aRec + libc.UintptrFromInt32(4) + 3))) x = x<<libc.Int32FromInt32(32) + uint64(y) - return int64(x) + return libc.Int64FromUint64(x) } // C documentation @@ -194169,14 +187908,14 @@ func _sessionGetI64(tls *libc.TLS, aRec uintptr) (r Tsqlite3_int64) { // ** Write a 64-bit big-endian integer value to the buffer aBuf[]. // */ func _sessionPutI64(tls *libc.TLS, aBuf uintptr, i Tsqlite3_int64) { - *(*Tu8)(unsafe.Pointer(aBuf)) = uint8(i >> libc.Int32FromInt32(56) & int64(0xFF)) - *(*Tu8)(unsafe.Pointer(aBuf + 1)) = uint8(i >> libc.Int32FromInt32(48) & int64(0xFF)) - *(*Tu8)(unsafe.Pointer(aBuf + 2)) = uint8(i >> libc.Int32FromInt32(40) & int64(0xFF)) - *(*Tu8)(unsafe.Pointer(aBuf + 3)) = uint8(i >> libc.Int32FromInt32(32) & int64(0xFF)) - *(*Tu8)(unsafe.Pointer(aBuf + 4)) = uint8(i >> libc.Int32FromInt32(24) & int64(0xFF)) - *(*Tu8)(unsafe.Pointer(aBuf + 5)) = uint8(i >> libc.Int32FromInt32(16) & int64(0xFF)) - *(*Tu8)(unsafe.Pointer(aBuf + 6)) = uint8(i >> libc.Int32FromInt32(8) & int64(0xFF)) - *(*Tu8)(unsafe.Pointer(aBuf + 7)) = uint8(i >> libc.Int32FromInt32(0) & int64(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf)) = libc.Uint8FromInt64(i >> libc.Int32FromInt32(56) & int64(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf + 1)) = libc.Uint8FromInt64(i >> libc.Int32FromInt32(48) & int64(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf + 2)) = libc.Uint8FromInt64(i >> libc.Int32FromInt32(40) & int64(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf + 3)) = libc.Uint8FromInt64(i >> libc.Int32FromInt32(32) & int64(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf + 4)) = libc.Uint8FromInt64(i >> libc.Int32FromInt32(24) & int64(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf + 5)) = libc.Uint8FromInt64(i >> libc.Int32FromInt32(16) & int64(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf + 6)) = libc.Uint8FromInt64(i >> libc.Int32FromInt32(8) & int64(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf + 7)) = libc.Uint8FromInt64(i >> libc.Int32FromInt32(0) & int64(0xFF)) } // C documentation @@ -194205,7 +187944,7 @@ func _sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite if pValue != 0 { /* Value type (SQLITE_NULL, TEXT etc.) */ eType = Xsqlite3_value_type(tls, pValue) if aBuf != 0 { - *(*Tu8)(unsafe.Pointer(aBuf)) = uint8(eType) + *(*Tu8)(unsafe.Pointer(aBuf)) = libc.Uint8FromInt32(eType) } switch eType { case int32(SQLITE_NULL): @@ -194215,17 +187954,15 @@ func _sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite case int32(SQLITE_FLOAT): if aBuf != 0 { if eType == int32(SQLITE_INTEGER) { - *(*Tu64)(unsafe.Pointer(bp)) = uint64(Xsqlite3_value_int64(tls, pValue)) + *(*Tu64)(unsafe.Pointer(bp)) = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, pValue)) } else { - _ = libc.Int32FromInt32(0) *(*float64)(unsafe.Pointer(bp + 8)) = Xsqlite3_value_double(tls, pValue) libc.Xmemcpy(tls, bp, bp+8, uint32(8)) } - _sessionPutI64(tls, aBuf+1, int64(*(*Tu64)(unsafe.Pointer(bp)))) + _sessionPutI64(tls, aBuf+1, libc.Int64FromUint64(*(*Tu64)(unsafe.Pointer(bp)))) } nByte = int32(9) default: - _ = libc.Int32FromInt32(0) if eType == int32(SQLITE_TEXT) { z = Xsqlite3_value_text(tls, pValue) } else { @@ -194239,7 +187976,7 @@ func _sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite if aBuf != 0 { _sessionVarintPut(tls, aBuf+1, n) if n > 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nVarint+int32(1)), z, uint32(n)) + libc.Xmemcpy(tls, aBuf+uintptr(nVarint+int32(1)), z, libc.Uint32FromInt32(n)) } } nByte = int32(1) + nVarint + n @@ -194267,7 +188004,7 @@ func _sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite func _sessionMalloc64(tls *libc.TLS, pSession uintptr, nByte Ti64) (r uintptr) { var pRet, p1 uintptr _, _ = pRet, p1 - pRet = Xsqlite3_malloc64(tls, uint64(nByte)) + pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSession != 0 { p1 = pSession + 40 *(*Ti64)(unsafe.Pointer(p1)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p1))) + Xsqlite3_msize(tls, pRet)) @@ -194315,8 +188052,8 @@ func _sessionFree(tls *libc.TLS, pSession uintptr, pFree uintptr) { // ** hash-key value passed as the first. Return the new hash-key value. // */ func _sessionHashAppendI64(tls *libc.TLS, h uint32, i Ti64) (r uint32) { - h = h<<int32(3) ^ h ^ uint32(i&libc.Int64FromUint32(0xFFFFFFFF)) - return h<<int32(3) ^ h ^ uint32(i>>libc.Int32FromInt32(32)&libc.Int64FromUint32(0xFFFFFFFF)) + h = h<<int32(3) ^ h ^ libc.Uint32FromInt64(i&libc.Int64FromUint32(0xFFFFFFFF)) + return h<<int32(3) ^ h ^ libc.Uint32FromInt64(i>>libc.Int32FromInt32(32)&libc.Int64FromUint32(0xFFFFFFFF)) } // C documentation @@ -194349,7 +188086,7 @@ func _sessionHashAppendBlob(tls *libc.TLS, h uint32, n int32, z uintptr) (r uint // ** hash-key value passed as the first. Return the new hash-key value. // */ func _sessionHashAppendType(tls *libc.TLS, h uint32, eType int32) (r uint32) { - return h<<int32(3) ^ h ^ uint32(eType) + return h<<int32(3) ^ h ^ libc.Uint32FromInt32(eType) } // C documentation @@ -194377,11 +188114,8 @@ func _sessionPreupdateHash(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab ui _, _, _, _, _, _ = eType, h, i, n, rc, z h = uint32(0) /* Used to iterate through columns */ if (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid != 0 { - _ = libc.Int32FromInt32(0) h = _sessionHashAppendI64(tls, h, iRowid) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -194403,7 +188137,6 @@ func _sessionPreupdateHash(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab ui *(*Ti64)(unsafe.Pointer(bp + 8)) = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(bp))) } else { *(*float64)(unsafe.Pointer(bp + 16)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(bp))) - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, bp+8, bp+16, uint32(8)) } h = _sessionHashAppendI64(tls, h, *(*Ti64)(unsafe.Pointer(bp + 8))) @@ -194420,8 +188153,6 @@ func _sessionPreupdateHash(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab ui } h = _sessionHashAppendBlob(tls, h, n, z) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pbNullPK)) = int32(1) } } @@ -194432,7 +188163,7 @@ func _sessionPreupdateHash(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab ui i++ } } - *(*int32)(unsafe.Pointer(piHash)) = int32(h % uint32((*TSessionTable)(unsafe.Pointer(pTab)).FnChange)) + *(*int32)(unsafe.Pointer(piHash)) = libc.Int32FromUint32(h % libc.Uint32FromInt32((*TSessionTable)(unsafe.Pointer(pTab)).FnChange)) return SQLITE_OK } @@ -194449,8 +188180,7 @@ func _sessionSerialLen(tls *libc.TLS, a uintptr) (r int32) { var e int32 var _ /* n at bp+0 */ int32 _ = e - _ = libc.Int32FromInt32(0) - e = int32(*(*Tu8)(unsafe.Pointer(a))) + e = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a))) if e == 0 || e == int32(0xFF) { return int32(1) } @@ -194489,16 +188219,14 @@ func _sessionChangeHash(tls *libc.TLS, pTab uintptr, bPkOnly int32, aRecord uint if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { break } - eType = int32(*(*Tu8)(unsafe.Pointer(a))) - isPK = int32(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) + eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a))) + isPK = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) if bPkOnly != 0 && isPK == 0 { goto _1 } /* It is not possible for eType to be SQLITE_NULL here. The session ** module does not record changes for rows with NULL values stored in ** primary key columns. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if isPK != 0 { a++ h = _sessionHashAppendType(tls, h, eType) @@ -194518,7 +188246,7 @@ func _sessionChangeHash(tls *libc.TLS, pTab uintptr, bPkOnly int32, aRecord uint ; i++ } - return h % uint32(nBucket) + return h % libc.Uint32FromInt32(nBucket) } // C documentation @@ -194543,7 +188271,7 @@ func _sessionChangeEqual(tls *libc.TLS, pTab uintptr, bLeftPkOnly int32, aLeft u if *(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(iCol))) != 0 { n1 = _sessionSerialLen(tls, a1) n2 = _sessionSerialLen(tls, a2) - if n1 != n2 || libc.Xmemcmp(tls, a1, a2, uint32(n1)) != 0 { + if n1 != n2 || libc.Xmemcmp(tls, a1, a2, libc.Uint32FromInt32(n1)) != 0 { return 0 } a1 += uintptr(n1) @@ -194594,10 +188322,10 @@ func _sessionMergeRecord(tls *libc.TLS, paOut uintptr, nCol int32, aLeft uintptr n1 = _sessionSerialLen(tls, a1) n2 = _sessionSerialLen(tls, a2) if *(*Tu8)(unsafe.Pointer(a2)) != 0 { - libc.Xmemcpy(tls, aOut, a2, uint32(n2)) + libc.Xmemcpy(tls, aOut, a2, libc.Uint32FromInt32(n2)) aOut += uintptr(n2) } else { - libc.Xmemcpy(tls, aOut, a1, uint32(n1)) + libc.Xmemcpy(tls, aOut, a1, libc.Uint32FromInt32(n1)) aOut += uintptr(n1) } a1 += uintptr(n1) @@ -194637,7 +188365,6 @@ func _sessionMergeValue(tls *libc.TLS, paOne uintptr, paTwo uintptr, pnVal uintp a1 = *(*uintptr)(unsafe.Pointer(paOne)) a2 = *(*uintptr)(unsafe.Pointer(paTwo)) pRet = uintptr(0) - _ = libc.Int32FromInt32(0) if a2 != 0 { n2 = _sessionSerialLen(tls, a2) if *(*Tu8)(unsafe.Pointer(a2)) != 0 { @@ -194682,7 +188409,6 @@ func _sessionMergeUpdate(tls *libc.TLS, paOut uintptr, pTab uintptr, bPatchset i aOut = *(*uintptr)(unsafe.Pointer(paOut)) if bPatchset == 0 { bRequired = 0 - _ = libc.Int32FromInt32(0) /* Write the old.* vector first. */ i = 0 for { @@ -194691,11 +188417,11 @@ func _sessionMergeUpdate(tls *libc.TLS, paOut uintptr, pTab uintptr, bPatchset i } aOld = _sessionMergeValue(tls, bp, bp+4, bp+16) aNew = _sessionMergeValue(tls, bp+8, bp+12, bp+20) - if *(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 || *(*int32)(unsafe.Pointer(bp + 16)) != *(*int32)(unsafe.Pointer(bp + 20)) || libc.Xmemcmp(tls, aOld, aNew, uint32(*(*int32)(unsafe.Pointer(bp + 20)))) != 0 { - if int32(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0 { + if *(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 || *(*int32)(unsafe.Pointer(bp + 16)) != *(*int32)(unsafe.Pointer(bp + 20)) || libc.Xmemcmp(tls, aOld, aNew, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 20)))) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0 { bRequired = int32(1) } - libc.Xmemcpy(tls, aOut, aOld, uint32(*(*int32)(unsafe.Pointer(bp + 16)))) + libc.Xmemcpy(tls, aOut, aOld, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 16)))) aOut += uintptr(*(*int32)(unsafe.Pointer(bp + 16))) } else { v2 = aOut @@ -194723,12 +188449,12 @@ func _sessionMergeUpdate(tls *libc.TLS, paOut uintptr, pTab uintptr, bPatchset i } aOld1 = _sessionMergeValue(tls, bp, bp+4, bp+24) aNew1 = _sessionMergeValue(tls, bp+8, bp+12, bp+28) - if bPatchset == 0 && (*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 || *(*int32)(unsafe.Pointer(bp + 24)) == *(*int32)(unsafe.Pointer(bp + 28)) && 0 == libc.Xmemcmp(tls, aOld1, aNew1, uint32(*(*int32)(unsafe.Pointer(bp + 28))))) { + if bPatchset == 0 && (*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 || *(*int32)(unsafe.Pointer(bp + 24)) == *(*int32)(unsafe.Pointer(bp + 28)) && 0 == libc.Xmemcmp(tls, aOld1, aNew1, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 28))))) { v4 = aOut aOut++ *(*Tu8)(unsafe.Pointer(v4)) = uint8('\000') } else { - libc.Xmemcpy(tls, aOut, aNew1, uint32(*(*int32)(unsafe.Pointer(bp + 28)))) + libc.Xmemcpy(tls, aOut, aNew1, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 28)))) aOut += uintptr(*(*int32)(unsafe.Pointer(bp + 28))) } goto _3 @@ -194761,12 +188487,11 @@ func _sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab u _, _, _, _, _, _ = a, eType, iCol, rc, z, v2 /* Used to iterate through columns */ a = (*TSessionChange)(unsafe.Pointer(pChange)).FaRecord /* Cursor used to scan change record */ if (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid != 0 { - if int32(*(*Tu8)(unsafe.Pointer(a))) != int32(SQLITE_INTEGER) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a))) != int32(SQLITE_INTEGER) { return 0 } return libc.BoolInt32(_sessionGetI64(tls, a+1) == iRowid) } - _ = libc.Int32FromInt32(0) iCol = 0 for { if !(iCol < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -194776,8 +188501,8 @@ func _sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab u a += uintptr(_sessionSerialLen(tls, a)) } else { v2 = a - a++ /* Error code from preupdate_new/old */ - eType = int32(*(*Tu8)(unsafe.Pointer(v2))) /* Type of value from change record */ + a++ /* Error code from preupdate_new/old */ + eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v2))) /* Type of value from change record */ /* The following calls to preupdate_new() and preupdate_old() can not ** fail. This is because they cache their return values, and by the ** time control flows to here they have already been called once from @@ -194790,13 +188515,11 @@ func _sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab u /* assert( db->pPreUpdate->pUnpacked ); */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iCol, bp) } - _ = libc.Int32FromInt32(0) _ = rc /* Suppress warning about unused variable */ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp))) != eType { return 0 } /* A SessionChange object never has a NULL value in a PK column */ - _ = libc.Int32FromInt32(0) if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { *(*Ti64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, a) a += uintptr(8) @@ -194805,7 +188528,6 @@ func _sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab u return 0 } } else { - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, bp+16, bp+8, uint32(8)) if Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(bp))) != *(*float64)(unsafe.Pointer(bp + 16)) { return 0 @@ -194821,7 +188543,7 @@ func _sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab u } else { z = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp))) } - if *(*int32)(unsafe.Pointer(bp + 24)) > 0 && libc.Xmemcmp(tls, a, z, uint32(*(*int32)(unsafe.Pointer(bp + 24)))) != 0 { + if *(*int32)(unsafe.Pointer(bp + 24)) > 0 && libc.Xmemcmp(tls, a, z, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))) != 0 { return 0 } a += uintptr(*(*int32)(unsafe.Pointer(bp + 24))) @@ -194867,7 +188589,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint32(int64(4)*nNew)) + libc.Xmemset(tls, apNew, 0, libc.Uint32FromInt64(int64(4)*nNew)) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -194878,8 +188600,8 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin if !(p != 0) { break } - bPkOnly = libc.BoolInt32(int32((*TSessionChange)(unsafe.Pointer(p)).Fop) == int32(SQLITE_DELETE) && bPatchset != 0) - iHash = int32(_sessionChangeHash(tls, pTab, bPkOnly, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, int32(nNew))) + bPkOnly = libc.BoolInt32(libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(p)).Fop) == int32(SQLITE_DELETE) && bPatchset != 0) + iHash = libc.Int32FromUint32(_sessionChangeHash(tls, pTab, bPkOnly, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, int32(nNew))) pNext = (*TSessionChange)(unsafe.Pointer(p)).FpNext (*TSessionChange)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*4)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*4)) = p @@ -194943,7 +188665,6 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, azDflt = uintptr(0) abPK = uintptr(0) bRowid = 0 /* Set to true to use rowid as PK */ - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(pazCol)) = uintptr(0) *(*uintptr)(unsafe.Pointer(pabPK)) = uintptr(0) *(*int32)(unsafe.Pointer(pnCol)) = 0 @@ -194958,7 +188679,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33444, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33473, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1662, 0) @@ -194967,7 +188688,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33565, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33594, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -194991,15 +188712,15 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte += int64(libc.Xstrlen(tls, __ccgo_ts+29786)) + nByte += libc.Int64FromUint32(libc.Xstrlen(tls, __ccgo_ts+29815)) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte += int64(uint32(nDbCol) * (libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2) + libc.Uint32FromInt64(1) + libc.Uint32FromInt32(1) + libc.Uint32FromInt32(1))) + nByte += libc.Int64FromUint32(libc.Uint32FromInt32(nDbCol) * (libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2) + libc.Uint32FromInt64(1) + libc.Uint32FromInt32(1) + libc.Uint32FromInt32(1))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pAlloc, 0, uint32(nByte)) + libc.Xmemset(tls, pAlloc, 0, libc.Uint32FromInt64(nByte)) } } if rc == SQLITE_OK { @@ -195009,14 +188730,14 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, abPK = pAlloc pAlloc = abPK + uintptr(nDbCol) if pzTab != 0 { - libc.Xmemcpy(tls, pAlloc, zThis, uint32(nThis+int32(1))) + libc.Xmemcpy(tls, pAlloc, zThis, libc.Uint32FromInt32(nThis+int32(1))) *(*uintptr)(unsafe.Pointer(pzTab)) = pAlloc pAlloc += uintptr(nThis + int32(1)) } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29786) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29786, nName+uint32(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29815) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29815, nName+uint32(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)) = pAlloc pAlloc += uintptr(nName + uint32(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -195030,17 +188751,17 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, if zName == uintptr(0) { break } - libc.Xmemcpy(tls, pAlloc, zName, uint32(nName1+int32(1))) + libc.Xmemcpy(tls, pAlloc, zName, libc.Uint32FromInt32(nName1+int32(1))) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)) = pAlloc pAlloc += uintptr(nName1 + int32(1)) if zDflt != 0 { - libc.Xmemcpy(tls, pAlloc, zDflt, uint32(nDflt+int32(1))) + libc.Xmemcpy(tls, pAlloc, zDflt, libc.Uint32FromInt32(nDflt+int32(1))) *(*uintptr)(unsafe.Pointer(azDflt + uintptr(i)*4)) = pAlloc pAlloc += uintptr(nDflt + int32(1)) } else { *(*uintptr)(unsafe.Pointer(azDflt + uintptr(i)*4)) = uintptr(0) } - *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5))) + *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = libc.Uint8FromInt32(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5))) i++ } rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -195087,7 +188808,6 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _ = i, rc, v1 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { - _ = libc.Int32FromInt32(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 16 } else { @@ -195113,7 +188833,7 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { - *(*Ti64)(unsafe.Pointer(pSession + 48)) += int64(uint32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint32FromInt32(1)) + *(*Ti64)(unsafe.Pointer(pSession + 48)) += libc.Int64FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint32FromInt32(1)) } } } @@ -195145,7 +188865,6 @@ func _sessionReinitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) (r int32 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = 0 - _ = libc.Int32FromInt32(0) if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = bp + 16 } else { @@ -195163,7 +188882,7 @@ func _sessionReinitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) (r int32 break } if ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol { - if int32(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii)))) != int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)) + uintptr(ii)))) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii)))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)) + uintptr(ii)))) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc = int32(SQLITE_SCHEMA) } } else { @@ -195212,11 +188931,11 @@ func _sessionUpdateOneChange(tls *libc.TLS, pSession uintptr, pRc uintptr, pp ui var _ /* rVal at bp+0 */ float64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = eType, iField, iVal, n, n1, n2, nByte, nIncr, pNew, pOld, z, z1, v1, v2, v3 pOld = *(*uintptr)(unsafe.Pointer(pp)) - for int32((*TSessionChange)(unsafe.Pointer(pOld)).FnRecordField) < nCol { + for libc.Int32FromUint16((*TSessionChange)(unsafe.Pointer(pOld)).FnRecordField) < nCol { pNew = uintptr(0) nByte = 0 nIncr = 0 - iField = int32((*TSessionChange)(unsafe.Pointer(pOld)).FnRecordField) + iField = libc.Int32FromUint16((*TSessionChange)(unsafe.Pointer(pOld)).FnRecordField) eType = Xsqlite3_column_type(tls, pDflt, iField) switch eType { case int32(SQLITE_NULL): @@ -195228,10 +188947,9 @@ func _sessionUpdateOneChange(tls *libc.TLS, pSession uintptr, pRc uintptr, pp ui default: n = Xsqlite3_column_bytes(tls, pDflt, iField) nIncr = int32(1) + _sessionVarintLen(tls, n) + n - _ = libc.Int32FromInt32(0) break } - nByte = int32(uint32(nIncr) + (uint32(20) + uint32((*TSessionChange)(unsafe.Pointer(pOld)).FnRecord))) + nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nIncr) + (uint32(20) + libc.Uint32FromInt32((*TSessionChange)(unsafe.Pointer(pOld)).FnRecord))) pNew = _sessionMalloc64(tls, pSession, int64(nByte)) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) @@ -195239,11 +188957,11 @@ func _sessionUpdateOneChange(tls *libc.TLS, pSession uintptr, pRc uintptr, pp ui } else { libc.Xmemcpy(tls, pNew, pOld, uint32(20)) (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord = pNew + 1*20 - libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord, (*TSessionChange)(unsafe.Pointer(pOld)).FaRecord, uint32((*TSessionChange)(unsafe.Pointer(pOld)).FnRecord)) + libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord, (*TSessionChange)(unsafe.Pointer(pOld)).FaRecord, libc.Uint32FromInt32((*TSessionChange)(unsafe.Pointer(pOld)).FnRecord)) v2 = pNew + 8 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ - *(*Tu8)(unsafe.Pointer((*TSessionChange)(unsafe.Pointer(pNew)).FaRecord + uintptr(v1))) = uint8(eType) + *(*Tu8)(unsafe.Pointer((*TSessionChange)(unsafe.Pointer(pNew)).FaRecord + uintptr(v1))) = libc.Uint8FromInt32(eType) switch eType { case int32(SQLITE_INTEGER): iVal = Xsqlite3_column_int64(tls, pDflt, iField) @@ -195259,16 +188977,15 @@ func _sessionUpdateOneChange(tls *libc.TLS, pSession uintptr, pRc uintptr, pp ui n1 = Xsqlite3_column_bytes(tls, pDflt, iField) z = Xsqlite3_column_text(tls, pDflt, iField) *(*int32)(unsafe.Pointer(pNew + 8)) += _sessionVarintPut(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), n1) - libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), z, uint32(n1)) + libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), z, libc.Uint32FromInt32(n1)) *(*int32)(unsafe.Pointer(pNew + 8)) += n1 case int32(SQLITE_BLOB): n2 = Xsqlite3_column_bytes(tls, pDflt, iField) z1 = Xsqlite3_column_blob(tls, pDflt, iField) *(*int32)(unsafe.Pointer(pNew + 8)) += _sessionVarintPut(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), n2) - libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), z1, uint32(n2)) + libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), z1, libc.Uint32FromInt32(n2)) *(*int32)(unsafe.Pointer(pNew + 8)) += n2 default: - _ = libc.Int32FromInt32(0) break } _sessionFree(tls, pSession, pOld) @@ -195321,7 +189038,7 @@ func _sessionBufferGrow(tls *libc.TLS, p uintptr, nByte Ti64, pRc uintptr) (r in return int32(1) } } - aNew = Xsqlite3_realloc64(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf, uint64(nNew)) + aNew = Xsqlite3_realloc64(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf, libc.Uint64FromInt64(nNew)) if uintptr(0) == aNew { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } else { @@ -195347,7 +189064,7 @@ func _sessionAppendStr(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { _ = nStr nStr = _sqlite3Strlen30(tls, zStr) if 0 == _sessionBufferGrow(tls, p, int64(nStr+int32(1)), pRc) { - libc.Xmemcpy(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf), zStr, uint32(nStr)) + libc.Xmemcpy(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf), zStr, libc.Uint32FromInt32(nStr)) *(*int32)(unsafe.Pointer(p + 4)) += nStr *(*Tu8)(unsafe.Pointer((*TSessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf))) = uint8(0x00) } @@ -195403,7 +189120,7 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin zSep = __ccgo_ts + 11327 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33594, 0) + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33623, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -195460,7 +189177,7 @@ func _sessionUpdateChanges(tls *libc.TLS, pSession uintptr, pTab uintptr) (r int if !(*(*uintptr)(unsafe.Pointer(pp)) != 0) { break } - if int32((*TSessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FnRecordField) != (*TSessionTable)(unsafe.Pointer(pTab)).FnCol { + if libc.Int32FromUint16((*TSessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FnRecordField) != (*TSessionTable)(unsafe.Pointer(pTab)).FnCol { _sessionUpdateOneChange(tls, pSession, bp+4, pp, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol, *(*uintptr)(unsafe.Pointer(bp))) } goto _2 @@ -195565,7 +189282,7 @@ func _sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintp var _ /* p at bp+8 */ uintptr _, _, _, _, _, _, _, _ = bChanged, eType, ii, ii1, nIncr, nOld, pCsr, v3 *(*Ti64)(unsafe.Pointer(bp)) = int64(2) - if int32((*TSessionChange)(unsafe.Pointer(pC)).Fop) == int32(SQLITE_INSERT) { + if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(pC)).Fop) == int32(SQLITE_INSERT) { if (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid != 0 { *(*Ti64)(unsafe.Pointer(bp)) += int64(9) } @@ -195610,7 +189327,7 @@ func _sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintp } v3 = pCsr pCsr++ - eType = int32(*(*Tu8)(unsafe.Pointer(v3))) + eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v3))) switch eType { case int32(SQLITE_NULL): bChanged = libc.BoolInt32(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) != int32(SQLITE_NULL)) @@ -195632,8 +189349,7 @@ func _sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintp nOld = _sessionVarintGet(tls, pCsr, bp+32) pCsr += uintptr(nOld) nOld += *(*int32)(unsafe.Pointer(bp + 32)) - _ = libc.Int32FromInt32(0) - if eType == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) && *(*int32)(unsafe.Pointer(bp + 32)) == Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) && (*(*int32)(unsafe.Pointer(bp + 32)) == 0 || 0 == libc.Xmemcmp(tls, pCsr, Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp + 12))), uint32(*(*int32)(unsafe.Pointer(bp + 32))))) { + if eType == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) && *(*int32)(unsafe.Pointer(bp + 32)) == Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) && (*(*int32)(unsafe.Pointer(bp + 32)) == 0 || 0 == libc.Xmemcmp(tls, pCsr, Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp + 12))), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 32))))) { bChanged = 0 } pCsr += uintptr(*(*int32)(unsafe.Pointer(bp + 32))) @@ -195761,7 +189477,6 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u pC = (*TSessionChange)(unsafe.Pointer(pC)).FpNext } if pC == uintptr(0) { /* Used to iterate through columns */ - _ = libc.Int32FromInt32(0) (*TSessionTable)(unsafe.Pointer(pTab)).FnEntry++ /* Figure out how large an allocation is required */ *(*Tsqlite3_int64)(unsafe.Pointer(bp + 32)) = int64(20) @@ -195773,11 +189488,9 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) if op != int32(SQLITE_INSERT) { (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+40) - _ = libc.Int32FromInt32(0) } else { if *(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 { (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+40) - _ = libc.Int32FromInt32(0) } } /* This may fail if SQLite value p contains a utf-16 string that must @@ -195836,9 +189549,9 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbIndirect != 0 || (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx) != 0 { (*TSessionChange)(unsafe.Pointer(pC)).FbIndirect = uint8(1) } - (*TSessionChange)(unsafe.Pointer(pC)).FnRecordField = uint16((*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + (*TSessionChange)(unsafe.Pointer(pC)).FnRecordField = libc.Uint16FromInt32((*TSessionTable)(unsafe.Pointer(pTab)).FnCol) (*TSessionChange)(unsafe.Pointer(pC)).FnRecord = int32(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 32))) - (*TSessionChange)(unsafe.Pointer(pC)).Fop = uint8(op) + (*TSessionChange)(unsafe.Pointer(pC)).Fop = libc.Uint8FromInt32(op) (*TSessionChange)(unsafe.Pointer(pC)).FpNext = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(*(*int32)(unsafe.Pointer(bp)))*4)) *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(*(*int32)(unsafe.Pointer(bp)))*4)) = pC } else { @@ -195850,7 +189563,6 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } } - _ = libc.Int32FromInt32(0) if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { rc = _sessionUpdateMaxSize(tls, op, pSession, pTab, pC) } @@ -195897,12 +189609,9 @@ func _sessionFindTable(tls *libc.TLS, pSession uintptr, zName uintptr, ppTab uin for pRet != 0 && (*TSessionTable)(unsafe.Pointer(pRet)).FpNext != 0 { pRet = (*TSessionTable)(unsafe.Pointer(pRet)).FpNext } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } } } - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(ppTab)) = pRet return rc } @@ -195920,7 +189629,6 @@ func _xPreUpdate(tls *libc.TLS, pCtx uintptr, db uintptr, op int32, zDb uintptr, var _ /* pTab at bp+0 */ uintptr _, _ = nDb, pSession nDb = _sqlite3Strlen30(tls, zDb) - _ = libc.Int32FromInt32(0) _ = iKey1 _ = iKey2 pSession = pCtx @@ -195942,8 +189650,6 @@ func _xPreUpdate(tls *libc.TLS, pCtx uintptr, db uintptr, op int32, zDb uintptr, } (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc = _sessionFindTable(tls, pSession, zName, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _sessionPreupdateOneChange(tls, op, iKey1, pSession, *(*uintptr)(unsafe.Pointer(bp))) if op == int32(SQLITE_UPDATE) { _sessionPreupdateOneChange(tls, int32(SQLITE_INSERT), iKey2, pSession, *(*uintptr)(unsafe.Pointer(bp))) @@ -196074,7 +189780,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33601, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33630, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) zSep = __ccgo_ts + 22158 if zRet == uintptr(0) { break @@ -196102,10 +189808,10 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint if !(i < nCol) { break } - if int32(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33635, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 33676 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33664, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + zSep = __ccgo_ts + 33705 if zRet == uintptr(0) { break } @@ -196116,7 +189822,6 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - _ = libc.Int32FromInt32(0) zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1782, 0) } return zRet @@ -196128,12 +189833,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33681 + v1 = __ccgo_ts + 33710 } else { v1 = __ccgo_ts + 6654 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33692, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33721, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -196198,7 +189903,7 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { } else { v2 = __ccgo_ts + 1662 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33771, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*4)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33800, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*4)))) if !(zRet != 0) { break } @@ -196226,7 +189931,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33790, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33819, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -196307,7 +190012,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u if !(i < *(*int32)(unsafe.Pointer(bp + 16))) { break } - if int32(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FabPK + uintptr(i)))) != int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + uintptr(i)))) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FabPK + uintptr(i)))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + uintptr(i)))) { bMismatch = int32(1) } if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)) + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FazCol + uintptr(i)*4))) != 0 { @@ -196326,7 +190031,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 28))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33847, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33876, 0) } rc = int32(SQLITE_SCHEMA) } @@ -196374,7 +190079,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(uint32(88)+uint32(nDb)+uint32(1))) + pNew = Xsqlite3_malloc64(tls, uint64(uint32(88)+libc.Uint32FromInt32(nDb)+uint32(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -196382,7 +190087,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui (*Tsqlite3_session)(unsafe.Pointer(pNew)).Fdb = db (*Tsqlite3_session)(unsafe.Pointer(pNew)).FzDb = pNew + 1*88 (*Tsqlite3_session)(unsafe.Pointer(pNew)).FbEnable = int32(1) - libc.Xmemcpy(tls, (*Tsqlite3_session)(unsafe.Pointer(pNew)).FzDb, zDb, uint32(nDb+int32(1))) + libc.Xmemcpy(tls, (*Tsqlite3_session)(unsafe.Pointer(pNew)).FzDb, zDb, libc.Uint32FromInt32(nDb+int32(1))) _sessionPreupdateHooks(tls, pNew) /* Add the new session object to the linked list of session objects ** attached to database handle $db. Do this under the cover of the db @@ -196534,14 +190239,14 @@ func Xsqlite3session_attach(tls *libc.TLS, pSession uintptr, zName uintptr) (r i } if !(pTab != 0) { /* Allocate new SessionTable object. */ - nByte = int32(uint32(48) + uint32(nName) + uint32(1)) + nByte = libc.Int32FromUint32(uint32(48) + libc.Uint32FromInt32(nName) + uint32(1)) pTab = _sessionMalloc64(tls, pSession, int64(nByte)) if !(pTab != 0) { rc = int32(SQLITE_NOMEM) } else { libc.Xmemset(tls, pTab, 0, uint32(48)) (*TSessionTable)(unsafe.Pointer(pTab)).FzName = pTab + 1*48 - libc.Xmemcpy(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zName, uint32(nName+int32(1))) + libc.Xmemcpy(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zName, libc.Uint32FromInt32(nName+int32(1))) ppTab = pSession + 64 for { if !(*(*uintptr)(unsafe.Pointer(ppTab)) != 0) { @@ -196639,7 +190344,7 @@ func _sessionAppendVarint(tls *libc.TLS, p uintptr, v int32, pRc uintptr) { // */ func _sessionAppendBlob(tls *libc.TLS, p uintptr, aBlob uintptr, nBlob int32, pRc uintptr) { if nBlob > 0 && 0 == _sessionBufferGrow(tls, p, int64(nBlob), pRc) { - libc.Xmemcpy(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf), aBlob, uint32(nBlob)) + libc.Xmemcpy(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf), aBlob, libc.Uint32FromInt32(nBlob)) *(*int32)(unsafe.Pointer(p + 4)) += nBlob } } @@ -196658,7 +190363,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]int8 - Xsqlite3_snprintf(tls, int32(libc.Uint32FromInt64(24)-libc.Uint32FromInt32(1)), bp, __ccgo_ts+5202, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint32(libc.Uint32FromInt64(24)-libc.Uint32FromInt32(1)), bp, __ccgo_ts+5202, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -196723,7 +190428,7 @@ func _sessionAppendCol(tls *libc.TLS, p uintptr, pStmt uintptr, iCol int32, pRc _, _, _ = eType, nByte, z if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { eType = Xsqlite3_column_type(tls, pStmt, iCol) - _sessionAppendByte(tls, p, uint8(eType), pRc) + _sessionAppendByte(tls, p, libc.Uint8FromInt32(eType), pRc) if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if eType == int32(SQLITE_INTEGER) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = Xsqlite3_column_int64(tls, pStmt, iCol) @@ -196791,7 +190496,6 @@ func _sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt ui bNoop = int32(1) /* Set to zero if any values are modified */ nRewind = (*TSessionBuffer)(unsafe.Pointer(pBuf)).FnBuf /* Used to iterate through columns */ pCsr = (*TSessionChange)(unsafe.Pointer(p)).FaRecord /* Used to iterate through old.* values */ - _ = libc.Int32FromInt32(0) _sessionAppendByte(tls, pBuf, uint8(SQLITE_UPDATE), bp) _sessionAppendByte(tls, pBuf, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) i = 0 @@ -196800,7 +190504,7 @@ func _sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt ui break } bChanged = 0 - eType = int32(*(*Tu8)(unsafe.Pointer(pCsr))) + eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCsr))) switch eType { case int32(SQLITE_NULL): nAdvance = int32(1) @@ -196827,9 +190531,8 @@ func _sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt ui bChanged = int32(1) default: nHdr = int32(1) + _sessionVarintGet(tls, pCsr+1, bp+32) - _ = libc.Int32FromInt32(0) nAdvance = nHdr + *(*int32)(unsafe.Pointer(bp + 32)) - if eType == Xsqlite3_column_type(tls, pStmt, i) && *(*int32)(unsafe.Pointer(bp + 32)) == Xsqlite3_column_bytes(tls, pStmt, i) && (*(*int32)(unsafe.Pointer(bp + 32)) == 0 || 0 == libc.Xmemcmp(tls, pCsr+uintptr(nHdr), Xsqlite3_column_blob(tls, pStmt, i), uint32(*(*int32)(unsafe.Pointer(bp + 32))))) { + if eType == Xsqlite3_column_type(tls, pStmt, i) && *(*int32)(unsafe.Pointer(bp + 32)) == Xsqlite3_column_bytes(tls, pStmt, i) && (*(*int32)(unsafe.Pointer(bp + 32)) == 0 || 0 == libc.Xmemcmp(tls, pCsr+uintptr(nHdr), Xsqlite3_column_blob(tls, pStmt, i), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 32))))) { break } bChanged = int32(1) @@ -196899,12 +190602,11 @@ func _sessionAppendDelete(tls *libc.TLS, pBuf uintptr, bPatchset int32, p uintpt pStart = a v2 = a a++ - eType = int32(*(*Tu8)(unsafe.Pointer(v2))) + eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v2))) switch eType { case 0: fallthrough case int32(SQLITE_NULL): - _ = libc.Int32FromInt32(0) case int32(SQLITE_FLOAT): fallthrough case int32(SQLITE_INTEGER): @@ -196922,7 +190624,6 @@ func _sessionAppendDelete(tls *libc.TLS, pBuf uintptr, bPatchset int32, p uintpt ; i++ } - _ = libc.Int32FromInt32(0) } return *(*int32)(unsafe.Pointer(bp)) } @@ -196955,7 +190656,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt zSql = uintptr(0) zSep = __ccgo_ts + 1662 if bRowid != 0 { - v1 = __ccgo_ts + 33681 + v1 = __ccgo_ts + 33710 } else { v1 = __ccgo_ts + 6654 } @@ -196964,12 +190665,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 16)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 28)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+4, __ccgo_ts+33874, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+33903, bp) if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11707, zTab) { - _sessionAppendStr(tls, bp+4, __ccgo_ts+33878, bp) - _sessionAppendStr(tls, bp+16, __ccgo_ts+33902, bp) - _sessionAppendStr(tls, bp+28, __ccgo_ts+33911, bp) - zCols = __ccgo_ts + 33956 + _sessionAppendStr(tls, bp+4, __ccgo_ts+33907, bp) + _sessionAppendStr(tls, bp+16, __ccgo_ts+33931, bp) + _sessionAppendStr(tls, bp+28, __ccgo_ts+33940, bp) + zCols = __ccgo_ts + 33985 } else { i = 0 for { @@ -196981,9 +190682,9 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt _sessionAppendStr(tls, bp+28, zSep, bp) zSep = __ccgo_ts + 15083 _sessionAppendIdent(tls, bp+16, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) - _sessionAppendPrintf(tls, bp+28, bp, __ccgo_ts+33970, libc.VaList(bp+48, i+int32(1))) + _sessionAppendPrintf(tls, bp+28, bp, __ccgo_ts+33999, libc.VaList(bp+48, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+4, bp, __ccgo_ts+33974, libc.VaList(bp+48, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + _sessionAppendPrintf(tls, bp+4, bp, __ccgo_ts+34003, libc.VaList(bp+48, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) } goto _2 _2: @@ -196997,7 +190698,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v3 = __ccgo_ts + 1662 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34001, libc.VaList(bp+48, zCols, v3, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 28))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34030, libc.VaList(bp+48, zCols, v3, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 28))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -197042,12 +190743,11 @@ func _sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr } v2 = a a++ - eType = int32(*(*Tu8)(unsafe.Pointer(v2))) + eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v2))) switch eType { case 0: fallthrough case int32(SQLITE_NULL): - _ = libc.Int32FromInt32(0) case int32(SQLITE_INTEGER): if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { iVal = _sessionGetI64(tls, a) @@ -197068,7 +190768,6 @@ func _sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr } a += uintptr(*(*int32)(unsafe.Pointer(bp + 16))) default: - _ = libc.Int32FromInt32(0) a += uintptr(_sessionVarintGet(tls, a, bp+20)) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { rc = Xsqlite3_bind_blob(tls, pSelect, i+int32(1), a, *(*int32)(unsafe.Pointer(bp + 20)), uintptr(-libc.Int32FromInt32(1))) @@ -197101,10 +190800,10 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u } else { v1 = int32('T') } - _sessionAppendByte(tls, pBuf, uint8(v1), pRc) + _sessionAppendByte(tls, pBuf, libc.Uint8FromInt32(v1), pRc) _sessionAppendVarint(tls, pBuf, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol, pRc) _sessionAppendBlob(tls, pBuf, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol, pRc) - _sessionAppendBlob(tls, pBuf, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, int32(libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName))+int32(1), pRc) + _sessionAppendBlob(tls, pBuf, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, libc.Int32FromUint32(libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName))+int32(1), pRc) } // C documentation @@ -197130,20 +190829,17 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, _, _, _, _, _, _, _, _, _ = db, i, iCol, nNoop, nOldCol, nRewind, p, pTab, zName db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Used to iterate through attached tables */ *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} /* Return code */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ if xOutput == uintptr(0) { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34043, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34072, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -197185,7 +190881,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, goto _3 } if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) == int32(SQLITE_ROW) { - if int32((*TSessionChange)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INSERT) { + if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INSERT) { _sessionAppendByte(tls, bp, uint8(SQLITE_INSERT), bp+12) _sessionAppendByte(tls, bp, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp+12) iCol = 0 @@ -197200,11 +190896,10 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, iCol++ } } else { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp + 12)) = _sessionAppendUpdate(tls, bp, bPatchset, *(*uintptr)(unsafe.Pointer(bp + 16)), p, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK) } } else { - if int32((*TSessionChange)(unsafe.Pointer(p)).Fop) != int32(SQLITE_INSERT) { + if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(p)).Fop) != int32(SQLITE_INSERT) { *(*int32)(unsafe.Pointer(bp + 12)) = _sessionAppendDelete(tls, bp, bPatchset, p, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK) } } @@ -197250,7 +190945,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34063, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34092, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -197271,7 +190966,6 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return int32(SQLITE_MISUSE) } rc = _sessionGenerateChangeset(tls, pSession, 0, uintptr(0), uintptr(0), pnChangeset, ppChangeset) - _ = libc.Int32FromInt32(0) return rc } @@ -197439,7 +191133,6 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ - _ = libc.Int32FromInt32(0) /* Zero the output variable in case an error occurs. */ *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) /* Allocate and initialize the iterator structure. */ @@ -197509,9 +191202,8 @@ func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { _ = nMove if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - _ = libc.Int32FromInt32(0) if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), uint32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint32FromInt32(nMove)) } (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 @@ -197577,7 +191269,7 @@ func _sessionSkipRecord(tls *libc.TLS, ppRec uintptr, nCol int32) { } v2 = aRec aRec++ - eType = int32(*(*Tu8)(unsafe.Pointer(v2))) + eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v2))) if eType == int32(SQLITE_TEXT) || eType == int32(SQLITE_BLOB) { aRec += uintptr(_sessionVarintGet(tls, aRec, bp)) aRec += uintptr(*(*int32)(unsafe.Pointer(bp))) @@ -197609,11 +191301,11 @@ func _sessionValueSetStr(tls *libc.TLS, pVal uintptr, aData uintptr, nData int32 ** argument to sqlite3ValueSetStr() and have the copy created ** automatically. But doing so makes it difficult to detect any OOM ** error. Hence the code to create the copy externally. */ - aCopy = Xsqlite3_malloc64(tls, uint64(int64(nData)+int64(1))) + aCopy = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(int64(nData)+int64(1))) if aCopy == uintptr(0) { return int32(SQLITE_NOMEM) } - libc.Xmemcpy(tls, aCopy, aData, uint32(nData)) + libc.Xmemcpy(tls, aCopy, aData, libc.Uint32FromInt32(nData)) _sqlite3ValueSetStr(tls, pVal, nData, aCopy, enc, __ccgo_fp(Xsqlite3_free)) return SQLITE_OK } @@ -197655,7 +191347,6 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap var _ /* v at bp+8 */ Tsqlite3_int64 _, _, _, _, _, _, _, _ = aVal, eType, enc, i, rc, v2, v3, v4 /* Used to iterate through columns */ rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if pbEmpty != 0 { *(*int32)(unsafe.Pointer(pbEmpty)) = int32(1) } @@ -197665,19 +191356,18 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap break } eType = 0 /* Type of value (SQLITE_NULL, TEXT etc.) */ - if abPK != 0 && int32(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { + if abPK != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { goto _1 } rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(228355)) + rc = _sqlite3CorruptError(tls, int32(228345)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ - eType = int32(*(*Tu8)(unsafe.Pointer((*TSessionInput)(unsafe.Pointer(pIn)).FaData + uintptr(v2)))) - _ = libc.Int32FromInt32(0) + eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionInput)(unsafe.Pointer(pIn)).FaData + uintptr(v2)))) if eType != 0 { if pbEmpty != 0 { *(*int32)(unsafe.Pointer(pbEmpty)) = 0 @@ -197696,14 +191386,14 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(228375)) + rc = _sqlite3CorruptError(tls, int32(228365)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) } else { v4 = 0 } - enc = uint8(v4) + enc = libc.Uint8FromInt32(v4) rc = _sessionValueSetStr(tls, *(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*4)), (*TSessionInput)(unsafe.Pointer(pIn)).FaData+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), *(*int32)(unsafe.Pointer(bp)), enc) *(*int32)(unsafe.Pointer(pIn + 8)) += *(*int32)(unsafe.Pointer(bp)) } @@ -197711,7 +191401,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(228385)) + rc = _sqlite3CorruptError(tls, int32(228375)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -197767,7 +191457,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(228433)) + rc = _sqlite3CorruptError(tls, int32(228423)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -197814,7 +191504,7 @@ func _sessionChangesetBufferRecord(tls *libc.TLS, pIn uintptr, nCol int32, pnByt if rc == SQLITE_OK { v2 = nByte nByte++ - eType = int32(*(*Tu8)(unsafe.Pointer((*TSessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext+v2)))) + eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext+v2)))) if eType == int32(SQLITE_TEXT) || eType == int32(SQLITE_BLOB) { nByte += _sessionVarintGet(tls, (*TSessionInput)(unsafe.Pointer(pIn)).FaData+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext+nByte), bp) nByte += *(*int32)(unsafe.Pointer(bp)) @@ -197862,24 +191552,23 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { var _ /* nCopy at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _ = iPK, nByte, nVarint, v1, v2 - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _sessionChangesetBufferTblhdr(tls, p, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { nVarint = _sessionVarintGet(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData+uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext), p+80) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol > 0 { *(*int32)(unsafe.Pointer(bp + 4)) -= nVarint (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext += nVarint - nByte = int32(uint32((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*uint32(4)*uint32(2) + uint32(*(*int32)(unsafe.Pointer(bp + 4)))) + nByte = libc.Int32FromUint32(libc.Uint32FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*uint32(4)*uint32(2) + libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+44, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(228521)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(228511)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - iPK = uint32(4) * uint32((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol) * uint32(2) + iPK = uint32(4) * libc.Uint32FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol) * uint32(2) libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf, 0, iPK) - libc.Xmemcpy(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf+uintptr(iPK), (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData+uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext), uint32(*(*int32)(unsafe.Pointer(bp + 4)))) + libc.Xmemcpy(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf+uintptr(iPK), (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData+uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext += *(*int32)(unsafe.Pointer(bp + 4)) } (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf @@ -197917,8 +191606,6 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin var i, nVal, v10, v16, v2, v4, v5, v7, v8 int32 var op Tu8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = abPK, apNew, apOld, i, nVal, op, v10, v12, v13, v14, v16, v2, v3, v4, v5, v6, v7, v8, v9 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the iterator is in the error-state, return immediately. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc @@ -197936,7 +191623,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin ; i++ } - libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue, 0, uint32(4)*uint32((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*uint32(2)) + libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue, 0, uint32(4)*libc.Uint32FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*uint32(2)) } /* Make sure the buffer contains at least 10 bytes of input data, or all ** remaining data if there are less than 10 bytes available. This is @@ -197956,11 +191643,11 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ op = *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v2))) - for int32(op) == int32('T') || int32(op) == int32('P') { + for libc.Int32FromUint8(op) == int32('T') || libc.Int32FromUint8(op) == int32('P') { if pbNew != 0 { *(*int32)(unsafe.Pointer(pbNew)) = int32(1) } - (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset = libc.BoolInt32(int32(op) == int32('P')) + (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset = libc.BoolInt32(libc.Int32FromUint8(op) == int32('P')) if _sessionChangesetReadTblhdr(tls, p) != 0 { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } @@ -197981,26 +191668,25 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - _ = libc.Int32FromInt32(0) - v7 = _sqlite3CorruptError(tls, int32(228607)) + v7 = _sqlite3CorruptError(tls, int32(228597)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } - (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop = int32(op) + (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop = libc.Int32FromUint8(op) v9 = p + 8 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ - (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = int32(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) + (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(228613)) + v10 = _sqlite3CorruptError(tls, int32(228603)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } if paRec != 0 { /* Number of values to buffer */ - if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0 && int32(op) == int32(SQLITE_UPDATE) { + if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0 && libc.Int32FromUint8(op) == int32(SQLITE_UPDATE) { nVal = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol * int32(2) } else { - if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && int32(op) == int32(SQLITE_DELETE) { + if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && libc.Int32FromUint8(op) == int32(SQLITE_DELETE) { nVal = 0 i = 0 for { @@ -198068,12 +191754,10 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if !(i < (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol) { break } - _ = libc.Int32FromInt32(0) if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(228657)) + v16 = _sqlite3CorruptError(tls, int32(228647)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -198108,7 +191792,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if !(i < (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol) { break } - if int32(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4)) == uintptr(0) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4)) == uintptr(0) { _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4))) *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) = uintptr(0) } @@ -198370,7 +192054,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu break } eType = *(*Tu8)(unsafe.Pointer((*TSessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*TSessionInput)(unsafe.Pointer(pInput)).FiNext))) - switch int32(eType) { + switch libc.Int32FromUint8(eType) { case int32('T'): (*TSessionInput)(unsafe.Pointer(pInput)).FiNext++ v2 = _sessionChangesetBufferTblhdr(tls, pInput, bp+32) @@ -198393,18 +192077,17 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu case int32(SQLITE_INSERT): fallthrough case int32(SQLITE_DELETE): - bIndirect = int32(*(*Tu8)(unsafe.Pointer((*TSessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*TSessionInput)(unsafe.Pointer(pInput)).FiNext+int32(1))))) - if int32(eType) == int32(SQLITE_DELETE) { + bIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*TSessionInput)(unsafe.Pointer(pInput)).FiNext+int32(1))))) + if libc.Int32FromUint8(eType) == int32(SQLITE_DELETE) { v3 = int32(SQLITE_INSERT) } else { v3 = int32(SQLITE_DELETE) } eType2 = v3 *(*int32)(unsafe.Pointer(pInput + 8)) += int32(2) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = _sessionChangesetBufferRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 16)), bp+36) - _sessionAppendByte(tls, bp+4, uint8(eType2), bp) - _sessionAppendByte(tls, bp+4, uint8(bIndirect), bp) + _sessionAppendByte(tls, bp+4, libc.Uint8FromInt32(eType2), bp) + _sessionAppendByte(tls, bp+4, libc.Uint8FromInt32(bIndirect), bp) _sessionAppendBlob(tls, bp+4, (*TSessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*TSessionInput)(unsafe.Pointer(pInput)).FiNext), *(*int32)(unsafe.Pointer(bp + 36)), bp) *(*int32)(unsafe.Pointer(pInput + 8)) += *(*int32)(unsafe.Pointer(bp + 36)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -198412,12 +192095,12 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(uint32(4)*uint32(*(*int32)(unsafe.Pointer(bp + 16)))*uint32(2))) + apVal = Xsqlite3_malloc64(tls, uint64(uint32(4)*libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 16)))*uint32(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert } - libc.Xmemset(tls, apVal, 0, uint32(4)*uint32(*(*int32)(unsafe.Pointer(bp + 16)))*uint32(2)) + libc.Xmemset(tls, apVal, 0, uint32(4)*libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 16)))*uint32(2)) } /* Write the header for the new UPDATE change. Same as the original. */ _sessionAppendByte(tls, bp+4, eType, bp) @@ -198479,15 +192162,14 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu ; iCol++ } - libc.Xmemset(tls, apVal, 0, uint32(4)*uint32(*(*int32)(unsafe.Pointer(bp + 16)))*uint32(2)) + libc.Xmemset(tls, apVal, 0, uint32(4)*libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 16)))*uint32(2)) if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(229022)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(229012)) goto finished_invert } - _ = libc.Int32FromInt32(0) if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf = 0 @@ -198496,7 +192178,6 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } } } - _ = libc.Int32FromInt32(0) if pnInverted != 0 && ppInverted != 0 { *(*int32)(unsafe.Pointer(pnInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf @@ -198636,13 +192317,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 nCol = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol nU32 = ((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol + int32(33)) / int32(32) if (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask == uintptr(0) { - (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask = Xsqlite3_malloc(tls, int32(uint32(nU32)*uint32(4))) + (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask = Xsqlite3_malloc(tls, libc.Int32FromUint32(libc.Uint32FromInt32(nU32)*uint32(4))) if (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - libc.Xmemset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, 0, uint32(nU32)*uint32(4)) + libc.Xmemset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, 0, libc.Uint32FromInt32(nU32)*uint32(4)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_CORRUPT) ii = 0 for { @@ -198650,7 +192331,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 break } if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*4)) != 0 { - *(*Tu32)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr(ii/int32(32))*4)) |= uint32(libc.Int32FromInt32(1) << (ii % libc.Int32FromInt32(32))) + *(*Tu32)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr(ii/int32(32))*4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(1) << (ii % libc.Int32FromInt32(32))) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK } goto _1 @@ -198661,14 +192342,14 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if bPatchset != 0 { - *(*Tu32)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr(nCol/int32(32))*4)) |= uint32(libc.Int32FromInt32(1) << (nCol % libc.Int32FromInt32(32))) + *(*Tu32)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr(nCol/int32(32))*4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(1) << (nCol % libc.Int32FromInt32(32))) } if (*TSessionApplyCtx)(unsafe.Pointer(p)).FpUp != 0 { nUp = 0 pp = p + 32 for int32(1) != 0 { nUp++ - if 0 == libc.Xmemcmp(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, (*TSessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaMask, uint32(nU32)*uint32(4)) { + if 0 == libc.Xmemcmp(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, (*TSessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaMask, libc.Uint32FromInt32(nU32)*uint32(4)) { pUp = *(*uintptr)(unsafe.Pointer(pp)) *(*uintptr)(unsafe.Pointer(pp)) = (*TSessionUpdate)(unsafe.Pointer(pUp)).FpNext (*TSessionUpdate)(unsafe.Pointer(pUp)).FpNext = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpUp @@ -198688,7 +192369,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } } if pUp == uintptr(0) { - nByte = int32(uint32(12) * uint32(nU32) * uint32(4)) + nByte = libc.Int32FromUint32(uint32(12) * libc.Uint32FromInt32(nU32) * uint32(4)) bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11707) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { @@ -198697,20 +192378,20 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 zSep = __ccgo_ts + 1662 libc.Xmemset(tls, bp+4, 0, uint32(12)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*12 - libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, uint32(nU32)*uint32(4)) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34081, bp) + libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint32FromInt32(nU32)*uint32(4)) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34110, bp) _sessionAppendIdent(tls, bp+4, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34094, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34123, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { break } - if int32(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*4)) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*4)) != 0 { _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34100, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34129, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(1), bp) zSep = __ccgo_ts + 15083 } @@ -198721,7 +192402,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1662 - _sessionAppendStr(tls, bp+4, __ccgo_ts+34105, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34134, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -198730,11 +192411,10 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*4)) != 0 { _sessionAppendStr(tls, bp+4, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _ = libc.Int32FromInt32(0) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34113, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34142, bp) } else { _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34188, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34217, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(2), bp) } zSep = __ccgo_ts + 22158 @@ -198759,7 +192439,6 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } } } - _ = libc.Int32FromInt32(0) if pUp != 0 { *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TSessionUpdate)(unsafe.Pointer(pUp)).FpStmt } else { @@ -198825,9 +192504,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+4, __ccgo_ts+34194, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34223, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34105, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34134, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -198837,7 +192516,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34100, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34129, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) zSep = __ccgo_ts + 22158 } @@ -198847,9 +192526,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+4, __ccgo_ts+34212, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34241, bp) _sessionAppendInteger(tls, bp+4, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+33676, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+33705, bp) zSep = __ccgo_ts + 1662 i = 0 for { @@ -198859,9 +192538,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34188, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34217, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 34220 + zSep = __ccgo_ts + 34249 } goto _2 _2: @@ -198894,7 +192573,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, int32((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6649, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+12) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6649, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+12) } // C documentation @@ -198917,7 +192596,7 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+4, __ccgo_ts+34225, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34254, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) _sessionAppendStr(tls, bp+4, __ccgo_ts+22164, bp) i = 0 @@ -198934,13 +192613,13 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34243, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34272, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34254, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34283, bp) goto _2 _2: ; @@ -198971,10 +192650,10 @@ func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { _ = rc rc = _sessionSelectRow(tls, db, __ccgo_ts+11707, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34258) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34287) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34371) + rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34400) } return rc } @@ -199029,7 +192708,6 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a ** argument iterator points to a suitable entry. Make sure that xValue ** is one of these to guarantee that it is safe to ignore the return ** in the code below. */ - _ = libc.Int32FromInt32(0) i = 0 for { if !(rc == SQLITE_OK && i < nCol) { @@ -199041,7 +192719,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(229504)) + rc = _sqlite3CorruptError(tls, int32(229494)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -199098,7 +192776,7 @@ func _sessionSeekToRow(tls *libc.TLS, pIter uintptr, p uintptr) (r int32) { if !(rc == SQLITE_OK && ii < *(*int32)(unsafe.Pointer(bp))) { break } - if int32(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 { *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) Xsqlite3changeset_new(tls, pIter, ii, bp+12) Xsqlite3_bind_int(tls, pSelect, ii+int32(1)+*(*int32)(unsafe.Pointer(bp)), libc.BoolInt32(*(*uintptr)(unsafe.Pointer(bp + 12)) == uintptr(0))) @@ -199144,23 +192822,21 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK if (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRebase != 0 { eOp = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop - if int32((*TSessionApplyCtx)(unsafe.Pointer(p)).FbRebaseStarted) == 0 { + if libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbRebaseStarted) == 0 { /* Append a table-header to the rebase buffer */ zTab = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab _sessionAppendByte(tls, p+60, uint8('T'), bp) _sessionAppendVarint(tls, p+60, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, bp) _sessionAppendBlob(tls, p+60, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, bp) - _sessionAppendBlob(tls, p+60, zTab, int32(libc.Xstrlen(tls, zTab))+int32(1), bp) + _sessionAppendBlob(tls, p+60, zTab, libc.Int32FromUint32(libc.Xstrlen(tls, zTab))+int32(1), bp) (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRebaseStarted = uint8(1) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if eOp == int32(SQLITE_DELETE) { v1 = int32(SQLITE_DELETE) } else { v1 = int32(SQLITE_INSERT) } - _sessionAppendByte(tls, p+60, uint8(v1), bp) + _sessionAppendByte(tls, p+60, libc.Uint8FromInt32(v1), bp) _sessionAppendByte(tls, p+60, libc.BoolUint8(eType == libc.Int32FromInt32(SQLITE_CHANGESET_REPLACE)), bp) i = 0 for { @@ -199232,9 +192908,6 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt _, _, _ = aBlob, nBlob, res res = 0 Xsqlite3changeset_op(tls, pIter, bp+12, bp+4, bp+8, uintptr(0)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Bind the new.* PRIMARY KEY values to the SELECT statement. */ if pbReplace != 0 { *(*int32)(unsafe.Pointer(bp)) = _sessionSeekToRow(tls, pIter, p) @@ -199272,7 +192945,6 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { switch res { case int32(SQLITE_CHANGESET_REPLACE): - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pbReplace)) = int32(1) case SQLITE_CHANGESET_OMIT: case int32(SQLITE_CHANGESET_ABORT): @@ -199325,9 +192997,6 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp var _ /* zDummy at bp+0 */ uintptr _, _, _, _, _, _, _ = abPK, bPatchset, i, pNew, pOld, rc, v1 rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) Xsqlite3changeset_op(tls, pIter, bp, bp+8, bp+4, uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 4)) == int32(SQLITE_DELETE) { if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 { @@ -199356,7 +193025,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp } Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) - if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && int32((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { + if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { @@ -199406,7 +193075,6 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp } } } else { - _ = libc.Int32FromInt32(0) if (*TSessionApplyCtx)(unsafe.Pointer(p)).FbStat1 != 0 { /* Check if there is a conflicting row. For sqlite_stat1, this needs ** to be done using a SELECT, as there is no PRIMARY KEY in the @@ -199464,12 +193132,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - _ = libc.Int32FromInt32(0) rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - _ = libc.Int32FromInt32(0) - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34515, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34544, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -199482,7 +193148,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34536, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34565, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -199511,12 +193177,12 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, pApply+48, 0, uint32(12)) *(*int32)(unsafe.Pointer(bp)) = _sessionChangesetStart(tls, bp+4, uintptr(0), uintptr(0), cons.FnBuf, cons.FaBuf, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FbInvertConstraints, int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - nByte = uint32(int32(2)*(*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol) * uint32(4) + nByte = libc.Uint32FromInt32(int32(2)*(*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol) * uint32(4) (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FbPatchset = bPatchset (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FzTab = zTab (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FnCol = (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FabPK = (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK - _sessionBufferGrow(tls, *(*uintptr)(unsafe.Pointer(bp + 4))+44, int64(nByte), bp) + _sessionBufferGrow(tls, *(*uintptr)(unsafe.Pointer(bp + 4))+44, libc.Int64FromUint32(nByte), bp) (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FapValue = (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).Ftblhdr.FaBuf if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FapValue, 0, nByte) @@ -199529,7 +193195,6 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u *(*int32)(unsafe.Pointer(bp)) = rc2 } } - _ = libc.Int32FromInt32(0) Xsqlite3_free(tls, cons.FaBuf) if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { break @@ -199570,7 +193235,6 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui rc = SQLITE_OK /* Return code */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Name of current table */ nTab = 0 - _ = libc.Int32FromInt32(0) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) libc.Xmemset(tls, bp+4, 0, uint32(80)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbRebase = libc.BoolUint8(ppRebase != 0 && pnRebase != 0) @@ -199578,10 +193242,10 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34555, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34584, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34581, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34610, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+92, bp+84, bp+88, uintptr(0)) @@ -199617,7 +193281,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui rc = int32(SQLITE_NOMEM) break } - nTab = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp)))) + nTab = libc.Int32FromUint32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp)))) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FazCol = *(*uintptr)(unsafe.Pointer(bp)) } else { nMinCol = 0 @@ -199641,15 +193305,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34611, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34640, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol < *(*int32)(unsafe.Pointer(bp + 84)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34655, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol, *(*int32)(unsafe.Pointer(bp + 84)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34684, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol, *(*int32)(unsafe.Pointer(bp + 84)))) } else { - if *(*int32)(unsafe.Pointer(bp + 84)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 96)), uint32(*(*int32)(unsafe.Pointer(bp + 84)))) != 0 { + if *(*int32)(unsafe.Pointer(bp + 84)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 96)), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 84)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34726, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34755, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol = *(*int32)(unsafe.Pointer(bp + 84)) if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11707) { @@ -199709,16 +193373,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - Xsqlite3_exec(tls, db, __ccgo_ts+34786, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34815, uintptr(0), uintptr(0), uintptr(0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34816, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) } else { - Xsqlite3_exec(tls, db, __ccgo_ts+34840, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34816, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34869, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) } } - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbRebase != 0 { *(*uintptr)(unsafe.Pointer(ppRebase)) = (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).Frebase.FaBuf *(*int32)(unsafe.Pointer(pnRebase)) = (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).Frebase.FnBuf @@ -199750,17 +193413,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh _, _, _ = bInv, rc, savedFlag /* Iterator to skip through changeset */ bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) - savedFlag = (*Tsqlite3)(unsafe.Pointer(db)).Fflags & (uint64(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) + savedFlag = (*Tsqlite3)(unsafe.Pointer(db)).Fflags & (libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) if flags&int32(SQLITE_CHANGESETAPPLY_FKNOACTION) != 0 { - *(*Tu64)(unsafe.Pointer(db + 28)) |= uint64(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32) + *(*Tu64)(unsafe.Pointer(db + 28)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32) *(*int32)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)) -= int32(32) } if rc == SQLITE_OK { rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) } if flags&int32(SQLITE_CHANGESETAPPLY_FKNOACTION) != 0 && savedFlag == uint64(0) { - _ = libc.Int32FromInt32(0) - *(*Tu64)(unsafe.Pointer(db + 28)) &= ^(uint64(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) + *(*Tu64)(unsafe.Pointer(db + 28)) &= ^(libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) *(*int32)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)) -= int32(32) } return rc @@ -199836,19 +193498,18 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = a1, a2, aExist, i, i1, n1, n2, nByte, nByte1, nIn, op1, pIn, pNew, pOut, pOut1, rc, v2, v3, v4, v6, v7 pNew = uintptr(0) rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(uint32(20)+uint32(nRec))) + pNew = Xsqlite3_malloc64(tls, uint64(uint32(20)+libc.Uint32FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } libc.Xmemset(tls, pNew, 0, uint32(20)) - (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(op2) - (*TSessionChange)(unsafe.Pointer(pNew)).FbIndirect = uint8(bIndirect) + (*TSessionChange)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op2) + (*TSessionChange)(unsafe.Pointer(pNew)).FbIndirect = libc.Uint8FromInt32(bIndirect) (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord = pNew + 1*20 if bIndirect == 0 || bRebase == 0 { (*TSessionChange)(unsafe.Pointer(pNew)).FnRecord = nRec - libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord, aRec, uint32(nRec)) + libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord, aRec, libc.Uint32FromInt32(nRec)) } else { pIn = aRec pOut = (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord @@ -199858,17 +193519,17 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i break } nIn = _sessionSerialLen(tls, pIn) - if int32(*(*Tu8)(unsafe.Pointer(pIn))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pIn))) == 0 { v2 = pOut pOut++ *(*Tu8)(unsafe.Pointer(v2)) = uint8(0) } else { - if int32(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0 { v3 = pOut pOut++ *(*Tu8)(unsafe.Pointer(v3)) = uint8(0xFF) } else { - libc.Xmemcpy(tls, pOut, pIn, uint32(nIn)) + libc.Xmemcpy(tls, pOut, pIn, libc.Uint32FromInt32(nIn)) pOut += uintptr(nIn) } } @@ -199882,19 +193543,19 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i } } else { if bRebase != 0 { - if int32((*TSessionChange)(unsafe.Pointer(pExist)).Fop) == int32(SQLITE_DELETE) && (*TSessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0 { + if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(pExist)).Fop) == int32(SQLITE_DELETE) && (*TSessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0 { *(*uintptr)(unsafe.Pointer(ppNew)) = pExist } else { - nByte = int64(uint32(nRec+(*TSessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint32(20)) - pNew = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt32(nRec+(*TSessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint32(20)) + pNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { a1 = (*TSessionChange)(unsafe.Pointer(pExist)).FaRecord a2 = aRec - libc.Xmemset(tls, pNew, 0, uint32(nByte)) + libc.Xmemset(tls, pNew, 0, libc.Uint32FromInt64(nByte)) (*TSessionChange)(unsafe.Pointer(pNew)).FbIndirect = libc.BoolUint8(bIndirect != 0 || (*TSessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0) - (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(op2) + (*TSessionChange)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op2) v4 = pNew + 1*20 (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord = v4 pOut1 = v4 @@ -199905,16 +193566,16 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i } n1 = _sessionSerialLen(tls, a1) n2 = _sessionSerialLen(tls, a2) - if int32(*(*Tu8)(unsafe.Pointer(a1))) == int32(0xFF) || int32(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i1)))) == 0 && bIndirect != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a1))) == int32(0xFF) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i1)))) == 0 && bIndirect != 0 { v6 = pOut1 pOut1++ *(*Tu8)(unsafe.Pointer(v6)) = uint8(0xFF) } else { - if int32(*(*Tu8)(unsafe.Pointer(a2))) == 0 { - libc.Xmemcpy(tls, pOut1, a1, uint32(n1)) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a2))) == 0 { + libc.Xmemcpy(tls, pOut1, a1, libc.Uint32FromInt32(n1)) pOut1 += uintptr(n1) } else { - libc.Xmemcpy(tls, pOut1, a2, uint32(n2)) + libc.Xmemcpy(tls, pOut1, a2, libc.Uint32FromInt32(n2)) pOut1 += uintptr(n2) } } @@ -199930,7 +193591,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i Xsqlite3_free(tls, pExist) } } else { - op1 = int32((*TSessionChange)(unsafe.Pointer(pExist)).Fop) + op1 = libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(pExist)).Fop) /* ** op1=INSERT, op2=INSERT -> Unsupported. Discard op2. ** op1=INSERT, op2=UPDATE -> INSERT. @@ -199949,14 +193610,13 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i } else { if op1 == int32(SQLITE_INSERT) && op2 == int32(SQLITE_DELETE) { Xsqlite3_free(tls, pExist) - _ = libc.Int32FromInt32(0) } else { aExist = (*TSessionChange)(unsafe.Pointer(pExist)).FaRecord /* Allocate a new SessionChange object. Ensure that the aRecord[] ** buffer of the new object is large enough to hold any record that ** may be generated by combining the input records. */ - nByte1 = int64(uint32(20) + uint32((*TSessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint32(nRec)) - pNew = Xsqlite3_malloc64(tls, uint64(nByte1)) + nByte1 = libc.Int64FromUint32(uint32(20) + libc.Uint32FromInt32((*TSessionChange)(unsafe.Pointer(pExist)).FnRecord) + libc.Uint32FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte1)) if !(pNew != 0) { Xsqlite3_free(tls, pExist) return int32(SQLITE_NOMEM) @@ -199968,7 +193628,6 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i *(*uintptr)(unsafe.Pointer(bp)) = v7 if op1 == int32(SQLITE_INSERT) { /* INSERT + UPDATE */ *(*uintptr)(unsafe.Pointer(bp + 4)) = aRec - _ = libc.Int32FromInt32(0) (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(SQLITE_INSERT) if bPatchset == 0 { _sessionSkipRecord(tls, bp+4, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) @@ -199976,10 +193635,9 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i _sessionMergeRecord(tls, bp, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol, aExist, *(*uintptr)(unsafe.Pointer(bp + 4))) } else { if op1 == int32(SQLITE_DELETE) { /* DELETE + INSERT */ - _ = libc.Int32FromInt32(0) (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(SQLITE_UPDATE) if bPatchset != 0 { - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), aRec, uint32(nRec)) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), aRec, libc.Uint32FromInt32(nRec)) *(*uintptr)(unsafe.Pointer(bp)) += uintptr(nRec) } else { if 0 == _sessionMergeUpdate(tls, bp, pTab, bPatchset, aExist, uintptr(0), aRec, uintptr(0)) { @@ -199991,7 +193649,6 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i if op2 == int32(SQLITE_UPDATE) { /* UPDATE + UPDATE */ *(*uintptr)(unsafe.Pointer(bp + 8)) = aExist *(*uintptr)(unsafe.Pointer(bp + 12)) = aRec - _ = libc.Int32FromInt32(0) if bPatchset == 0 { _sessionSkipRecord(tls, bp+8, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) _sessionSkipRecord(tls, bp+12, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) @@ -200002,10 +193659,9 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) } } else { /* UPDATE + DELETE */ - _ = libc.Int32FromInt32(0) (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(SQLITE_DELETE) if bPatchset != 0 { - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), aRec, uint32(nRec)) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), aRec, libc.Uint32FromInt32(nRec)) *(*uintptr)(unsafe.Pointer(bp)) += uintptr(nRec) } else { _sessionMergeRecord(tls, bp, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol, aRec, aExist) @@ -200044,12 +193700,12 @@ func _sessionChangesetCheckCompat(tls *libc.TLS, pTab uintptr, nCol int32, abPK break } if ii < nCol { - v2 = int32(*(*Tu8)(unsafe.Pointer(abPK + uintptr(ii)))) + v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(ii)))) } else { v2 = 0 } - bPK = uint8(v2) - if int32(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii)))) != int32(bPK) { + bPK = libc.Uint8FromInt32(v2) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii)))) != libc.Int32FromUint8(bPK) { return 0 } goto _1 @@ -200059,7 +193715,7 @@ func _sessionChangesetCheckCompat(tls *libc.TLS, pTab uintptr, nCol int32, abPK } return int32(1) } - return libc.BoolInt32((*TSessionTable)(unsafe.Pointer(pTab)).FnCol == nCol && 0 == libc.Xmemcmp(tls, abPK, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK, uint32(nCol))) + return libc.BoolInt32((*TSessionTable)(unsafe.Pointer(pTab)).FnCol == nCol && 0 == libc.Xmemcmp(tls, abPK, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK, libc.Uint32FromInt32(nCol))) } func _sessionChangesetExtendRecord(tls *libc.TLS, pGrp uintptr, pTab uintptr, nCol int32, op int32, aRec uintptr, nRec int32, pOut uintptr) (r int32) { @@ -200073,8 +193729,6 @@ func _sessionChangesetExtendRecord(tls *libc.TLS, pGrp uintptr, pTab uintptr, nC _, _, _, _, _, _ = eType, iOff, ii, n, z, z1 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK ii = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TSessionBuffer)(unsafe.Pointer(pOut)).FnBuf = 0 if op == int32(SQLITE_INSERT) || op == int32(SQLITE_DELETE) && (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FbPatch == 0 { /* Append the missing default column values to the record. */ @@ -200088,7 +193742,7 @@ func _sessionChangesetExtendRecord(tls *libc.TLS, pGrp uintptr, pTab uintptr, nC break } eType = Xsqlite3_column_type(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FpDfltStmt, ii) - _sessionAppendByte(tls, pOut, uint8(eType), bp) + _sessionAppendByte(tls, pOut, libc.Uint8FromInt32(eType), bp) switch eType { case int32(SQLITE_FLOAT): fallthrough @@ -200115,7 +193769,6 @@ func _sessionChangesetExtendRecord(tls *libc.TLS, pGrp uintptr, pTab uintptr, nC _sessionAppendBlob(tls, pOut, z1, n, bp) } default: - _ = libc.Int32FromInt32(0) break } goto _1 @@ -200166,7 +193819,6 @@ func _sessionChangesetExtendRecord(tls *libc.TLS, pGrp uintptr, pTab uintptr, nC ii++ } } else { - _ = libc.Int32FromInt32(0) _sessionAppendBlob(tls, pOut, aRec, nRec, bp) } } @@ -200192,7 +193844,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter _, _, _, _ = nTab, pTab, ppNew, rc rc = SQLITE_OK pTab = uintptr(0) - nTab = int32(libc.Xstrlen(tls, zTab)) + nTab = libc.Int32FromUint32(libc.Xstrlen(tls, zTab)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*uintptr)(unsafe.Pointer(ppTab)) = uintptr(0) @@ -200213,21 +193865,20 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(uint32(48)+uint32(*(*int32)(unsafe.Pointer(bp + 4)))+uint32(nTab)+uint32(1))) + pTab = Xsqlite3_malloc64(tls, uint64(uint32(48)+libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))+libc.Uint32FromInt32(nTab)+uint32(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } libc.Xmemset(tls, pTab, 0, uint32(48)) (*TSessionTable)(unsafe.Pointer(pTab)).FnCol = *(*int32)(unsafe.Pointer(bp + 4)) (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = pTab + 1*48 - libc.Xmemcpy(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK, *(*uintptr)(unsafe.Pointer(bp)), uint32(*(*int32)(unsafe.Pointer(bp + 4)))) + libc.Xmemcpy(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK, *(*uintptr)(unsafe.Pointer(bp)), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) (*TSessionTable)(unsafe.Pointer(pTab)).FzName = (*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(*(*int32)(unsafe.Pointer(bp + 4))) - libc.Xmemcpy(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zTab, uint32(nTab+int32(1))) + libc.Xmemcpy(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zTab, libc.Uint32FromInt32(nTab+int32(1))) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).Fdb != 0 { (*TSessionTable)(unsafe.Pointer(pTab)).FnCol = 0 rc = _sessionInitTable(tls, uintptr(0), pTab, (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).Fdb, (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb) if rc != 0 { - _ = libc.Int32FromInt32(0) Xsqlite3_free(tls, pTab) return rc } @@ -200305,7 +193956,6 @@ func _sessionOneChangeToHash(tls *libc.TLS, pGrp uintptr, pIter uintptr, bRebase rc = _sessionChangesetExtendRecord(tls, pGrp, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), aRec, nRec, pBuf) aRec = (*TSessionBuffer)(unsafe.Pointer(pBuf)).FaBuf nRec = (*TSessionBuffer)(unsafe.Pointer(pBuf)).FnBuf - _ = libc.Int32FromInt32(0) } if rc == SQLITE_OK && _sessionGrowHash(tls, uintptr(0), (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp + 16))) != 0 { rc = int32(SQLITE_NOMEM) @@ -200313,7 +193963,7 @@ func _sessionOneChangeToHash(tls *libc.TLS, pGrp uintptr, pIter uintptr, bRebase if rc == SQLITE_OK { /* Search for existing entry. If found, remove it from the hash table. ** Code below may link it back in. */ - iHash = int32(_sessionChangeHash(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), libc.BoolInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 && *(*int32)(unsafe.Pointer(bp + 4)) == int32(SQLITE_DELETE)), aRec, (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnChange)) + iHash = libc.Int32FromUint32(_sessionChangeHash(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), libc.BoolInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 && *(*int32)(unsafe.Pointer(bp + 4)) == int32(SQLITE_DELETE)), aRec, (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnChange)) pp = (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FapChange + uintptr(iHash)*4 for { if !(*(*uintptr)(unsafe.Pointer(pp)) != 0) { @@ -200322,7 +193972,7 @@ func _sessionOneChangeToHash(tls *libc.TLS, pGrp uintptr, pIter uintptr, bRebase bPkOnly1 = 0 bPkOnly2 = 0 if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 { - bPkOnly1 = libc.BoolInt32(int32((*TSessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).Fop) == int32(SQLITE_DELETE)) + bPkOnly1 = libc.BoolInt32(libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).Fop) == int32(SQLITE_DELETE)) bPkOnly2 = libc.BoolInt32(*(*int32)(unsafe.Pointer(bp + 4)) == int32(SQLITE_DELETE)) } if _sessionChangeEqual(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bPkOnly1, (*TSessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaRecord, bPkOnly2, aRec) != 0 { @@ -200407,7 +194057,6 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _, _, _ = i, p, pTab *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} - _ = libc.Int32FromInt32(0) /* Create the serialized output changeset based on the contents of the ** hash tables attached to the SessionTable objects in list p->pList. */ @@ -200683,11 +194332,11 @@ func _sessionAppendRecordMerge(tls *libc.TLS, pBuf uintptr, nCol int32, a1 uintp } nn1 = _sessionSerialLen(tls, a1) nn2 = _sessionSerialLen(tls, a2) - if int32(*(*Tu8)(unsafe.Pointer(a1))) == 0 || int32(*(*Tu8)(unsafe.Pointer(a1))) == int32(0xFF) { - libc.Xmemcpy(tls, pOut, a2, uint32(nn2)) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a1))) == 0 || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a1))) == int32(0xFF) { + libc.Xmemcpy(tls, pOut, a2, libc.Uint32FromInt32(nn2)) pOut += uintptr(nn2) } else { - libc.Xmemcpy(tls, pOut, a1, uint32(nn1)) + libc.Xmemcpy(tls, pOut, a1, libc.Uint32FromInt32(nn1)) pOut += uintptr(nn1) } a1 += uintptr(nn1) @@ -200698,7 +194347,6 @@ func _sessionAppendRecordMerge(tls *libc.TLS, pBuf uintptr, nCol int32, a1 uintp i++ } (*TSessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = int32(pOut) - int32((*TSessionBuffer)(unsafe.Pointer(pBuf)).FaBuf) - _ = libc.Int32FromInt32(0) } } @@ -200738,7 +194386,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe *(*Tu8)(unsafe.Pointer(v1)) = uint8(SQLITE_UPDATE) v2 = pOut pOut++ - *(*Tu8)(unsafe.Pointer(v2)) = uint8((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect) + *(*Tu8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect) i = 0 for { if !(i < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -200746,16 +194394,16 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe } n1 = _sessionSerialLen(tls, a1) n2 = _sessionSerialLen(tls, a2) - if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0 || int32(*(*Tu8)(unsafe.Pointer(a2))) == 0 { + if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0 || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a2))) == 0 { if !(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0) && *(*Tu8)(unsafe.Pointer(a1)) != 0 { bData = int32(1) } - libc.Xmemcpy(tls, pOut, a1, uint32(n1)) + libc.Xmemcpy(tls, pOut, a1, libc.Uint32FromInt32(n1)) pOut += uintptr(n1) } else { - if int32(*(*Tu8)(unsafe.Pointer(a2))) != int32(0xFF) && *(*Tu8)(unsafe.Pointer(a1)) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a2))) != int32(0xFF) && *(*Tu8)(unsafe.Pointer(a1)) != 0 { bData = int32(1) - libc.Xmemcpy(tls, pOut, a2, uint32(n2)) + libc.Xmemcpy(tls, pOut, a2, libc.Uint32FromInt32(n2)) pOut += uintptr(n2) } else { v4 = pOut @@ -200779,8 +194427,8 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe } n11 = _sessionSerialLen(tls, a1) n21 = _sessionSerialLen(tls, a2) - if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0 || int32(*(*Tu8)(unsafe.Pointer(a2))) != int32(0xFF) { - libc.Xmemcpy(tls, pOut, a1, uint32(n11)) + if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0 || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a2))) != int32(0xFF) { + libc.Xmemcpy(tls, pOut, a1, libc.Uint32FromInt32(n11)) pOut += uintptr(n11) } else { v6 = pOut @@ -200863,13 +194511,13 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO } else { v2 = int32('T') } - _sessionAppendByte(tls, bp+16, uint8(v2), bp) + _sessionAppendByte(tls, bp+16, libc.Uint8FromInt32(v2), bp) _sessionAppendVarint(tls, bp+16, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol, bp) _sessionAppendBlob(tls, bp+16, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol, bp) - _sessionAppendBlob(tls, bp+16, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, int32(libc.Xstrlen(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab))+int32(1), bp) + _sessionAppendBlob(tls, bp+16, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, libc.Int32FromUint32(libc.Xstrlen(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab))+int32(1), bp) } if pTab != 0 && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - iHash = int32(_sessionChangeHash(tls, pTab, 0, *(*uintptr)(unsafe.Pointer(bp + 4)), (*TSessionTable)(unsafe.Pointer(pTab)).FnChange)) + iHash = libc.Int32FromUint32(_sessionChangeHash(tls, pTab, 0, *(*uintptr)(unsafe.Pointer(bp + 4)), (*TSessionTable)(unsafe.Pointer(pTab)).FnChange)) pChange = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*4)) for { if !(pChange != 0) { @@ -200885,45 +194533,43 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO } } if pChange != 0 { - _ = libc.Int32FromInt32(0) switch (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop { case int32(SQLITE_INSERT): - if int32((*TSessionChange)(unsafe.Pointer(pChange)).Fop) == int32(SQLITE_INSERT) { + if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(pChange)).Fop) == int32(SQLITE_INSERT) { bDone = int32(1) - if int32((*TSessionChange)(unsafe.Pointer(pChange)).FbIndirect) == 0 { + if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(pChange)).FbIndirect) == 0 { _sessionAppendByte(tls, bp+16, uint8(SQLITE_UPDATE), bp) - _sessionAppendByte(tls, bp+16, uint8((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) + _sessionAppendByte(tls, bp+16, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+16, (*TSessionChange)(unsafe.Pointer(pChange)).FaRecord, (*TSessionChange)(unsafe.Pointer(pChange)).FnRecord, bp) _sessionAppendBlob(tls, bp+16, *(*uintptr)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8)), bp) } } case int32(SQLITE_UPDATE): bDone = int32(1) - if int32((*TSessionChange)(unsafe.Pointer(pChange)).Fop) == int32(SQLITE_DELETE) { - if int32((*TSessionChange)(unsafe.Pointer(pChange)).FbIndirect) == 0 { + if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(pChange)).Fop) == int32(SQLITE_DELETE) { + if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(pChange)).FbIndirect) == 0 { *(*uintptr)(unsafe.Pointer(bp + 28)) = *(*uintptr)(unsafe.Pointer(bp + 4)) _sessionSkipRecord(tls, bp+28, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) _sessionAppendByte(tls, bp+16, uint8(SQLITE_INSERT), bp) - _sessionAppendByte(tls, bp+16, uint8((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) + _sessionAppendByte(tls, bp+16, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendRecordMerge(tls, bp+16, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol, *(*uintptr)(unsafe.Pointer(bp + 28)), *(*int32)(unsafe.Pointer(bp + 8))-(int32(*(*uintptr)(unsafe.Pointer(bp + 28)))-int32(*(*uintptr)(unsafe.Pointer(bp + 4)))), (*TSessionChange)(unsafe.Pointer(pChange)).FaRecord, (*TSessionChange)(unsafe.Pointer(pChange)).FnRecord, bp) } } else { _sessionAppendPartialUpdate(tls, bp+16, pIter, *(*uintptr)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8)), (*TSessionChange)(unsafe.Pointer(pChange)).FaRecord, (*TSessionChange)(unsafe.Pointer(pChange)).FnRecord, bp) } default: - _ = libc.Int32FromInt32(0) bDone = int32(1) - if int32((*TSessionChange)(unsafe.Pointer(pChange)).Fop) == int32(SQLITE_INSERT) { + if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(pChange)).Fop) == int32(SQLITE_INSERT) { _sessionAppendByte(tls, bp+16, uint8(SQLITE_DELETE), bp) - _sessionAppendByte(tls, bp+16, uint8((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) + _sessionAppendByte(tls, bp+16, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendRecordMerge(tls, bp+16, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol, (*TSessionChange)(unsafe.Pointer(pChange)).FaRecord, (*TSessionChange)(unsafe.Pointer(pChange)).FnRecord, *(*uintptr)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8)), bp) } break } } if bDone == 0 { - _sessionAppendByte(tls, bp+16, uint8((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop), bp) - _sessionAppendByte(tls, bp+16, uint8((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) + _sessionAppendByte(tls, bp+16, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop), bp) + _sessionAppendByte(tls, bp+16, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+16, *(*uintptr)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8)), bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > _sessions_strm_chunk_size { @@ -202236,7 +195882,7 @@ func _fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, var pParse uintptr _ = pParse pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse - switch int32(fts5yymajor) { + switch libc.Int32FromUint8(fts5yymajor) { /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a @@ -202285,8 +195931,6 @@ func _fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, func _fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { var fts5yytos, v1, v2 uintptr _, _, _ = fts5yytos, v1, v2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) v2 = pParser v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2)) -= 12 @@ -202307,7 +195951,7 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { ** element left in the stack */ fts5yytos = (*Tfts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos for fts5yytos > (*Tfts5yyParser)(unsafe.Pointer(pParser)).Ffts5yystack { - if int32((*Tfts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor) >= int32(fts5YY_MIN_DSTRCTR) { + if libc.Int32FromUint8((*Tfts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor) >= int32(fts5YY_MIN_DSTRCTR) { _fts5yy_destructor(tls, pParser, (*Tfts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor, fts5yytos+4) } fts5yytos -= 12 @@ -202360,23 +196004,15 @@ func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { func _fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) (r uint8) { var i int32 _ = i - if int32(stateno) > int32(fts5YY_MAX_SHIFT) { + if libc.Int32FromUint8(stateno) > int32(fts5YY_MAX_SHIFT) { return stateno } - _ = libc.Int32FromInt32(0) for cond := true; cond; cond = int32(1) != 0 { - i = int32(_fts5yy_shift_ofst[stateno]) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - i += int32(iLookAhead) - _ = libc.Int32FromInt32(0) - if int32(_fts5yy_lookahead[i]) != int32(iLookAhead) { + i = libc.Int32FromUint8(_fts5yy_shift_ofst[stateno]) + i += libc.Int32FromUint8(iLookAhead) + if libc.Int32FromUint8(_fts5yy_lookahead[i]) != libc.Int32FromUint8(iLookAhead) { return _fts5yy_default[stateno] } else { - _ = libc.Int32FromInt32(0) return _fts5yy_action[i] } } @@ -202392,12 +196028,8 @@ func _fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) ( func _fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) (r uint8) { var i int32 _ = i - _ = libc.Int32FromInt32(0) i = int32(_fts5yy_reduce_ofst[stateno]) - _ = libc.Int32FromInt32(0) - i += int32(iLookAhead) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + i += libc.Int32FromUint8(iLookAhead) return _fts5yy_action[i] } @@ -202416,7 +196048,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34868, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34897, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -202442,9 +196074,8 @@ func _fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, f return } fts5yytos = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos - _ = libc.Int32FromInt32(0) } - if int32(fts5yyNewState) > int32(fts5YY_MAX_SHIFT) { + if libc.Int32FromUint8(fts5yyNewState) > int32(fts5YY_MAX_SHIFT) { fts5yyNewState = uint8(int32(fts5yyNewState) + (libc.Int32FromInt32(fts5YY_MIN_REDUCE) - libc.Int32FromInt32(fts5YY_MIN_SHIFTREDUCE))) } (*Tfts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fstateno = fts5yyNewState @@ -202743,19 +196374,16 @@ _29: /********** End reduce actions ************************************************/ _30: ; - _ = libc.Int32FromInt32(0) - fts5yygoto = int32(_fts5yyRuleInfoLhs[fts5yyruleno]) + fts5yygoto = libc.Int32FromUint8(_fts5yyRuleInfoLhs[fts5yyruleno]) fts5yysize = int32(_fts5yyRuleInfoNRhs[fts5yyruleno]) - fts5yyact = _fts5yy_find_reduce_action(tls, (*(*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp + uintptr(fts5yysize)*12))).Fstateno, uint8(fts5yygoto)) + fts5yyact = _fts5yy_find_reduce_action(tls, (*(*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp + uintptr(fts5yysize)*12))).Fstateno, libc.Uint8FromInt32(fts5yygoto)) /* There are no SHIFTREDUCE actions on nonterminals because the table ** generator has simplified them to pure REDUCE actions. */ - _ = libc.Int32FromInt32(0) /* It is not possible for a REDUCE to be followed by an error */ - _ = libc.Int32FromInt32(0) fts5yymsp += uintptr(fts5yysize+int32(1)) * 12 (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yymsp (*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fstateno = fts5yyact - (*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fmajor = uint8(fts5yygoto) + (*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fmajor = libc.Uint8FromInt32(fts5yygoto) return fts5yyact } @@ -202776,7 +196404,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34896, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34925, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -202790,7 +196418,6 @@ func _fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { var pParse uintptr _ = pParse pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse - _ = libc.Int32FromInt32(0) /* Here code is inserted which will be executed whenever the ** parser accepts */ /*********** Begin %parse_accept code *****************************************/ @@ -202829,14 +196456,11 @@ func _sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5y _, _, _ = fts5yyact, fts5yypParser, fts5yyruleno /* The parser action. */ fts5yypParser = fts5yyp /* The parser */ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse - _ = libc.Int32FromInt32(0) fts5yyact = (*Tfts5yyStackEntry)(unsafe.Pointer((*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos)).Fstateno for int32(1) != 0 { /* Exit by "break" */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - fts5yyact = _fts5yy_find_shift_action(tls, uint8(fts5yymajor), fts5yyact) - if int32(fts5yyact) >= int32(fts5YY_MIN_REDUCE) { - fts5yyruleno = uint32(int32(fts5yyact) - int32(fts5YY_MIN_REDUCE)) /* Reduce by this rule */ + fts5yyact = _fts5yy_find_shift_action(tls, libc.Uint8FromInt32(fts5yymajor), fts5yyact) + if libc.Int32FromUint8(fts5yyact) >= int32(fts5YY_MIN_REDUCE) { + fts5yyruleno = libc.Uint32FromInt32(libc.Int32FromUint8(fts5yyact) - int32(fts5YY_MIN_REDUCE)) /* Reduce by this rule */ /* Check that the stack is large enough to grow by a single entry ** if the RHS of the rule is empty. This ensures that there is room ** enough on the stack to push the LHS value */ @@ -202850,16 +196474,15 @@ func _sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5y } fts5yyact = _fts5yy_reduce(tls, fts5yypParser, fts5yyruleno, fts5yymajor, fts5yyminor) } else { - if int32(fts5yyact) <= int32(fts5YY_MAX_SHIFTREDUCE) { - _fts5yy_shift(tls, fts5yypParser, fts5yyact, uint8(fts5yymajor), fts5yyminor) + if libc.Int32FromUint8(fts5yyact) <= int32(fts5YY_MAX_SHIFTREDUCE) { + _fts5yy_shift(tls, fts5yypParser, fts5yyact, libc.Uint8FromInt32(fts5yymajor), fts5yyminor) break } else { - if int32(fts5yyact) == int32(fts5YY_ACCEPT_ACTION) { + if libc.Int32FromUint8(fts5yyact) == int32(fts5YY_ACCEPT_ACTION) { (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos -= 12 _fts5yy_accept(tls, fts5yypParser) return } else { - _ = libc.Int32FromInt32(0) *(*TFts5Token)(unsafe.Pointer(bp)) = fts5yyminor /* If the fts5YYNOERRORRECOVERY macro is defined, then do not attempt to ** do any kind of error recovery. Instead, simply invoke the syntax @@ -202869,7 +196492,7 @@ func _sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5y ** they intend to abandon the parse upon the first syntax error seen. */ _fts5yy_syntax_error(tls, fts5yypParser, fts5yymajor, fts5yyminor) - _fts5yy_destructor(tls, fts5yypParser, uint8(fts5yymajor), bp) + _fts5yy_destructor(tls, fts5yypParser, libc.Uint8FromInt32(fts5yymajor), bp) break } } @@ -202903,27 +196526,6 @@ func _sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) (r int32) { */ /* #include "fts5Int.h" */ -/* Declarations for math functions. - Copyright (C) 1991-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -/* - * ISO C99 Standard: 7.12 Mathematics <math.h> - */ // C documentation // @@ -203084,9 +196686,9 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in defer tls.Free(32) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && z != 0 { if n < 0 { - n = int32(libc.Xstrlen(tls, z)) + n = libc.Int32FromUint32(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+34927, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+34956, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -203145,7 +196747,6 @@ func _fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uint } if iPos == (*THighlightContext)(unsafe.Pointer(p)).Fiter.FiEnd { if (*THighlightContext)(unsafe.Pointer(p)).FbOpen == 0 { - _ = libc.Int32FromInt32(0) _fts5HighlightAppend(tls, bp, p, (*THighlightContext)(unsafe.Pointer(p)).FzOpen, -int32(1)) (*THighlightContext)(unsafe.Pointer(p)).FbOpen = int32(1) } @@ -203184,7 +196785,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+68 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 34934 + zErr = __ccgo_ts + 34963 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -203267,7 +196868,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(uint32(nNew)*uint32(4))) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint32FromInt32(nNew)*uint32(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -203430,7 +197031,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 76)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 34984 + zErr = __ccgo_ts + 35013 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -203492,7 +197093,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt if *(*int32)(unsafe.Pointer(bp + 68)) != SQLITE_OK { goto _3 } - libc.Xmemset(tls, aSeen, 0, uint32(nPhrase)) + libc.Xmemset(tls, aSeen, 0, libc.Uint32FromInt32(nPhrase)) *(*int32)(unsafe.Pointer(bp + 68)) = _fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 104)), aSeen, i, *(*int32)(unsafe.Pointer(bp + 116)), nToken, bp+124, bp+120) if *(*int32)(unsafe.Pointer(bp + 68)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 124)) > nBestScore { nBestScore = *(*int32)(unsafe.Pointer(bp + 124)) @@ -203515,7 +197116,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt jj++ } if *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 80))).FaFirst + uintptr(jj)*4)) < *(*int32)(unsafe.Pointer(bp + 116)) { - libc.Xmemset(tls, aSeen, 0, uint32(nPhrase)) + libc.Xmemset(tls, aSeen, 0, libc.Uint32FromInt32(nPhrase)) *(*int32)(unsafe.Pointer(bp + 68)) = _fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 104)), aSeen, i, *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 80))).FaFirst + uintptr(jj)*4)), nToken, bp+124, uintptr(0)) if *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 80))).FaFirst + uintptr(jj)*4)) == 0 { v5 = int32(120) @@ -203651,12 +197252,12 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = 0 /* Allocate the Fts5Bm25Data object */ nPhrase = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxPhraseCount})))(tls, pFts) - nByte = int64(uint32(20) + uint32(nPhrase*int32(2))*uint32(8)) - p = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(20) + libc.Uint32FromInt32(nPhrase*int32(2))*uint32(8)) + p = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if p == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, p, 0, uint32(nByte)) + libc.Xmemset(tls, p, 0, libc.Uint32FromInt64(nByte)) (*TFts5Bm25Data)(unsafe.Pointer(p)).FnPhrase = nPhrase (*TFts5Bm25Data)(unsafe.Pointer(p)).FaIDF = p + 1*20 (*TFts5Bm25Data)(unsafe.Pointer(p)).FaFreq = (*TFts5Bm25Data)(unsafe.Pointer(p)).FaIDF + uintptr(nPhrase)*8 @@ -203665,7 +197266,6 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) if rc == SQLITE_OK { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxRowCount})))(tls, pFts, bp) } - _ = libc.Int32FromInt32(0) if rc == SQLITE_OK { rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnTotalSize})))(tls, pFts, -int32(1), bp+8) } @@ -203747,7 +197347,7 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, rc = _fts5Bm25GetData(tls, pApi, pFts, bp) if rc == SQLITE_OK { aFreq = (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFreq - libc.Xmemset(tls, aFreq, 0, uint32(8)*uint32((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase)) + libc.Xmemset(tls, aFreq, 0, uint32(8)*libc.Uint32FromInt32((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase)) rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})))(tls, pFts, bp+4) } i = 0 @@ -203811,22 +197411,22 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35032, + FzFunc: __ccgo_ts + 35061, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35040, + FzFunc: __ccgo_ts + 35069, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35050, + FzFunc: __ccgo_ts + 35079, FxFunc: __ccgo_fp(_fts5Bm25Function), }, } rc = SQLITE_OK /* To iterate through builtin functions */ i = 0 for { - if !(rc == SQLITE_OK && i < int32(libc.Uint32FromInt64(48)/libc.Uint32FromInt64(16))) { + if !(rc == SQLITE_OK && i < libc.Int32FromUint32(libc.Uint32FromInt64(48)/libc.Uint32FromInt64(16))) { break } rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, Tfts5_extension_function, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateFunction})))(tls, pApi, aBuiltin[i].FzFunc, aBuiltin[i].FpUserData, aBuiltin[i].FxFunc, aBuiltin[i].FxDestroy) @@ -203858,13 +197458,13 @@ func _sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte Tu32 var pNew uintptr var v1 int32 _, _, _ = nNew, pNew, v1 - if uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) < nByte { + if libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) < nByte { if (*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace != 0 { v1 = (*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace } else { v1 = int32(64) } - nNew = uint64(v1) + nNew = libc.Uint64FromInt32(v1) for nNew < uint64(nByte) { nNew = nNew * uint64(2) } @@ -203873,7 +197473,7 @@ func _sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte Tu32 *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) return int32(1) } else { - (*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace = int32(nNew) + (*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace = libc.Int32FromUint64(nNew) (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp = pNew } } @@ -203889,26 +197489,26 @@ func _sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte Tu32 func _sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVal Ti64) { var v1 int32 _ = v1 - if uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+uint32(libc.Int32FromInt32(9)) <= uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { + if libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+libc.Uint32FromInt32(libc.Int32FromInt32(9)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { v1 = 0 } else { - v1 = _sqlite3Fts5BufferSize(tls, pRc, pBuf, uint32(int32(9)+(*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + v1 = _sqlite3Fts5BufferSize(tls, pRc, pBuf, libc.Uint32FromInt32(int32(9)+(*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) } if v1 != 0 { return } - *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iVal)) + *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), libc.Uint64FromInt64(iVal)) } func _sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) { - *(*Tu8)(unsafe.Pointer(aBuf)) = uint8(iVal >> int32(24) & int32(0x00FF)) - *(*Tu8)(unsafe.Pointer(aBuf + 1)) = uint8(iVal >> int32(16) & int32(0x00FF)) - *(*Tu8)(unsafe.Pointer(aBuf + 2)) = uint8(iVal >> int32(8) & int32(0x00FF)) - *(*Tu8)(unsafe.Pointer(aBuf + 3)) = uint8(iVal >> 0 & int32(0x00FF)) + *(*Tu8)(unsafe.Pointer(aBuf)) = libc.Uint8FromInt32(iVal >> int32(24) & int32(0x00FF)) + *(*Tu8)(unsafe.Pointer(aBuf + 1)) = libc.Uint8FromInt32(iVal >> int32(16) & int32(0x00FF)) + *(*Tu8)(unsafe.Pointer(aBuf + 2)) = libc.Uint8FromInt32(iVal >> int32(8) & int32(0x00FF)) + *(*Tu8)(unsafe.Pointer(aBuf + 3)) = libc.Uint8FromInt32(iVal >> 0 & int32(0x00FF)) } func _sqlite3Fts5Get32(tls *libc.TLS, aBuf uintptr) (r int32) { - return int32(uint32(*(*Tu8)(unsafe.Pointer(aBuf)))<<libc.Int32FromInt32(24) + uint32(int32(*(*Tu8)(unsafe.Pointer(aBuf + 1)))<<libc.Int32FromInt32(16)) + uint32(int32(*(*Tu8)(unsafe.Pointer(aBuf + 2)))<<libc.Int32FromInt32(8)) + uint32(*(*Tu8)(unsafe.Pointer(aBuf + 3)))) + return libc.Int32FromUint32(uint32(*(*Tu8)(unsafe.Pointer(aBuf)))<<libc.Int32FromInt32(24) + libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBuf + 1)))<<libc.Int32FromInt32(16)) + libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBuf + 2)))<<libc.Int32FromInt32(8)) + uint32(*(*Tu8)(unsafe.Pointer(aBuf + 3)))) } // C documentation @@ -203923,15 +197523,14 @@ func _sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nDat var p2 uintptr _, _ = v1, p2 if nData != 0 { - if uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+nData <= uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { + if libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+nData <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { v1 = 0 } else { - v1 = _sqlite3Fts5BufferSize(tls, pRc, pBuf, nData+uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + v1 = _sqlite3Fts5BufferSize(tls, pRc, pBuf, nData+libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) } if v1 != 0 { return } - _ = libc.Int32FromInt32(0) libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), pData, nData) p2 = pBuf + 4 *(*int32)(unsafe.Pointer(p2)) = int32(uint32(*(*int32)(unsafe.Pointer(p2))) + nData) @@ -203948,8 +197547,8 @@ func _sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nDat func _sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zStr uintptr) { var nStr int32 _ = nStr - nStr = int32(libc.Xstrlen(tls, zStr)) - _sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nStr+int32(1)), zStr) + nStr = libc.Int32FromUint32(libc.Xstrlen(tls, zStr)) + _sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, libc.Uint32FromInt32(nStr+int32(1)), zStr) (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn-- } @@ -204025,7 +197624,7 @@ func _sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) { // */ func _sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) { (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0 - _sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nData), pData) + _sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, libc.Uint32FromInt32(nData), pData) } func _sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) (r int32) { @@ -204036,14 +197635,12 @@ func _sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, pi var _ /* iVal at bp+0 */ Tu32 _, _, _, _, _ = i, iOff, v1, v2, v3 i = *(*int32)(unsafe.Pointer(pi)) - _ = libc.Int32FromInt32(0) if i >= n { /* EOF */ *(*Ti64)(unsafe.Pointer(piOff)) = int64(-int32(1)) return int32(1) } else { iOff = *(*Ti64)(unsafe.Pointer(piOff)) - _ = libc.Int32FromInt32(0) v1 = i i++ *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(a + uintptr(v1)))) @@ -204063,8 +197660,7 @@ func _sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, pi i-- i += _sqlite3Fts5GetVarint32(tls, a+uintptr(i), bp) } - iOff = int64(*(*Tu32)(unsafe.Pointer(bp))) << int32(32) - _ = libc.Int32FromInt32(0) + iOff = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) << int32(32) v3 = i i++ *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(a + uintptr(v3)))) @@ -204077,12 +197673,11 @@ func _sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, pi *(*Ti64)(unsafe.Pointer(piOff)) = int64(-int32(1)) return int32(1) } - *(*Ti64)(unsafe.Pointer(piOff)) = iOff + int64((*(*Tu32)(unsafe.Pointer(bp))-libc.Uint32FromInt32(2))&libc.Uint32FromInt32(0x7FFFFFFF)) + *(*Ti64)(unsafe.Pointer(piOff)) = iOff + libc.Int64FromUint32((*(*Tu32)(unsafe.Pointer(bp))-libc.Uint32FromInt32(2))&libc.Uint32FromInt32(0x7FFFFFFF)) } else { - *(*Ti64)(unsafe.Pointer(piOff)) = iOff&(libc.Int64FromInt32(0x7FFFFFFF)<<libc.Int32FromInt32(32)) + (iOff+int64(*(*Tu32)(unsafe.Pointer(bp))-libc.Uint32FromInt32(2)))&int64(0x7FFFFFFF) + *(*Ti64)(unsafe.Pointer(piOff)) = iOff&(libc.Int64FromInt32(0x7FFFFFFF)<<libc.Int32FromInt32(32)) + (iOff+libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))-libc.Uint32FromInt32(2)))&int64(0x7FFFFFFF) } *(*int32)(unsafe.Pointer(pi)) = i - _ = libc.Int32FromInt32(0) return 0 } return r @@ -204098,7 +197693,7 @@ func _sqlite3Fts5PoslistReaderNext(tls *libc.TLS, pIter uintptr) (r int32) { if _sqlite3Fts5PoslistNext64(tls, (*TFts5PoslistReader)(unsafe.Pointer(pIter)).Fa, (*TFts5PoslistReader)(unsafe.Pointer(pIter)).Fn, pIter+8, pIter+16) != 0 { (*TFts5PoslistReader)(unsafe.Pointer(pIter)).FbEof = uint8(1) } - return int32((*TFts5PoslistReader)(unsafe.Pointer(pIter)).FbEof) + return libc.Int32FromUint8((*TFts5PoslistReader)(unsafe.Pointer(pIter)).FbEof) } func _sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintptr) (r int32) { @@ -204106,7 +197701,7 @@ func _sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uint (*TFts5PoslistReader)(unsafe.Pointer(pIter)).Fa = a (*TFts5PoslistReader)(unsafe.Pointer(pIter)).Fn = n _sqlite3Fts5PoslistReaderNext(tls, pIter) - return int32((*TFts5PoslistReader)(unsafe.Pointer(pIter)).FbEof) + return libc.Int32FromUint8((*TFts5PoslistReader)(unsafe.Pointer(pIter)).FbEof) } // C documentation @@ -204127,10 +197722,10 @@ func _sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ *(*Tu8)(unsafe.Pointer((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(v1))) = uint8(1) - *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iPos>>libc.Int32FromInt32(32))) + *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), libc.Uint64FromInt64(iPos>>libc.Int32FromInt32(32))) *(*Ti64)(unsafe.Pointer(piPrev)) = iPos & _colmask } - *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iPos-*(*Ti64)(unsafe.Pointer(piPrev))+int64(2))) + *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), libc.Uint64FromInt64(iPos-*(*Ti64)(unsafe.Pointer(piPrev))+int64(2))) *(*Ti64)(unsafe.Pointer(piPrev)) = iPos } } @@ -204144,10 +197739,10 @@ func _sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintpt var _ /* rc at bp+0 */ int32 _ = v1 *(*int32)(unsafe.Pointer(bp)) = 0 /* Initialized only to suppress erroneous warning from Clang */ - if uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+uint32(libc.Int32FromInt32(5)+libc.Int32FromInt32(5)+libc.Int32FromInt32(5)) <= uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { + if libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+libc.Uint32FromInt32(libc.Int32FromInt32(5)+libc.Int32FromInt32(5)+libc.Int32FromInt32(5)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { v1 = 0 } else { - v1 = _sqlite3Fts5BufferSize(tls, bp, pBuf, uint32(libc.Int32FromInt32(5)+libc.Int32FromInt32(5)+libc.Int32FromInt32(5)+(*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + v1 = _sqlite3Fts5BufferSize(tls, bp, pBuf, libc.Uint32FromInt32(libc.Int32FromInt32(5)+libc.Int32FromInt32(5)+libc.Int32FromInt32(5)+(*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) } if v1 != 0 { return *(*int32)(unsafe.Pointer(bp)) @@ -204161,13 +197756,13 @@ func _sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Tsqlite3_int64) (r _ = pRet pRet = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - pRet = Xsqlite3_malloc64(tls, uint64(nByte)) + pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { if nByte > 0 { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } } else { - libc.Xmemset(tls, pRet, 0, uint32(nByte)) + libc.Xmemset(tls, pRet, 0, libc.Uint32FromInt64(nByte)) } } return pRet @@ -204189,11 +197784,11 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r zRet = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { if nIn < 0 { - nIn = int32(libc.Xstrlen(tls, pIn)) + nIn = libc.Int32FromUint32(libc.Xstrlen(tls, pIn)) } zRet = Xsqlite3_malloc(tls, nIn+int32(1)) if zRet != 0 { - libc.Xmemcpy(tls, zRet, pIn, uint32(nIn)) + libc.Xmemcpy(tls, zRet, pIn, libc.Uint32FromInt32(nIn)) *(*int8)(unsafe.Pointer(zRet + uintptr(nIn))) = int8('\000') } else { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) @@ -204344,20 +197939,20 @@ func _sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, if !(i >= 0) { break } - hash = hash<<libc.Int32FromInt32(3) ^ hash ^ uint32(*(*int8)(unsafe.Pointer(pTerm + uintptr(i)))) + hash = hash<<libc.Int32FromInt32(3) ^ hash ^ libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(pTerm + uintptr(i)))) goto _1 _1: ; i-- } - hash = hash<<libc.Int32FromInt32(3) ^ hash ^ uint32(iIdx) - hash = hash % uint32(int32(libc.Uint32FromInt64(2048)/libc.Uint32FromInt64(4))) + hash = hash<<libc.Int32FromInt32(3) ^ hash ^ libc.Uint32FromInt32(iIdx) + hash = hash % libc.Uint32FromInt32(libc.Int32FromUint32(libc.Uint32FromInt64(2048)/libc.Uint32FromInt64(4))) pEntry = *(*uintptr)(unsafe.Pointer(p + uintptr(hash)*4)) for { if !(pEntry != 0) { break } - if (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx == iIdx && (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm == nTerm && libc.Xmemcmp(tls, (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, uint32(nTerm)) == 0 { + if (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx == iIdx && (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm == nTerm && libc.Xmemcmp(tls, (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, libc.Uint32FromInt32(nTerm)) == 0 { *(*int32)(unsafe.Pointer(pbPresent)) = int32(1) break } @@ -204367,12 +197962,12 @@ func _sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, pEntry = (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext } if pEntry == uintptr(0) { - pEntry = _sqlite3Fts5MallocZero(tls, bp, int64(uint32(16)+uint32(nTerm))) + pEntry = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(uint32(16)+libc.Uint32FromInt32(nTerm))) if pEntry != 0 { (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm = pEntry + 1*16 (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm = nTerm (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx = iIdx - libc.Xmemcpy(tls, (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, uint32(nTerm)) + libc.Xmemcpy(tls, (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, libc.Uint32FromInt32(nTerm)) (*TFts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext = *(*uintptr)(unsafe.Pointer(p + uintptr(hash)*4)) *(*uintptr)(unsafe.Pointer(p + uintptr(hash)*4)) = pEntry } @@ -204388,7 +197983,7 @@ func _sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { if p != 0 { i = uint32(0) for { - if !(i < uint32(int32(libc.Uint32FromInt64(2048)/libc.Uint32FromInt64(4)))) { + if !(i < libc.Uint32FromInt32(libc.Int32FromUint32(libc.Uint32FromInt64(2048)/libc.Uint32FromInt64(4)))) { break } pEntry = *(*uintptr)(unsafe.Pointer(p + uintptr(i)*4)) @@ -204568,7 +198163,6 @@ func _fts5Dequote(tls *libc.TLS, z uintptr) (r int32) { iOut = 0 q = *(*int8)(unsafe.Pointer(z)) /* Set stack variable q to the close-quote character */ - _ = libc.Int32FromInt32(0) if int32(q) == int32('[') { q = int8(']') } @@ -204617,7 +198211,6 @@ func _fts5Dequote(tls *libc.TLS, z uintptr) (r int32) { func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { var quote int8 _ = quote /* Quote character (if any ) */ - _ = libc.Int32FromInt32(0) quote = *(*int8)(unsafe.Pointer(z)) if int32(quote) == int32('[') || int32(quote) == int32('\'') || int32(quote) == int32('"') || int32(quote) == int32('`') { _fts5Dequote(tls, z) @@ -204641,7 +198234,7 @@ type Fts5Enum = TFts5Enum func _fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintptr) (r int32) { var i, iVal, nEnum, v2 int32 _, _, _, _ = i, iVal, nEnum, v2 - nEnum = int32(libc.Xstrlen(tls, zEnum)) + nEnum = libc.Int32FromUint32(libc.Xstrlen(tls, zEnum)) iVal = -int32(1) i = 0 for { @@ -204689,9 +198282,9 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pDel, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - nCmd = int32(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35055, zCmd, nCmd) == 0 { - nByte = int32(libc.Uint32FromInt64(4) * libc.Uint32FromInt32(FTS5_MAX_PREFIX_INDEXES)) + nCmd = libc.Int32FromUint32(libc.Xstrlen(tls, zCmd)) + if Xsqlite3_strnicmp(tls, __ccgo_ts+35084, zCmd, nCmd) == 0 { + nByte = libc.Int32FromUint32(libc.Uint32FromInt64(4) * libc.Uint32FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) @@ -204716,12 +198309,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC } } if int32(*(*int8)(unsafe.Pointer(p))) < int32('0') || int32(*(*int8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35062, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35091, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35093, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35122, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -204730,7 +198323,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35126, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35155, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -204738,18 +198331,17 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix++ bFirst = 0 } - _ = libc.Int32FromInt32(0) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35163, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35192, zCmd, nCmd) == 0 { p1 = zArg - nArg = int64(libc.Xstrlen(tls, zArg) + uint32(1)) + nArg = libc.Int64FromUint32(libc.Xstrlen(tls, zArg) + uint32(1)) azArg = _sqlite3Fts5MallocZero(tls, bp, int64(4)*nArg) pDel = _sqlite3Fts5MallocZero(tls, bp, nArg*int64(2)) pSpace = pDel if azArg != 0 && pSpace != 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35172, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35201, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -204764,7 +198356,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC p1 = _fts5ConfigSkipBareword(tls, p2) } if p1 != 0 { - libc.Xmemcpy(tls, pSpace, p2, uint32(int32(p1)-int32(p2))) + libc.Xmemcpy(tls, pSpace, p2, libc.Uint32FromInt32(int32(p1)-int32(p2))) *(*uintptr)(unsafe.Pointer(azArg + uintptr(nArg)*4)) = pSpace _sqlite3Fts5Dequote(tls, pSpace) pSpace += uintptr(int32(p1) - int32(p2) + int32(1)) @@ -204776,7 +198368,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35205, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35234, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5GetTokenizer(tls, pGlobal, azArg, int32(nArg), pConfig, pzErr) @@ -204787,41 +198379,41 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC Xsqlite3_free(tls, pDel) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35239, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35268, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35247, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35276, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35279, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35308, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35285, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35314, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35304, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35333, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35347, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35376, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35361, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35390, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35399, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35428, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35410, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35439, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) @@ -204838,7 +198430,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC FzName: __ccgo_ts + 17834, }, 2: { - FzName: __ccgo_ts + 35445, + FzName: __ccgo_ts + 35474, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -204846,20 +198438,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC v2 = _fts5ConfigSetEnum(tls, bp+4, zArg, pConfig+56) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35453, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35482, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35484, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35513, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35494, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35523, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35528, libc.VaList(bp+48, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35557, libc.VaList(bp+48, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -204871,7 +198463,6 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC // ** code if an error occurs. // */ func _fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return _sqlite3Fts5GetTokenizer(tls, pGlobal, uintptr(0), 0, pConfig, uintptr(0)) } @@ -204898,15 +198489,14 @@ func _fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintpt var zOut, zRet uintptr _, _, _, _ = ii, nIn, zOut, zRet zRet = uintptr(0) - nIn = int64(libc.Xstrlen(tls, zIn)) - zOut = Xsqlite3_malloc64(tls, uint64(nIn+int64(1))) - _ = libc.Int32FromInt32(0) + nIn = libc.Int64FromUint32(libc.Xstrlen(tls, zIn)) + zOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nIn+int64(1))) *(*int32)(unsafe.Pointer(pbQuoted)) = 0 *(*uintptr)(unsafe.Pointer(pzOut)) = uintptr(0) if zOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, zOut, zIn, uint32(nIn+libc.Int64FromInt32(1))) + libc.Xmemcpy(tls, zOut, zIn, libc.Uint32FromInt64(nIn+libc.Int64FromInt32(1))) if _fts5_isopenquote(tls, *(*int8)(unsafe.Pointer(zOut))) != 0 { ii = _fts5Dequote(tls, zOut) zRet = zIn + uintptr(ii) @@ -204933,15 +198523,15 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35556) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16781) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35561, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35585) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16781) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35590, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35591) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35620) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35601, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35630, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -204967,7 +198557,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 4)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35632, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35661, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -204975,9 +198565,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35637, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35666, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35644, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35673, libc.VaList(bp+24, i)) } goto _1 _1: @@ -204985,7 +198575,6 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { i++ } } - _ = libc.Int32FromInt32(0) (*TFts5Config)(unsafe.Pointer(p)).FzContentExprlist = (*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fp return *(*int32)(unsafe.Pointer(bp)) } @@ -205026,7 +198615,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in libc.Xmemset(tls, pRet, 0, uint32(128)) (*TFts5Config)(unsafe.Pointer(pRet)).Fdb = db (*TFts5Config)(unsafe.Pointer(pRet)).FiCookie = -int32(1) - nByte = int64(uint32(nArg) * (libc.Uint32FromInt64(4) + libc.Uint32FromInt64(1))) + nByte = libc.Int64FromUint32(libc.Uint32FromInt32(nArg) * (libc.Uint32FromInt64(4) + libc.Uint32FromInt64(1))) (*TFts5Config)(unsafe.Pointer(pRet)).FazCol = _sqlite3Fts5MallocZero(tls, bp, nByte) if (*TFts5Config)(unsafe.Pointer(pRet)).FazCol != 0 { v2 = (*TFts5Config)(unsafe.Pointer(pRet)).FazCol + uintptr(nArg)*4 @@ -205038,11 +198627,10 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*4)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35556) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35652, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35585) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35681, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } - _ = libc.Int32FromInt32(0) i = int32(3) for { if !(*(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && i < nArg) { @@ -205057,7 +198645,6 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in z = _fts5ConfigSkipWhitespace(tls, z) if z != 0 && int32(*(*int8)(unsafe.Pointer(z))) == int32('=') { bOption = int32(1) - _ = libc.Int32FromInt32(0) z++ if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { z = uintptr(0) @@ -205072,7 +198659,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35681, libc.VaList(bp+32, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35710, libc.VaList(bp+32, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -205102,7 +198689,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35701, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35730, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -205110,7 +198697,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35751, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35780, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If a tokenizer= option was successfully parsed, the tokenizer has @@ -205122,16 +198709,15 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) - _ = libc.Int32FromInt32(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35239 + zTail = __ccgo_ts + 35268 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 35806 + zTail = __ccgo_ts + 35835 } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35814, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35843, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { @@ -205199,7 +198785,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35825, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35854, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -205211,14 +198797,13 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { v2 = __ccgo_ts + 15083 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35841, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35870, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35848, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35556)) - _ = libc.Int32FromInt32(0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35877, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35585)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -205318,7 +198903,7 @@ func _sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzR if p != 0 { zRank = _sqlite3Fts5MallocZero(tls, bp, int64(int32(uintptr(1)+p)-int32(pRank))) if zRank != 0 { - libc.Xmemcpy(tls, zRank, pRank, uint32(int32(p)-int32(pRank))) + libc.Xmemcpy(tls, zRank, pRank, libc.Uint32FromInt32(int32(p)-int32(pRank))) } } else { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) @@ -205340,7 +198925,7 @@ func _sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzR } else { zRankArgs = _sqlite3Fts5MallocZero(tls, bp, int64(int32(uintptr(1)+p)-int32(pArgs))) if zRankArgs != 0 { - libc.Xmemcpy(tls, zRankArgs, pArgs, uint32(int32(p)-int32(pArgs))) + libc.Xmemcpy(tls, zRankArgs, pArgs, libc.Uint32FromInt32(int32(p)-int32(pArgs))) } } } @@ -205348,7 +198933,6 @@ func _sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzR } if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { Xsqlite3_free(tls, zRank) - _ = libc.Int32FromInt32(0) } else { *(*uintptr)(unsafe.Pointer(pzRank)) = zRank *(*uintptr)(unsafe.Pointer(pzRankArgs)) = zRankArgs @@ -205365,7 +198949,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+4 */ uintptr _, _, _, _, _, _, _, _, _, _ = bVal, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35874) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35903) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -205376,7 +198960,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35879) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35908) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -205387,7 +198971,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35888) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35917) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -205401,7 +198985,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35898) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35927) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -205412,7 +198996,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35908) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35937) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -205429,7 +199013,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35920) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35949) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -205444,7 +199028,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35556) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35585) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+4) if rc == SQLITE_OK { @@ -205459,7 +199043,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35932) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35961) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -205501,7 +199085,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+4 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 35946 + zSelect = __ccgo_ts + 35975 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK iVersion = 0 @@ -205517,12 +199101,11 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in *(*int32)(unsafe.Pointer(bp + 4)) = Xsqlite3_prepare_v2(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), bp, uintptr(0)) Xsqlite3_free(tls, zSql) } - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+35978) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36007) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 8)) = 0 @@ -205534,8 +199117,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 4)) = int32(SQLITE_ERROR) if (*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg != 0 { - _ = libc.Int32FromInt32(0) - *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+35986, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+36015, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion @@ -205691,7 +199273,6 @@ func _sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uint _ = ap ap = va if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { - _ = libc.Int32FromInt32(0) (*TFts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_vmprintf(tls, zFmt, ap) (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -205757,7 +199338,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if int32(*(*int8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36057, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36086, 0) return FTS5_EOF } goto _1 @@ -205768,7 +199349,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(z2) - int32(z) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36077, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36106, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -205783,13 +199364,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(z21) - int32(z) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36108, uint32(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36137, uint32(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36111, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36140, uint32(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30852, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30881, uint32(3)) == 0 { tok = int32(FTS5_AND) } break @@ -205799,7 +199380,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } func _fts5ParseAlloc(tls *libc.TLS, t Tu64) (r uintptr) { - return Xsqlite3_malloc64(tls, uint64(int64(t))) + return Xsqlite3_malloc64(tls, libc.Uint64FromInt64(libc.Int64FromUint64(t))) } func _fts5ParseFree(tls *libc.TLS, p uintptr) { @@ -205841,7 +199422,6 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo _sqlite3Fts5ParseSetColset(tls, bp, (*(*TFts5Parse)(unsafe.Pointer(bp))).FpExpr, pColset) } } - _ = libc.Int32FromInt32(0) if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK { v1 = Xsqlite3_malloc(tls, int32(24)) pNew = v1 @@ -205870,7 +199450,11 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo _sqlite3Fts5ParseNodeFree(tls, (*(*TFts5Parse)(unsafe.Pointer(bp))).FpExpr) } Xsqlite3_free(tls, (*(*TFts5Parse)(unsafe.Pointer(bp))).FapPhrase) - *(*uintptr)(unsafe.Pointer(pzErr)) = (*(*TFts5Parse)(unsafe.Pointer(bp))).FzErr + if uintptr(0) == *(*uintptr)(unsafe.Pointer(pzErr)) { + *(*uintptr)(unsafe.Pointer(pzErr)) = (*(*TFts5Parse)(unsafe.Pointer(bp))).FzErr + } else { + Xsqlite3_free(tls, (*(*TFts5Parse)(unsafe.Pointer(bp))).FzErr) + } return (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc } @@ -205916,8 +199500,8 @@ func _sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol i var nText Ti64 var zExpr uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aSpec, bAnd, i, iFirst, iOut, jj, nText, rc, zExpr, v1, v3, v4, v5, v6 - nText = int64(libc.Xstrlen(tls, zText)) - zExpr = Xsqlite3_malloc64(tls, uint64(nText*int64(4)+int64(1))) + nText = libc.Int64FromUint32(libc.Xstrlen(tls, zText)) + zExpr = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nText*int64(4)+int64(1))) rc = SQLITE_OK if zExpr == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -206048,11 +199632,11 @@ func _sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) (r int32) { (*TFts5Expr)(unsafe.Pointer(p1)).FpRoot = _sqlite3Fts5ParseNode(tls, bp, int32(FTS5_AND), (*TFts5Expr)(unsafe.Pointer(p1)).FpRoot, (*TFts5Expr)(unsafe.Pointer(p2)).FpRoot, uintptr(0)) (*TFts5Expr)(unsafe.Pointer(p2)).FpRoot = uintptr(0) if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK { - ap = Xsqlite3_realloc(tls, (*TFts5Expr)(unsafe.Pointer(p1)).FapExprPhrase, int32(uint32(nPhrase)*uint32(4))) + ap = Xsqlite3_realloc(tls, (*TFts5Expr)(unsafe.Pointer(p1)).FapExprPhrase, libc.Int32FromUint32(libc.Uint32FromInt32(nPhrase)*uint32(4))) if ap == uintptr(0) { (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) } else { - libc.Xmemmove(tls, ap+uintptr((*TFts5Expr)(unsafe.Pointer(p2)).FnPhrase)*4, ap, uint32((*TFts5Expr)(unsafe.Pointer(p1)).FnPhrase)*uint32(4)) + libc.Xmemmove(tls, ap+uintptr((*TFts5Expr)(unsafe.Pointer(p2)).FnPhrase)*4, ap, libc.Uint32FromInt32((*TFts5Expr)(unsafe.Pointer(p1)).FnPhrase)*uint32(4)) i = 0 for { if !(i < (*TFts5Expr)(unsafe.Pointer(p2)).FnPhrase) { @@ -206091,15 +199675,12 @@ func _fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uint _, _, _, _ = bRetValid, iRet, iRowid, p iRet = 0 bRetValid = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p = pTerm for { if !(p != 0) { break } - if 0 == int32((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) { + if 0 == libc.Int32FromUint8((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) { iRowid = (*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid if bRetValid == 0 || bDesc != libc.BoolInt32(iRowid < iRet) { iRet = iRowid @@ -206136,25 +199717,24 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt nIter = 0 nAlloc = int32(4) rc = SQLITE_OK - _ = libc.Int32FromInt32(0) p = pTerm for { if !(p != 0) { break } pIter = (*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter - if int32((*TFts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 && (*TFts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == iRowid { + if libc.Int32FromUint8((*TFts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 && (*TFts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == iRowid { if (*TFts5IndexIter)(unsafe.Pointer(pIter)).FnData == 0 { goto _1 } if nIter == nAlloc { - nByte = int64(uint32(24) * uint32(nAlloc) * uint32(2)) - aNew = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(24) * libc.Uint32FromInt32(nAlloc) * uint32(2)) + aNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) goto synonym_poslist_out } - libc.Xmemcpy(tls, aNew, aIter, uint32(24)*uint32(nIter)) + libc.Xmemcpy(tls, aNew, aIter, uint32(24)*libc.Uint32FromInt32(nIter)) nAlloc = nAlloc * int32(2) if aIter != bp { Xsqlite3_free(tls, aIter) @@ -206162,7 +199742,6 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt aIter = aNew } _sqlite3Fts5PoslistReaderInit(tls, (*TFts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*TFts5IndexIter)(unsafe.Pointer(pIter)).FnData, aIter+uintptr(nIter)*24) - _ = libc.Int32FromInt32(0) nIter++ } goto _1 @@ -206184,7 +199763,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt if !(i < nIter) { break } - if int32((*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FbEof) == 0 { + if libc.Int32FromUint8((*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FbEof) == 0 { if (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FiPos == iPrev { if _sqlite3Fts5PoslistReaderNext(tls, aIter+uintptr(i)*24) != 0 { goto _2 @@ -206248,18 +199827,18 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat *(*TFts5PoslistWriter)(unsafe.Pointer(bp)) = TFts5PoslistWriter{} aIter = bp + 8 rc = SQLITE_OK - bFirst = int32((*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 20))).FbFirst) + bFirst = libc.Int32FromUint8((*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 20))).FbFirst) _sqlite3Fts5BufferZero(tls, pPhrase+4) /* If the aStatic[] array is not large enough, allocate a large array ** using sqlite3_malloc(). This approach could be improved upon. */ - if (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(libc.Uint32FromInt64(96)/libc.Uint32FromInt64(24)) { - nByte = int64(uint32(24) * uint32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm)) - aIter = Xsqlite3_malloc64(tls, uint64(nByte)) + if (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > libc.Int32FromUint32(libc.Uint32FromInt64(96)/libc.Uint32FromInt64(24)) { + nByte = libc.Int64FromUint32(uint32(24) * libc.Uint32FromInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm)) + aIter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if !(aIter != 0) { return int32(SQLITE_NOMEM) } } - libc.Xmemset(tls, aIter, 0, uint32(24)*uint32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm)) + libc.Xmemset(tls, aIter, 0, uint32(24)*libc.Uint32FromInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm)) /* Initialize a term iterator for each term in the phrase */ i = 0 for { @@ -206285,7 +199864,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat *(*int32)(unsafe.Pointer(bp + 104)) = (*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)).FnData } _sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 108)), *(*int32)(unsafe.Pointer(bp + 104)), aIter+uintptr(i)*24) - (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FbFlag = uint8(bFlag) + (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FbFlag = libc.Uint8FromInt32(bFlag) if (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FbEof != 0 { goto ismatch_out } @@ -206450,11 +200029,10 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { a = bp apPhrase = pNear + 12 *(*int32)(unsafe.Pointer(bp + 160)) = *(*int32)(unsafe.Pointer(pRc)) - _ = libc.Int32FromInt32(0) /* If the aStatic[] array is not large enough, allocate a large array ** using sqlite3_malloc(). This approach could be improved upon. */ - if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > int32(libc.Uint32FromInt64(160)/libc.Uint32FromInt64(40)) { - nByte = int64(uint32(40) * uint32((*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase)) + if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > libc.Int32FromUint32(libc.Uint32FromInt64(160)/libc.Uint32FromInt64(40)) { + nByte = libc.Int64FromUint32(uint32(40) * libc.Uint32FromInt32((*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase)) a = _sqlite3Fts5MallocZero(tls, bp+160, nByte) } else { libc.Xmemset(tls, bp, 0, uint32(160)) @@ -206588,7 +200166,6 @@ func _fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintpt return int32(1) } iRowid = (*TFts5IndexIter)(unsafe.Pointer(pIter)).FiRowid - _ = libc.Int32FromInt32(0) } *(*Ti64)(unsafe.Pointer(piLast)) = iRowid return 0 @@ -206610,7 +200187,7 @@ func _fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast if !(rc == SQLITE_OK && p != 0) { break } - if int32((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 { + if libc.Int32FromUint8((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 { iRowid = (*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid if bDesc == 0 && iLast > iRowid || bDesc != 0 && iLast < iRowid { rc = _sqlite3Fts5IterNextFrom(tls, (*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter, iLast) @@ -206649,7 +200226,7 @@ func _fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) break } pIter = (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter - if int32((*TFts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 { + if libc.Int32FromUint8((*TFts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 { if (*TFts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == (*TFts5ExprNode)(unsafe.Pointer(pNode)).FiRowid && (*TFts5IndexIter)(unsafe.Pointer(pIter)).FnData > 0 { (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = int32(1) } @@ -206710,7 +200287,6 @@ func _fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r int32) var p, pNear, pPhrase, pTerm uintptr _, _, _, _, _, _, _, _, _, _ = bHit, i, j, p, pNear, pPhrase, pTerm, rc, v4, v5 pNear = (*TFts5ExprNode)(unsafe.Pointer(pNode)).FpNear - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) { @@ -206748,11 +200324,10 @@ func _fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r int32) v5 = 0 } rc = _sqlite3Fts5IndexQuery(tls, (*TFts5Expr)(unsafe.Pointer(pExpr)).FpIndex, (*TFts5ExprTerm)(unsafe.Pointer(p)).FpTerm, (*TFts5ExprTerm)(unsafe.Pointer(p)).FnQueryTerm, v4|v5, (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FpColset, p+16) - _ = libc.Int32FromInt32(0) if rc != SQLITE_OK { return rc } - if 0 == int32((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) { + if 0 == libc.Int32FromUint8((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) { bHit = int32(1) } goto _3 @@ -206792,7 +200367,6 @@ func _fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r int32) // ** (iRhs - iLhs) // */ func _fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs Ti64, iRhs Ti64) (r int32) { - _ = libc.Int32FromInt32(0) if (*TFts5Expr)(unsafe.Pointer(pExpr)).FbDesc == 0 { if iLhs < iRhs { return -int32(1) @@ -206909,7 +200483,6 @@ func _fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK /* True if all terms are at the same rowid */ bDesc = (*TFts5Expr)(unsafe.Pointer(pExpr)).FbDesc /* Check that this node should not be FTS5_TERM */ - _ = libc.Int32FromInt32(0) /* Initialize iLast, the "lastest" rowid any iterator points to. If the ** iterator skips through rowids in the default ascending order, this means ** the maximum rowid. Or, if the iterator is "ORDER BY rowid DESC", then it @@ -206967,7 +200540,6 @@ func _fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r in } (*TFts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = *(*Ti64)(unsafe.Pointer(bp + 8)) (*TFts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = libc.BoolInt32(0 == _fts5ExprNearTest(tls, bp, pExpr, pNode) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK) - _ = libc.Int32FromInt32(0) return *(*int32)(unsafe.Pointer(bp)) } @@ -206999,7 +200571,7 @@ func _fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFrom if !(p != 0) { break } - if int32((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 { + if libc.Int32FromUint8((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 { ii = (*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid if ii == iRowid || bFromValid != 0 && ii != iFrom && libc.BoolInt32(ii > iFrom) == (*TFts5Expr)(unsafe.Pointer(pExpr)).FbDesc { if bFromValid != 0 { @@ -207010,7 +200582,7 @@ func _fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFrom if rc != SQLITE_OK { break } - if int32((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 { + if libc.Int32FromUint8((*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 { bEof = 0 } } else { @@ -207027,7 +200599,6 @@ func _fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFrom (*TFts5ExprNode)(unsafe.Pointer(pNode)).FbEof = libc.BoolInt32(rc != 0 || bEof != 0) } else { pIter = (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter - _ = libc.Int32FromInt32(0) if bFromValid != 0 { rc = _sqlite3Fts5IterNextFrom(tls, pIter, iFrom) } else { @@ -207036,7 +200607,6 @@ func _fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFrom (*TFts5ExprNode)(unsafe.Pointer(pNode)).FbEof = libc.BoolInt32(rc != 0 || (*TFts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0) } if (*TFts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 { - _ = libc.Int32FromInt32(0) rc = _fts5ExprNodeTest_STRING(tls, pExpr, pNode) } return rc @@ -207052,9 +200622,6 @@ func _fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r int3 ** expressions. */ pPhrase = *(*uintptr)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12)) pIter = (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 20))).FpIter - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = (*TFts5IndexIter)(unsafe.Pointer(pIter)).FnData if (*TFts5Config)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FeDetail == FTS5_DETAIL_FULL { (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fp = (*TFts5IndexIter)(unsafe.Pointer(pIter)).FpData @@ -207074,13 +200641,12 @@ func _fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVa var rc int32 _, _ = pIter, rc pIter = (*(*TFts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12)) + 20))).FpIter - _ = libc.Int32FromInt32(0) if bFromValid != 0 { rc = _sqlite3Fts5IterNextFrom(tls, pIter, iFrom) } else { rc = _sqlite3Fts5IterNext(tls, pIter) } - if rc == SQLITE_OK && int32((*TFts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 { + if rc == SQLITE_OK && libc.Int32FromUint8((*TFts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 { rc = _fts5ExprNodeTest_TERM(tls, pExpr, pNode) } else { (*TFts5ExprNode)(unsafe.Pointer(pNode)).FbEof = int32(1) @@ -207126,7 +200692,6 @@ func _fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVali break } p1 = *(*uintptr)(unsafe.Pointer(pNode + 36 + uintptr(i)*4)) - _ = libc.Int32FromInt32(0) if (*TFts5ExprNode)(unsafe.Pointer(p1)).FbEof == 0 { if (*TFts5ExprNode)(unsafe.Pointer(p1)).FiRowid == iLast || bFromValid != 0 && _fts5RowidCmp(tls, pExpr, (*TFts5ExprNode)(unsafe.Pointer(p1)).FiRowid, iFrom) < 0 { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Ti64) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExprNode)(unsafe.Pointer(p1)).FxNext})))(tls, pExpr, p1, bFromValid, iFrom) @@ -207157,7 +200722,6 @@ func _fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) (r int32) _, _, _, _, _, _ = bMatch, cmp, iChild, iLast, pChild, rc iLast = (*TFts5ExprNode)(unsafe.Pointer(pAnd)).FiRowid rc = SQLITE_OK - _ = libc.Int32FromInt32(0) for cond := true; cond; cond = bMatch == 0 { (*TFts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch = 0 bMatch = int32(1) @@ -207180,7 +200744,6 @@ func _fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) (r int32) ** the child node is guaranteed to have advanced at least as far as ** rowid iLast. So if it is not at exactly iLast, pChild->iRowid is the ** new lastest rowid seen so far. */ - _ = libc.Int32FromInt32(0) if (*TFts5ExprNode)(unsafe.Pointer(pChild)).FbEof != 0 { _fts5ExprSetEof(tls, pAnd) bMatch = int32(1) @@ -207226,14 +200789,12 @@ func _fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r int32 rc = SQLITE_OK p1 = *(*uintptr)(unsafe.Pointer(pNode + 36)) p2 = *(*uintptr)(unsafe.Pointer(pNode + 36 + 1*4)) - _ = libc.Int32FromInt32(0) for rc == SQLITE_OK && (*TFts5ExprNode)(unsafe.Pointer(p1)).FbEof == 0 { cmp = _fts5NodeCompare(tls, pExpr, p1, p2) if cmp > 0 { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Ti64) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExprNode)(unsafe.Pointer(p2)).FxNext})))(tls, pExpr, p2, int32(1), (*TFts5ExprNode)(unsafe.Pointer(p1)).FiRowid) cmp = _fts5NodeCompare(tls, pExpr, p1, p2) } - _ = libc.Int32FromInt32(0) if cmp != 0 || (*TFts5ExprNode)(unsafe.Pointer(p2)).FbNomatch != 0 { break } @@ -207283,7 +200844,6 @@ func _fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r int32) { case int32(FTS5_OR): _fts5ExprNodeTest_OR(tls, pExpr, pNode) default: - _ = libc.Int32FromInt32(0) rc = _fts5ExprNodeTest_NOT(tls, pExpr, pNode) break } @@ -207322,7 +200882,6 @@ func _fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r int32) { } pChild = *(*uintptr)(unsafe.Pointer(pNode + 36 + uintptr(i)*4)) rc = _fts5ExprNodeFirst(tls, pExpr, *(*uintptr)(unsafe.Pointer(pNode + 36 + uintptr(i)*4))) - _ = libc.Int32FromInt32(0) nEof += (*TFts5ExprNode)(unsafe.Pointer(pChild)).FbEof goto _1 _1: @@ -207340,7 +200899,6 @@ func _fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r int32) { _fts5ExprSetEof(tls, pNode) } default: - _ = libc.Int32FromInt32(0) (*TFts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*TFts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 36)))).FbEof break } @@ -207384,7 +200942,6 @@ func _sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst Ti64, } /* If the iterator is not at a real match, skip forward until it is. */ for (*TFts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 && rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Ti64) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExprNode)(unsafe.Pointer(pRoot)).FxNext})))(tls, p, pRoot, 0, int64(libc.Int32FromInt32(0))) } return rc @@ -207403,10 +200960,8 @@ func _sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast Ti64) (r int32) { var rc int32 _, _ = pRoot, rc pRoot = (*TFts5Expr)(unsafe.Pointer(p)).FpRoot - _ = libc.Int32FromInt32(0) for cond := true; cond; cond = (*TFts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Ti64) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExprNode)(unsafe.Pointer(pRoot)).FxNext})))(tls, p, pRoot, 0, int64(libc.Int32FromInt32(0))) - _ = libc.Int32FromInt32(0) } if _fts5RowidCmp(tls, p, (*TFts5ExprNode)(unsafe.Pointer(pRoot)).FiRowid, iLast) > 0 { (*TFts5ExprNode)(unsafe.Pointer(pRoot)).FbEof = int32(1) @@ -207509,18 +201064,18 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr return pNear } if pNear == uintptr(0) { - nByte = int64(uint32(16) + uint32(SZALLOC)*uint32(4)) - pRet = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(16) + libc.Uint32FromInt32(SZALLOC)*uint32(4)) + pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pRet, 0, uint32(nByte)) + libc.Xmemset(tls, pRet, 0, libc.Uint32FromInt64(nByte)) } } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = int64(uint32(16) + uint32(nNew)*uint32(4)) - pRet = Xsqlite3_realloc64(tls, pNear, uint64(nByte1)) + nByte1 = libc.Int64FromUint32(uint32(16) + libc.Uint32FromInt32(nNew)*uint32(4)) + pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } @@ -207530,16 +201085,11 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } } if pRet == uintptr(0) { - _ = libc.Int32FromInt32(0) _sqlite3Fts5ParseNearsetFree(tls, pNear) _sqlite3Fts5ParsePhraseFree(tls, pPhrase) } else { if (*TFts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase > 0 { pLast = *(*uintptr)(unsafe.Pointer(pRet + 12 + uintptr((*TFts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase-int32(1))*4)) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm == 0 { _fts5ExprPhraseFree(tls, pPhrase) (*TFts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase-- @@ -207605,20 +201155,20 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui nToken = int32(FTS5_MAX_TOKEN_SIZE) } if pPhrase != 0 && (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && tflags&int32(FTS5_TOKEN_COLOCATED) != 0 { - nByte = int64(libc.Uint32FromInt64(24) + libc.Uint32FromInt64(12) + uint32(nToken) + uint32(1)) - pSyn = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt64(24) + libc.Uint32FromInt64(12) + libc.Uint32FromInt32(nToken) + uint32(1)) + pSyn = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSyn == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pSyn, 0, uint32(nByte)) + libc.Xmemset(tls, pSyn, 0, libc.Uint32FromInt64(nByte)) (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpTerm = pSyn + uintptr(24) + uintptr(12) v1 = nToken (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FnQueryTerm = v1 (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FnFullTerm = v1 if (*TFts5Config)(unsafe.Pointer((*TTokenCtx)(unsafe.Pointer(pCtx)).FpConfig)).FbTokendata != 0 { - (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FnQueryTerm = int32(libc.Xstrlen(tls, (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpTerm)) + (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FnQueryTerm = libc.Int32FromUint32(libc.Xstrlen(tls, (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpTerm)) } - libc.Xmemcpy(tls, (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpTerm, pToken, uint32(nToken)) + libc.Xmemcpy(tls, (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpTerm, pToken, libc.Uint32FromInt32(nToken)) (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpSynonym = (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 20 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-int32(1))*24))).FpSynonym (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 20 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-int32(1))*24))).FpSynonym = pSyn } @@ -207630,7 +201180,7 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint32(44)+uint32(24)*uint32(nNew))) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint32(44)+uint32(24)*libc.Uint32FromInt32(nNew))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { @@ -207654,7 +201204,7 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FnQueryTerm = v6 (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FnFullTerm = v6 if (*TFts5Config)(unsafe.Pointer((*TTokenCtx)(unsafe.Pointer(pCtx)).FpConfig)).FbTokendata != 0 && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FnQueryTerm = int32(libc.Xstrlen(tls, (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpTerm)) + (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FnQueryTerm = libc.Int32FromUint32(libc.Xstrlen(tls, (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpTerm)) } } } @@ -207697,7 +201247,6 @@ func _sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { } func _sqlite3Fts5ParseFinished(tls *libc.TLS, pParse uintptr, p uintptr) { - _ = libc.Int32FromInt32(0) (*TFts5Parse)(unsafe.Pointer(pParse)).FpExpr = p } @@ -207706,8 +201255,8 @@ func _parseGrowPhraseArray(tls *libc.TLS, pParse uintptr) (r int32) { var nByte Tsqlite3_int64 _, _ = apNew, nByte if (*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase%int32(8) == 0 { - nByte = int64(uint32(4) * uint32((*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase+libc.Int32FromInt32(8))) - apNew = Xsqlite3_realloc64(tls, (*TFts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(4) * libc.Uint32FromInt32((*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase+libc.Int32FromInt32(8))) + apNew = Xsqlite3_realloc64(tls, (*TFts5Parse)(unsafe.Pointer(pParse)).FapPhrase, libc.Uint64FromInt64(nByte)) if apNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) return int32(SQLITE_NOMEM) @@ -207747,7 +201296,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke } flags = int32(FTS5_TOKENIZE_QUERY) | v1 _sqlite3Fts5Dequote(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) - n = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 12)))) + n = libc.Int32FromUint32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 12)))) rc = _sqlite3Fts5Tokenize(tls, pConfig, flags, *(*uintptr)(unsafe.Pointer(bp + 12)), n, bp, __ccgo_fp(_fts5ParseTokenize)) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) @@ -207773,7 +201322,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, int64(44)) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { - (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 20 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*24))).FbPrefix = uint8(bPrefix) + (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 20 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*24))).FbPrefix = libc.Uint8FromInt32(bPrefix) } } *(*uintptr)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase-int32(1))*4)) = (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase @@ -207813,15 +201362,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(40)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, int64(libc.Uint32FromInt64(16)+libc.Uint32FromInt64(4))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(libc.Uint32FromInt64(16)+libc.Uint32FromInt64(4))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = int64(uint32(8) + uint32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) + nByte = libc.Int64FromUint32(uint32(8) + libc.Uint32FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { - libc.Xmemcpy(tls, pColset, pColsetOrig, uint32(nByte)) + libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint32FromInt64(nByte)) } (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear)).FpColset = pColset } @@ -207871,7 +201420,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp *(*uintptr)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear + 12)) = (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear)).FnPhrase = int32(1) (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase)).FpNode = (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot - if (*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm == int32(1) && (*(*TFts5ExprTerm)(unsafe.Pointer(pOrig + 20))).FpSynonym == uintptr(0) && int32((*(*TFts5ExprTerm)(unsafe.Pointer(pOrig + 20))).FbFirst) == 0 { + if (*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm == int32(1) && (*(*TFts5ExprTerm)(unsafe.Pointer(pOrig + 20))).FpSynonym == uintptr(0) && libc.Int32FromUint8((*(*TFts5ExprTerm)(unsafe.Pointer(pOrig + 20))).FbFirst) == 0 { (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FeType = int32(FTS5_TERM) (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FxNext = __ccgo_fp(_fts5ExprNodeNext_TERM) } else { @@ -207897,8 +201446,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36115, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34896, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36144, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34925, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -207918,7 +201467,7 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if int32(c) < int32('0') || int32(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36120, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36149, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) @@ -207955,9 +201504,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - pNew = Xsqlite3_realloc64(tls, p, uint64(uint32(8)+uint32(4)*uint32(nCol))) + pNew = Xsqlite3_realloc64(tls, p, uint64(uint32(8)+uint32(4)*libc.Uint32FromInt32(nCol))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -208007,7 +201554,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+8, int64(uint32(8)+uint32(4)*uint32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+8, libc.Int64FromUint32(uint32(8)+uint32(4)*libc.Uint32FromInt32(nCol))) if pRet != 0 { iOld = 0 i = 0 @@ -208065,7 +201612,6 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u Xsqlite3_free(tls, z) } if pRet == uintptr(0) { - _ = libc.Int32FromInt32(0) Xsqlite3_free(tls, pColset) } return pRet @@ -208086,10 +201632,10 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = int64(uint32(8) + uint32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) + nByte = libc.Int64FromUint32(uint32(8) + libc.Uint32FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { - libc.Xmemcpy(tls, pRet, pOrig, uint32(nByte)) + libc.Xmemcpy(tls, pRet, pOrig, libc.Uint32FromInt64(nByte)) } } else { pRet = uintptr(0) @@ -208140,7 +201686,6 @@ func _fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset u var pNear uintptr _, _ = i, pNear if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { - _ = libc.Int32FromInt32(0) if (*TFts5ExprNode)(unsafe.Pointer(pNode)).FeType == int32(FTS5_STRING) || (*TFts5ExprNode)(unsafe.Pointer(pNode)).FeType == int32(FTS5_TERM) { pNear = (*TFts5ExprNode)(unsafe.Pointer(pNode)).FpNear if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 { @@ -208158,7 +201703,6 @@ func _fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset u } } } else { - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TFts5ExprNode)(unsafe.Pointer(pNode)).FnChild) { @@ -208185,7 +201729,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36149, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36178, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -208198,7 +201742,7 @@ func _fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { switch (*TFts5ExprNode)(unsafe.Pointer(pNode)).FeType { case int32(FTS5_STRING): pNear = (*TFts5ExprNode)(unsafe.Pointer(pNode)).FpNear - if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) && (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)))).FnTerm == int32(1) && (*(*TFts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)) + 20))).FpSynonym == uintptr(0) && int32((*(*TFts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)) + 20))).FbFirst) == 0 { + if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) && (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)))).FnTerm == int32(1) && (*(*TFts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)) + 20))).FpSynonym == uintptr(0) && libc.Int32FromUint8((*(*TFts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)) + 20))).FbFirst) == 0 { (*TFts5ExprNode)(unsafe.Pointer(pNode)).FeType = int32(FTS5_TERM) (*TFts5ExprNode)(unsafe.Pointer(pNode)).FxNext = __ccgo_fp(_fts5ExprNodeNext_TERM) } else { @@ -208209,7 +201753,6 @@ func _fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { case int32(FTS5_AND): (*TFts5ExprNode)(unsafe.Pointer(pNode)).FxNext = __ccgo_fp(_fts5ExprNodeNext_AND) default: - _ = libc.Int32FromInt32(0) (*TFts5ExprNode)(unsafe.Pointer(pNode)).FxNext = __ccgo_fp(_fts5ExprNodeNext_NOT) break } @@ -208221,8 +201764,8 @@ func _fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { _, _, _, _, _ = ii, nByte, v1, v2, v4 ii = (*TFts5ExprNode)(unsafe.Pointer(p)).FnChild if (*TFts5ExprNode)(unsafe.Pointer(p)).FeType != int32(FTS5_NOT) && (*TFts5ExprNode)(unsafe.Pointer(pSub)).FeType == (*TFts5ExprNode)(unsafe.Pointer(p)).FeType { - nByte = int32(uint32(4) * uint32((*TFts5ExprNode)(unsafe.Pointer(pSub)).FnChild)) - libc.Xmemcpy(tls, p+36+uintptr((*TFts5ExprNode)(unsafe.Pointer(p)).FnChild)*4, pSub+36, uint32(nByte)) + nByte = libc.Int32FromUint32(uint32(4) * libc.Uint32FromInt32((*TFts5ExprNode)(unsafe.Pointer(pSub)).FnChild)) + libc.Xmemcpy(tls, p+36+uintptr((*TFts5ExprNode)(unsafe.Pointer(p)).FnChild)*4, pSub+36, libc.Uint32FromInt32(nByte)) *(*int32)(unsafe.Pointer(p + 32)) += (*TFts5ExprNode)(unsafe.Pointer(pSub)).FnChild Xsqlite3_free(tls, pSub) } else { @@ -208266,9 +201809,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)))).FnTerm - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - nByte = int32(uint32(40) + uint32(nTerm)*uint32(4)) + nByte = libc.Int32FromUint32(uint32(40) + libc.Uint32FromInt32(nTerm)*uint32(4)) pRet = _sqlite3Fts5MallocZero(tls, pParse+8, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -208330,7 +201871,6 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { nChild = 0 /* Bytes of space to allocate for this node */ - _ = libc.Int32FromInt32(0) if eType == int32(FTS5_STRING) && pNear == uintptr(0) { return uintptr(0) } @@ -208356,7 +201896,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = int64(uint32(40) + uint32(4)*uint32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint32(uint32(40) + uint32(4)*libc.Uint32FromInt32(nChild-libc.Int32FromInt32(1))) pRet = _sqlite3Fts5MallocZero(tls, pParse+8, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -208382,11 +201922,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 12)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 20))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36202 + v2 = __ccgo_ts + 36231 } else { - v2 = __ccgo_ts + 36115 + v2 = __ccgo_ts + 36144 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36209, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36238, libc.VaList(bp+8, v2)) Xsqlite3_free(tls, pRet) pRet = uintptr(0) } @@ -208395,7 +201935,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin _fts5ExprAddChildren(tls, pRet, pLeft) _fts5ExprAddChildren(tls, pRet, pRight) if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36259, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36288, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) Xsqlite3_free(tls, pRet) pRet = uintptr(0) } @@ -208404,7 +201944,6 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } if pRet == uintptr(0) { - _ = libc.Int32FromInt32(0) _sqlite3Fts5ParseNodeFree(tls, pLeft) _sqlite3Fts5ParseNodeFree(tls, pRight) _sqlite3Fts5ParseNearsetFree(tls, pNear) @@ -208420,16 +201959,12 @@ func _sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, _sqlite3Fts5ParseNodeFree(tls, pLeft) _sqlite3Fts5ParseNodeFree(tls, pRight) } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5ExprNode)(unsafe.Pointer(pLeft)).FeType == int32(FTS5_AND) { pPrev = *(*uintptr)(unsafe.Pointer(pLeft + 36 + uintptr((*TFts5ExprNode)(unsafe.Pointer(pLeft)).FnChild-int32(1))*4)) } else { pPrev = pLeft } - _ = libc.Int32FromInt32(0) if (*TFts5ExprNode)(unsafe.Pointer(pRight)).FeType == FTS5_EOF { - _ = libc.Int32FromInt32(0) _sqlite3Fts5ParseNodeFree(tls, pRight) pRet = pLeft (*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase-- @@ -208442,8 +201977,7 @@ func _sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRet = pLeft } ap = (*TFts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase-int32(1)-(*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase)*4 - _ = libc.Int32FromInt32(0) - libc.Xmemmove(tls, ap, ap+1*4, uint32(4)*uint32((*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase)) + libc.Xmemmove(tls, ap, ap+1*4, uint32(4)*libc.Uint32FromInt32((*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase)) (*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase-- _sqlite3Fts5ParseNodeFree(tls, pPrev) } else { @@ -208545,9 +202079,9 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(uint32(16)*uint32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) + pRet = Xsqlite3_malloc64(tls, uint64(uint32(16)*libc.Uint32FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { - libc.Xmemset(tls, pRet, 0, uint32(16)*uint32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + libc.Xmemset(tls, pRet, 0, uint32(16)*libc.Uint32FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 for { if !(i < (*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase) { @@ -208555,7 +202089,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r } pBuf = *(*uintptr)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4)) + 4 pNode = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4)))).FpNode - _ = libc.Int32FromInt32(0) if bLive != 0 && ((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn == 0 || (*TFts5ExprNode)(unsafe.Pointer(pNode)).FiRowid != (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid || (*TFts5ExprNode)(unsafe.Pointer(pNode)).FbEof != 0) { (*(*TFts5PoslistPopulator)(unsafe.Pointer(pRet + uintptr(i)*16))).FbMiss = int32(1) } else { @@ -208666,7 +202199,7 @@ func _fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pTok if !(pT != 0) { break } - if ((*TFts5ExprTerm)(unsafe.Pointer(pT)).FnQueryTerm == nQuery || (*TFts5ExprTerm)(unsafe.Pointer(pT)).FnQueryTerm < nQuery && (*TFts5ExprTerm)(unsafe.Pointer(pT)).FbPrefix != 0) && libc.Xmemcmp(tls, (*TFts5ExprTerm)(unsafe.Pointer(pT)).FpTerm, pToken, uint32((*TFts5ExprTerm)(unsafe.Pointer(pT)).FnQueryTerm)) == 0 { + if ((*TFts5ExprTerm)(unsafe.Pointer(pT)).FnQueryTerm == nQuery || (*TFts5ExprTerm)(unsafe.Pointer(pT)).FnQueryTerm < nQuery && (*TFts5ExprTerm)(unsafe.Pointer(pT)).FbPrefix != 0) && libc.Xmemcmp(tls, (*TFts5ExprTerm)(unsafe.Pointer(pT)).FpTerm, pToken, libc.Uint32FromInt32((*TFts5ExprTerm)(unsafe.Pointer(pT)).FnQueryTerm)) == 0 { rc = _sqlite3Fts5PoslistWriterAppend(tls, *(*uintptr)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4))+4, (*TFts5ExprCtx)(unsafe.Pointer(p)).FaPopulator+uintptr(i)*16, (*TFts5ExprCtx)(unsafe.Pointer(p)).FiOff) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FbTokendata != 0 && !((*TFts5ExprTerm)(unsafe.Pointer(pT)).FbPrefix != 0) { iCol = int32((*TFts5ExprCtx)(unsafe.Pointer(p)).FiOff >> int32(32)) @@ -208783,7 +202316,6 @@ func _fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid Ti64) (r int32) } return bRet default: - _ = libc.Int32FromInt32(0) if 0 == _fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 36)), iRowid) || 0 != _fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 36 + 1*4)), iRowid) { _fts5ExprClearPoslists(tls, pNode) return 0 @@ -208809,8 +202341,6 @@ func _sqlite3Fts5ExprPhraseCollist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pPhrase = *(*uintptr)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*4)) pNode = (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 && (*TFts5ExprNode)(unsafe.Pointer(pNode)).FiRowid == (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid && (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0 { pTerm = pPhrase + 20 if (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0 { @@ -208868,7 +202398,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras return int32(SQLITE_RANGE) } pTerm = pPhrase + 20 + uintptr(iToken)*24 - if int32((*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix) == 0 { + if libc.Int32FromUint8((*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix) == 0 { if (*TFts5Config)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FbTokendata != 0 { rc = _sqlite3Fts5IterToken(tls, (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter, iRowid, iCol, iOff+iToken, ppOut, pnOut) } else { @@ -209031,14 +202561,14 @@ func _sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte u (*TFts5Hash)(unsafe.Pointer(pNew)).FpnByte = pnByte (*TFts5Hash)(unsafe.Pointer(pNew)).FeDetail = (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail (*TFts5Hash)(unsafe.Pointer(pNew)).FnSlot = int32(1024) - nByte = int64(uint32(4) * uint32((*TFts5Hash)(unsafe.Pointer(pNew)).FnSlot)) - (*TFts5Hash)(unsafe.Pointer(pNew)).FaSlot = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(4) * libc.Uint32FromInt32((*TFts5Hash)(unsafe.Pointer(pNew)).FnSlot)) + (*TFts5Hash)(unsafe.Pointer(pNew)).FaSlot = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if (*TFts5Hash)(unsafe.Pointer(pNew)).FaSlot == uintptr(0) { Xsqlite3_free(tls, pNew) *(*uintptr)(unsafe.Pointer(ppNew)) = uintptr(0) rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, (*TFts5Hash)(unsafe.Pointer(pNew)).FaSlot, 0, uint32(nByte)) + libc.Xmemset(tls, (*TFts5Hash)(unsafe.Pointer(pNew)).FaSlot, 0, libc.Uint32FromInt64(nByte)) } } return rc @@ -209088,7 +202618,7 @@ func _sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { ; i++ } - libc.Xmemset(tls, (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot, 0, uint32((*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot)*uint32(4)) + libc.Xmemset(tls, (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot, 0, libc.Uint32FromInt32((*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot)*uint32(4)) (*TFts5Hash)(unsafe.Pointer(pHash)).FnEntry = 0 } @@ -209108,7 +202638,7 @@ func _fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) (r uint32) { ; i-- } - return h % uint32(nSlot) + return h % libc.Uint32FromInt32(nSlot) } func _fts5HashKey2(tls *libc.TLS, nSlot int32, b Tu8, p uintptr, n int32) (r uint32) { @@ -209128,7 +202658,7 @@ func _fts5HashKey2(tls *libc.TLS, nSlot int32, b Tu8, p uintptr, n int32) (r uin i-- } h = h<<int32(3) ^ h ^ uint32(b) - return h % uint32(nSlot) + return h % libc.Uint32FromInt32(nSlot) } // C documentation @@ -209143,11 +202673,11 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, uint64(uint32(nNew)*uint32(4))) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint32FromInt32(nNew)*uint32(4))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, apNew, 0, uint32(nNew)*uint32(4)) + libc.Xmemset(tls, apNew, 0, libc.Uint32FromInt32(nNew)*uint32(4)) i = 0 for { if !(i < (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot) { @@ -209185,7 +202715,6 @@ func _fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr pPtr = v1 nData = (*TFts5HashEntry)(unsafe.Pointer(p)).FnData if (*TFts5Hash)(unsafe.Pointer(pHash)).FeDetail == int32(FTS5_DETAIL_NONE) { - _ = libc.Int32FromInt32(0) if (*TFts5HashEntry)(unsafe.Pointer(p)).FbDel != 0 { v2 = nData nData++ @@ -209197,15 +202726,14 @@ func _fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr } } } else { - nSz = nData - (*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist - int32(1) /* Size in bytes */ - nPos = nSz*int32(2) + int32((*TFts5HashEntry)(unsafe.Pointer(p)).FbDel) /* Value of nPos field */ - _ = libc.Int32FromInt32(0) + nSz = nData - (*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist - int32(1) /* Size in bytes */ + nPos = nSz*int32(2) + libc.Int32FromUint8((*TFts5HashEntry)(unsafe.Pointer(p)).FbDel) /* Value of nPos field */ if nPos <= int32(127) { - *(*Tu8)(unsafe.Pointer(pPtr + uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist))) = uint8(nPos) + *(*Tu8)(unsafe.Pointer(pPtr + uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist))) = libc.Uint8FromInt32(nPos) } else { - nByte = _sqlite3Fts5GetVarintLen(tls, uint32(nPos)) - libc.Xmemmove(tls, pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist+nByte), pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist+int32(1)), uint32(nSz)) - _sqlite3Fts5PutVarint(tls, pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist), uint64(nPos)) + nByte = _sqlite3Fts5GetVarintLen(tls, libc.Uint32FromInt32(nPos)) + libc.Xmemmove(tls, pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist+nByte), pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist+int32(1)), libc.Uint32FromInt32(nSz)) + _sqlite3Fts5PutVarint(tls, pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist), libc.Uint64FromInt32(nPos)) nData += nByte - int32(1) } } @@ -209240,14 +202768,14 @@ func _sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid Ti64, iCol int32 nIncr = 0 /* If non-delete entry should be written */ bNew = libc.BoolInt32((*TFts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL) /* Attempt to locate an existing hash entry */ - iHash = _fts5HashKey2(tls, (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot, uint8(bByte), pToken, nToken) + iHash = _fts5HashKey2(tls, (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot, libc.Uint8FromInt8(bByte), pToken, nToken) p = *(*uintptr)(unsafe.Pointer((*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*4)) for { if !(p != 0) { break } zKey = p + 1*40 - if int32(*(*int8)(unsafe.Pointer(zKey))) == int32(bByte) && (*TFts5HashEntry)(unsafe.Pointer(p)).FnKey == nToken+int32(1) && libc.Xmemcmp(tls, zKey+1, pToken, uint32(nToken)) == 0 { + if int32(*(*int8)(unsafe.Pointer(zKey))) == int32(bByte) && (*TFts5HashEntry)(unsafe.Pointer(p)).FnKey == nToken+int32(1) && libc.Xmemcmp(tls, zKey+1, pToken, libc.Uint32FromInt32(nToken)) == 0 { break } goto _1 @@ -209257,7 +202785,7 @@ func _sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid Ti64, iCol int32 } /* If an existing hash entry cannot be found, create a new one. */ if p == uintptr(0) { - nByte = int64(uint32(40) + uint32(nToken+libc.Int32FromInt32(1)) + uint32(1) + uint32(64)) + nByte = libc.Int64FromUint32(uint32(40) + libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) + uint32(1) + uint32(64)) if nByte < int64(128) { nByte = int64(128) } @@ -209267,10 +202795,10 @@ func _sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid Ti64, iCol int32 if rc != SQLITE_OK { return rc } - iHash = _fts5HashKey2(tls, (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot, uint8(bByte), pToken, nToken) + iHash = _fts5HashKey2(tls, (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot, libc.Uint8FromInt8(bByte), pToken, nToken) } /* Allocate new Fts5HashEntry and add it to the hash table. */ - p = Xsqlite3_malloc64(tls, uint64(nByte)) + p = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if !(p != 0) { return int32(SQLITE_NOMEM) } @@ -209278,16 +202806,15 @@ func _sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid Ti64, iCol int32 (*TFts5HashEntry)(unsafe.Pointer(p)).FnAlloc = int32(nByte) zKey1 = p + 1*40 *(*int8)(unsafe.Pointer(zKey1)) = bByte - libc.Xmemcpy(tls, zKey1+1, pToken, uint32(nToken)) - _ = libc.Int32FromInt32(0) + libc.Xmemcpy(tls, zKey1+1, pToken, libc.Uint32FromInt32(nToken)) (*TFts5HashEntry)(unsafe.Pointer(p)).FnKey = nToken + int32(1) *(*int8)(unsafe.Pointer(zKey1 + uintptr(nToken+int32(1)))) = int8('\000') - (*TFts5HashEntry)(unsafe.Pointer(p)).FnData = int32(uint32(nToken+int32(1)) + uint32(40)) + (*TFts5HashEntry)(unsafe.Pointer(p)).FnData = libc.Int32FromUint32(libc.Uint32FromInt32(nToken+int32(1)) + uint32(40)) (*TFts5HashEntry)(unsafe.Pointer(p)).FpHashNext = *(*uintptr)(unsafe.Pointer((*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*4)) *(*uintptr)(unsafe.Pointer((*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*4)) = p (*TFts5Hash)(unsafe.Pointer(pHash)).FnEntry++ /* Add the first rowid field to the hash-entry */ - *(*int32)(unsafe.Pointer(p + 16)) += _sqlite3Fts5PutVarint(tls, p+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FnData), uint64(iRowid)) + *(*int32)(unsafe.Pointer(p + 16)) += _sqlite3Fts5PutVarint(tls, p+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FnData), libc.Uint64FromInt64(iRowid)) (*TFts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid (*TFts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = (*TFts5HashEntry)(unsafe.Pointer(p)).FnData if (*TFts5Hash)(unsafe.Pointer(pHash)).FeDetail != int32(FTS5_DETAIL_NONE) { @@ -209312,7 +202839,7 @@ func _sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid Ti64, iCol int32 */ if (*TFts5HashEntry)(unsafe.Pointer(p)).FnAlloc-(*TFts5HashEntry)(unsafe.Pointer(p)).FnData < libc.Int32FromInt32(9)+libc.Int32FromInt32(4)+libc.Int32FromInt32(1)+libc.Int32FromInt32(3)+libc.Int32FromInt32(5) { nNew = int64((*TFts5HashEntry)(unsafe.Pointer(p)).FnAlloc * int32(2)) - pNew = Xsqlite3_realloc64(tls, p, uint64(nNew)) + pNew = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(nNew)) if pNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -209332,12 +202859,11 @@ func _sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid Ti64, iCol int32 } nIncr -= (*TFts5HashEntry)(unsafe.Pointer(p)).FnData } - _ = libc.Int32FromInt32(0) pPtr = p /* If this is a new rowid, append the 4-byte size field for the previous ** entry, and the new rowid for this entry. */ if iRowid != (*TFts5HashEntry)(unsafe.Pointer(p)).FiRowid { - iDiff = uint64(iRowid) - uint64((*TFts5HashEntry)(unsafe.Pointer(p)).FiRowid) + iDiff = libc.Uint64FromInt64(iRowid) - libc.Uint64FromInt64((*TFts5HashEntry)(unsafe.Pointer(p)).FiRowid) _fts5HashAddPoslistSize(tls, pHash, p, uintptr(0)) *(*int32)(unsafe.Pointer(p + 16)) += _sqlite3Fts5PutVarint(tls, pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FnData), iDiff) (*TFts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid @@ -209359,14 +202885,13 @@ func _sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid Ti64, iCol int32 (*TFts5HashEntry)(unsafe.Pointer(p)).FbContent = uint8(1) } else { /* Append a new column value, if necessary */ - _ = libc.Int32FromInt32(0) if iCol != int32((*TFts5HashEntry)(unsafe.Pointer(p)).FiCol) { if (*TFts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL { v6 = p + 16 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ *(*Tu8)(unsafe.Pointer(pPtr + uintptr(v5))) = uint8(0x01) - *(*int32)(unsafe.Pointer(p + 16)) += _sqlite3Fts5PutVarint(tls, pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FnData), uint64(iCol)) + *(*int32)(unsafe.Pointer(p + 16)) += _sqlite3Fts5PutVarint(tls, pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FnData), libc.Uint64FromInt32(iCol)) (*TFts5HashEntry)(unsafe.Pointer(p)).FiCol = int16(iCol) (*TFts5HashEntry)(unsafe.Pointer(p)).FiPos = 0 } else { @@ -209378,7 +202903,7 @@ func _sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid Ti64, iCol int32 } /* Append the new position offset, if necessary */ if bNew != 0 { - *(*int32)(unsafe.Pointer(p + 16)) += _sqlite3Fts5PutVarint(tls, pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FnData), uint64(iPos-(*TFts5HashEntry)(unsafe.Pointer(p)).FiPos+int32(2))) + *(*int32)(unsafe.Pointer(p + 16)) += _sqlite3Fts5PutVarint(tls, pPtr+uintptr((*TFts5HashEntry)(unsafe.Pointer(p)).FnData), libc.Uint64FromInt32(iPos-(*TFts5HashEntry)(unsafe.Pointer(p)).FiPos+int32(2))) (*TFts5HashEntry)(unsafe.Pointer(p)).FiPos = iPos } } @@ -209426,11 +202951,10 @@ func _fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) (r uintpt v1 = (*TFts5HashEntry)(unsafe.Pointer(p2)).FnKey } nMin = v1 - cmp = libc.Xmemcmp(tls, zKey1, zKey2, uint32(nMin)) + cmp = libc.Xmemcmp(tls, zKey1, zKey2, libc.Uint32FromInt32(nMin)) if cmp == 0 { cmp = (*TFts5HashEntry)(unsafe.Pointer(p1)).FnKey - (*TFts5HashEntry)(unsafe.Pointer(p2)).FnKey } - _ = libc.Int32FromInt32(0) if cmp > 0 { /* p2 is smaller */ *(*uintptr)(unsafe.Pointer(ppOut)) = p2 @@ -209461,11 +202985,11 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(uint32(4)*uint32(nMergeSlot))) + ap = Xsqlite3_malloc64(tls, uint64(uint32(4)*libc.Uint32FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, ap, 0, uint32(4)*uint32(nMergeSlot)) + libc.Xmemset(tls, ap, 0, uint32(4)*libc.Uint32FromInt32(nMergeSlot)) iSlot = 0 for { if !(iSlot < (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot) { @@ -209476,7 +203000,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 if !(pIter != 0) { break } - if pTerm == uintptr(0) || (*TFts5HashEntry)(unsafe.Pointer(pIter)).FnKey >= nTerm && 0 == libc.Xmemcmp(tls, pIter+1*40, pTerm, uint32(nTerm)) { + if pTerm == uintptr(0) || (*TFts5HashEntry)(unsafe.Pointer(pIter)).FnKey >= nTerm && 0 == libc.Xmemcmp(tls, pIter+1*40, pTerm, libc.Uint32FromInt32(nTerm)) { pEntry = pIter (*TFts5HashEntry)(unsafe.Pointer(pEntry)).FpScanNext = uintptr(0) i = 0 @@ -209538,7 +203062,7 @@ func _sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintp break } zKey = p + 1*40 - if nTerm == (*TFts5HashEntry)(unsafe.Pointer(p)).FnKey && libc.Xmemcmp(tls, zKey, pTerm, uint32(nTerm)) == 0 { + if nTerm == (*TFts5HashEntry)(unsafe.Pointer(p)).FnKey && libc.Xmemcmp(tls, zKey, pTerm, libc.Uint32FromInt32(nTerm)) == 0 { break } goto _1 @@ -209547,14 +203071,14 @@ func _sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintp p = (*TFts5HashEntry)(unsafe.Pointer(p)).FpHashNext } if p != 0 { - nHashPre = int32(uint32(40) + uint32(nTerm)) + nHashPre = libc.Int32FromUint32(uint32(40) + libc.Uint32FromInt32(nTerm)) nList = (*TFts5HashEntry)(unsafe.Pointer(p)).FnData - nHashPre - v2 = Xsqlite3_malloc64(tls, uint64(nPre+nList+int32(10))) + v2 = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nPre+nList+int32(10))) *(*uintptr)(unsafe.Pointer(ppOut)) = v2 pRet = v2 if pRet != 0 { pFaux = pRet + uintptr(nPre-nHashPre) - libc.Xmemcpy(tls, pRet+uintptr(nPre), p+uintptr(nHashPre), uint32(nList)) + libc.Xmemcpy(tls, pRet+uintptr(nPre), p+uintptr(nHashPre), libc.Uint32FromInt32(nList)) nList += _fts5HashAddPoslistSize(tls, pHash, p, pFaux) *(*int32)(unsafe.Pointer(pnDoclist)) = nList } else { @@ -209578,12 +203102,10 @@ func _sqlite3Fts5HashScanInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int // ** Return true if the hash table is empty, false otherwise. // */ func _sqlite3Fts5HashIsEmpty(tls *libc.TLS, pHash uintptr) (r int32) { - _ = libc.Int32FromInt32(0) return libc.BoolInt32((*TFts5Hash)(unsafe.Pointer(pHash)).FnEntry == 0) } func _sqlite3Fts5HashScanNext(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) (*TFts5Hash)(unsafe.Pointer(p)).FpScan = (*TFts5HashEntry)(unsafe.Pointer((*TFts5Hash)(unsafe.Pointer(p)).FpScan)).FpScanNext } @@ -209604,7 +203126,7 @@ func _sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, pnT *(*uintptr)(unsafe.Pointer(pzTerm)) = zKey *(*int32)(unsafe.Pointer(pnTerm)) = nTerm *(*uintptr)(unsafe.Pointer(ppDoclist)) = zKey + uintptr(nTerm) - *(*int32)(unsafe.Pointer(pnDoclist)) = int32(uint32((*TFts5HashEntry)(unsafe.Pointer(p)).FnData) - (uint32(40) + uint32(nTerm))) + *(*int32)(unsafe.Pointer(pnDoclist)) = libc.Int32FromUint32(libc.Uint32FromInt32((*TFts5HashEntry)(unsafe.Pointer(p)).FnData) - (uint32(40) + libc.Uint32FromInt32(nTerm))) } else { *(*uintptr)(unsafe.Pointer(pzTerm)) = uintptr(0) *(*int32)(unsafe.Pointer(pnTerm)) = 0 @@ -210388,12 +203910,12 @@ type TFts5DlidxIter1 = struct { type Fts5DlidxIter1 = TFts5DlidxIter1 func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { - *(*Tu8)(unsafe.Pointer(aOut)) = uint8(int32(iVal) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(aOut + 1)) = uint8(int32(iVal) & libc.Int32FromInt32(0xFF)) + *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) } func _fts5GetU16(tls *libc.TLS, aIn uintptr) (r Tu16) { - return uint16(int32(uint16(*(*Tu8)(unsafe.Pointer(aIn))))<<int32(8) + int32(*(*Tu8)(unsafe.Pointer(aIn + 1)))) + return libc.Uint16FromInt32(libc.Int32FromUint16(uint16(*(*Tu8)(unsafe.Pointer(aIn))))<<int32(8) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIn + 1)))) } // C documentation @@ -210489,12 +204011,10 @@ func _fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) (r int32) v1 = (*TFts5Buffer)(unsafe.Pointer(pRight)).Fn } nCmp = v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if nCmp <= 0 { v2 = 0 } else { - v2 = libc.Xmemcmp(tls, (*TFts5Buffer)(unsafe.Pointer(pLeft)).Fp, (*TFts5Buffer)(unsafe.Pointer(pRight)).Fp, uint32(nCmp)) + v2 = libc.Xmemcmp(tls, (*TFts5Buffer)(unsafe.Pointer(pLeft)).Fp, (*TFts5Buffer)(unsafe.Pointer(pRight)).Fp, libc.Uint32FromInt32(nCmp)) } res = v2 if res == 0 { @@ -210551,7 +204071,6 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { pBlob = (*TFts5Index)(unsafe.Pointer(p)).FpReader (*TFts5Index)(unsafe.Pointer(p)).FpReader = uintptr(0) rc = Xsqlite3_blob_reopen(tls, pBlob, iRowid) - _ = libc.Int32FromInt32(0) (*TFts5Index)(unsafe.Pointer(p)).FpReader = pBlob if rc != SQLITE_OK { _sqlite3Fts5IndexCloseReader(tls, p) @@ -210564,7 +204083,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36312, iRowid, 0, p+48) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36341, iRowid, 0, p+48) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -210577,8 +204096,8 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { if rc == SQLITE_OK { aOut = uintptr(0) /* Read blob data into this buffer */ nByte = Xsqlite3_blob_bytes(tls, (*TFts5Index)(unsafe.Pointer(p)).FpReader) - nAlloc = int64(uint32(12) + uint32(nByte) + uint32(FTS5_DATA_PADDING)) - pRet = Xsqlite3_malloc64(tls, uint64(nAlloc)) + nAlloc = libc.Int64FromUint32(uint32(12) + libc.Uint32FromInt32(nByte) + uint32(FTS5_DATA_PADDING)) + pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nAlloc)) if pRet != 0 { (*TFts5Data)(unsafe.Pointer(pRet)).Fnn = nByte v1 = pRet + 1*12 @@ -210597,13 +204116,12 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { /* TODO1: Fix this */ *(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pRet)).Fp + uintptr(nByte))) = uint8(0x00) *(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pRet)).Fp + uintptr(nByte+int32(1)))) = uint8(0x00) - (*TFts5Data)(unsafe.Pointer(pRet)).FszLeaf = int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pRet)).Fp+2)) + (*TFts5Data)(unsafe.Pointer(pRet)).FszLeaf = libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pRet)).Fp+2)) } } (*TFts5Index)(unsafe.Pointer(p)).Frc = rc (*TFts5Index)(unsafe.Pointer(p)).FnRead++ } - _ = libc.Int32FromInt32(0) return pRet } @@ -210634,7 +204152,7 @@ func _fts5LeafRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { func _fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) (r int32) { if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if zSql != 0 { - (*TFts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).Fdb, zSql, -int32(1), uint32(libc.Int32FromInt32(SQLITE_PREPARE_PERSISTENT)|libc.Int32FromInt32(SQLITE_PREPARE_NO_VTAB)), ppStmt, uintptr(0)) + (*TFts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).Fdb, zSql, -int32(1), libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_PREPARE_PERSISTENT)|libc.Int32FromInt32(SQLITE_PREPARE_NO_VTAB)), ppStmt, uintptr(0)) } else { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -210658,7 +204176,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+52, Xsqlite3_mprintf(tls, __ccgo_ts+36318, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+52, Xsqlite3_mprintf(tls, __ccgo_ts+36347, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -210687,7 +204205,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36369, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36398, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+56, zSql) != 0 { return } @@ -210721,7 +204239,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+36418, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+36447, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -210747,7 +204265,6 @@ func _fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { v1 = *(*int32)(unsafe.Pointer(v2)) } if v3 && 0 >= v1 { - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel) { @@ -210800,10 +204317,10 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = int64(uint32(40) + uint32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint32(12)) + nByte = libc.Int64FromUint32(uint32(40) + libc.Uint32FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint32(12)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { - libc.Xmemcpy(tls, pNew, p, uint32(nByte)) + libc.Xmemcpy(tls, pNew, p, libc.Uint32FromInt64(nByte)) i = 0 for { if !(i < (*TFts5Structure)(unsafe.Pointer(p)).FnLevel) { @@ -210821,7 +204338,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { break } pLvl = pNew + 28 + uintptr(i)*12 - nByte = int64(uint32(48) * uint32((*(*TFts5StructureLevel)(unsafe.Pointer(pNew + 28 + uintptr(i)*12))).FnSeg)) + nByte = libc.Int64FromUint32(uint32(48) * libc.Uint32FromInt32((*(*TFts5StructureLevel)(unsafe.Pointer(pNew + 28 + uintptr(i)*12))).FnSeg)) (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = _sqlite3Fts5MallocZero(tls, pRc, nByte) if (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg == uintptr(0) { i = 0 @@ -210838,7 +204355,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { Xsqlite3_free(tls, pNew) return } - libc.Xmemcpy(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*(*TFts5StructureLevel)(unsafe.Pointer(p + 28 + uintptr(i)*12))).FaSeg, uint32(nByte)) + libc.Xmemcpy(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*(*TFts5StructureLevel)(unsafe.Pointer(p + 28 + uintptr(i)*12))).FaSeg, libc.Uint32FromInt64(nByte)) goto _2 _2: ; @@ -210891,7 +204408,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36458, uint32(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36487, uint32(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -210902,13 +204419,13 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } - nByte = int64(libc.Uint32FromInt64(40) + libc.Uint32FromInt64(12)*uint32(*(*int32)(unsafe.Pointer(bp + 4))-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint32(libc.Uint32FromInt64(40) + libc.Uint32FromInt64(12)*libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))-libc.Int32FromInt32(1))) pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5Structure)(unsafe.Pointer(pRet)).FnRef = int32(1) (*TFts5Structure)(unsafe.Pointer(pRet)).FnLevel = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5Structure)(unsafe.Pointer(pRet)).FnSegment = *(*int32)(unsafe.Pointer(bp + 8)) - i += int32(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pRet+4)) + i += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pRet+4)) iLvl = 0 for { if !(*(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && iLvl < *(*int32)(unsafe.Pointer(bp + 4))) { @@ -210924,7 +204441,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 12)) < (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } - (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = _sqlite3Fts5MallocZero(tls, bp, int64(uint32(*(*int32)(unsafe.Pointer(bp + 12)))*uint32(48))) + (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 12)))*uint32(48))) *(*int32)(unsafe.Pointer(bp + 8)) -= *(*int32)(unsafe.Pointer(bp + 12)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -210939,16 +204456,15 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) break } - _ = libc.Int32FromInt32(0) i += _sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg) i += _sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg+4) i += _sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg+8) if bStructureV2 != 0 { - i += int32(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pSeg+12)) - i += int32(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pSeg+20)) + i += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pSeg+12)) + i += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pSeg+20)) i += _sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg+28) - i += int32(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pSeg+32)) - i += int32(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pSeg+40)) + i += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pSeg+32)) + i += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, pData+uintptr(i), pSeg+40)) if nOriginCntr > (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin2 { v3 = nOriginCntr } else { @@ -211004,12 +204520,11 @@ func _fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { var pStruct uintptr _, _, _ = nByte, nLevel, pStruct _fts5StructureMakeWritable(tls, pRc, ppStruct) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { pStruct = *(*uintptr)(unsafe.Pointer(ppStruct)) nLevel = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel - nByte = int64(libc.Uint32FromInt64(40) + libc.Uint32FromInt64(12)*uint32(nLevel+libc.Int32FromInt32(1))) - pStruct = Xsqlite3_realloc64(tls, pStruct, uint64(nByte)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt64(40) + libc.Uint32FromInt64(12)*libc.Uint32FromInt32(nLevel+libc.Int32FromInt32(1))) + pStruct = Xsqlite3_realloc64(tls, pStruct, libc.Uint64FromInt64(nByte)) if pStruct != 0 { libc.Xmemset(tls, pStruct+28+uintptr(nLevel)*12, 0, uint32(12)) (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel++ @@ -211033,15 +204548,15 @@ func _fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl _, _, _, _ = aNew, nByte, nMove, pLvl if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { pLvl = pStruct + 28 + uintptr(iLvl)*12 - nByte = int64(uint32((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg+nExtra) * uint32(48)) - aNew = Xsqlite3_realloc64(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, uint64(nByte)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt32((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg+nExtra) * uint32(48)) + aNew = Xsqlite3_realloc64(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, libc.Uint64FromInt64(nByte)) if aNew != 0 { if bInsert == 0 { - libc.Xmemset(tls, aNew+uintptr((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)*48, 0, uint32(48)*uint32(nExtra)) + libc.Xmemset(tls, aNew+uintptr((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)*48, 0, uint32(48)*libc.Uint32FromInt32(nExtra)) } else { - nMove = int32(uint32((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg) * uint32(48)) - libc.Xmemmove(tls, aNew+uintptr(nExtra)*48, aNew, uint32(nMove)) - libc.Xmemset(tls, aNew, 0, uint32(48)*uint32(nExtra)) + nMove = libc.Int32FromUint32(libc.Uint32FromInt32((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg) * uint32(48)) + libc.Xmemmove(tls, aNew+uintptr(nExtra)*48, aNew, libc.Uint32FromInt32(nMove)) + libc.Xmemset(tls, aNew, 0, uint32(48)*libc.Uint32FromInt32(nExtra)) } (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = aNew } else { @@ -211084,7 +204599,7 @@ func _fts5IndexDataVersion(tls *libc.TLS, p uintptr) (r Ti64) { iVersion = 0 if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*TFts5Index)(unsafe.Pointer(p)).FpDataVersion == uintptr(0) { - (*TFts5Index)(unsafe.Pointer(p)).Frc = _fts5IndexPrepareStmt(tls, p, p+84, Xsqlite3_mprintf(tls, __ccgo_ts+36463, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb))) + (*TFts5Index)(unsafe.Pointer(p)).Frc = _fts5IndexPrepareStmt(tls, p, p+84, Xsqlite3_mprintf(tls, __ccgo_ts+36492, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return 0 } @@ -211120,8 +204635,6 @@ func _fts5StructureRead(tls *libc.TLS, p uintptr) (r uintptr) { if (*TFts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK { return uintptr(0) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _fts5StructureRef(tls, (*TFts5Index)(unsafe.Pointer(p)).FpStruct) return (*TFts5Index)(unsafe.Pointer(p)).FpStruct } @@ -211160,27 +204673,22 @@ func _fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { v1 = libc.Int32FromInt32(4) + libc.Int32FromInt32(9) + libc.Int32FromInt32(9) } /* Cookie value to store */ nHdr = v1 - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp, 0, uint32(12)) /* Append the current configuration cookie */ iCookie = (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiCookie if iCookie < 0 { iCookie = 0 } - if 0 == _sqlite3Fts5BufferSize(tls, p+40, bp, uint32(nHdr)) { + if 0 == _sqlite3Fts5BufferSize(tls, p+40, bp, libc.Uint32FromInt32(nHdr)) { _sqlite3Fts5Put32(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, iCookie) (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = int32(4) if (*TFts5Structure)(unsafe.Pointer(pStruct)).FnOriginCntr > uint64(0) { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36458, uint32(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36487, uint32(4)) *(*int32)(unsafe.Pointer(bp + 4)) += int32(4) } - *(*int32)(unsafe.Pointer(bp + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), uint64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(bp + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), uint64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment)) - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(bp + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), uint64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter))) - _ = libc.Int32FromInt32(0) + *(*int32)(unsafe.Pointer(bp + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) + *(*int32)(unsafe.Pointer(bp + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment)) + *(*int32)(unsafe.Pointer(bp + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt64(libc.Int64FromUint64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter))) } iLvl = 0 for { @@ -211190,7 +204698,6 @@ func _fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { pLvl = pStruct + 28 + uintptr(iLvl)*12 _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge)) _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)) - _ = libc.Int32FromInt32(0) iSeg = 0 for { if !(iSeg < (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg) { @@ -211201,11 +204708,11 @@ func _fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst)) _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast)) if (*TFts5Structure)(unsafe.Pointer(pStruct)).FnOriginCntr > uint64(0) { - _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin1)) - _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin2)) + _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, libc.Int64FromUint64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin1)) + _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, libc.Int64FromUint64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin2)) _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnPgTombstone)) - _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnEntryTombstone)) - _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnEntry)) + _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, libc.Int64FromUint64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnEntryTombstone)) + _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, libc.Int64FromUint64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnEntry)) } goto _3 _3: @@ -211323,7 +204830,6 @@ func _fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr if iTst >= 0 { szMax = 0 pTst = pStruct + 28 + uintptr(iTst)*12 - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TFts5StructureLevel)(unsafe.Pointer(pTst)).FnSeg) { @@ -211370,10 +204876,9 @@ func _fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) (r int32) { _, _, _ = iOff, pData, p2 pData = (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData if (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff == 0 { - _ = libc.Int32FromInt32(0) (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = int32(1) *(*int32)(unsafe.Pointer(pLvl + 4)) += _sqlite3Fts5GetVarint32(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp+1, pLvl+16) - *(*int32)(unsafe.Pointer(pLvl + 4)) += int32(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff), pLvl+20)) + *(*int32)(unsafe.Pointer(pLvl + 4)) += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff), pLvl+20)) (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff = (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff } else { iOff = (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff @@ -211391,7 +204896,7 @@ func _fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) (r int32) { } if iOff < (*TFts5Data)(unsafe.Pointer(pData)).Fnn { *(*int32)(unsafe.Pointer(pLvl + 16)) += iOff - (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff + int32(1) - iOff += int32(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr(iOff), bp)) + iOff += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr(iOff), bp)) p2 = pLvl + 20 *(*Ti64)(unsafe.Pointer(p2)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p2))) + *(*Tu64)(unsafe.Pointer(bp))) (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = iOff @@ -211411,7 +204916,6 @@ func _fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) (r var pLvl uintptr _ = pLvl pLvl = pIter + 8 + uintptr(iLvl)*28 - _ = libc.Int32FromInt32(0) if _fts5DlidxLvlNext(tls, pLvl) != 0 { if iLvl+int32(1) < (*TFts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl { _fts5DlidxIterNextR(tls, p, pIter, iLvl+int32(1)) @@ -211506,7 +205010,6 @@ func _fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) (r int32) { var _ /* delta at bp+0 */ Tu64 _, _, _, _, _ = a, iOff, ii, nZero, p1 iOff = (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff - _ = libc.Int32FromInt32(0) if iOff <= (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff { (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = int32(1) } else { @@ -211517,11 +205020,11 @@ func _fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) (r int32) { nZero = 0 ii = (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff *(*Tu64)(unsafe.Pointer(bp)) = uint64(0) - for int32(*(*Tu8)(unsafe.Pointer(a + uintptr(ii)))) == 0 { + for libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a + uintptr(ii)))) == 0 { nZero++ ii++ } - ii += int32(_sqlite3Fts5GetVarint(tls, a+uintptr(ii), bp)) + ii += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, a+uintptr(ii), bp)) if ii >= iOff { break } @@ -211538,7 +205041,6 @@ func _fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) (r var pLvl uintptr _ = pLvl pLvl = pIter + 8 + uintptr(iLvl)*28 - _ = libc.Int32FromInt32(0) if _fts5DlidxLvlPrev(tls, pLvl) != 0 { if iLvl+int32(1) < (*TFts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl { _fts5DlidxIterPrevR(tls, p, pIter, iLvl+int32(1)) @@ -211598,8 +205100,8 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = int64(uint32(36) + uint32(i)*uint32(28)) - pNew = Xsqlite3_realloc64(tls, pIter, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(36) + libc.Uint32FromInt32(i)*uint32(28)) + pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -211608,7 +205110,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea pIter = pNew libc.Xmemset(tls, pLvl, 0, uint32(28)) (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = _fts5DataRead(tls, p, iRowid) - if (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 && int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)).Fp)))&int32(0x0001) == 0 { + if (*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)).Fp)))&int32(0x0001) == 0 { bDone = int32(1) } (*TFts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl = i + int32(1) @@ -211690,12 +205192,11 @@ func _fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) n = 0 v1 = n n++ - *(*int32)(unsafe.Pointer(bp)) = int32(*(*Tu8)(unsafe.Pointer(p + uintptr(v1)))) + *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p + uintptr(v1)))) if *(*int32)(unsafe.Pointer(bp))&int32(0x80) != 0 { n-- n += _sqlite3Fts5GetVarint32(tls, p+uintptr(n), bp) } - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pnSz)) = *(*int32)(unsafe.Pointer(bp)) / int32(2) *(*int32)(unsafe.Pointer(pbDel)) = *(*int32)(unsafe.Pointer(bp)) & int32(0x0001) return n @@ -211722,7 +205223,6 @@ func _fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _ = iEod, iOff, v1, v2 if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { iOff = int32((*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset) /* Offset to read at */ - _ = libc.Int32FromInt32(0) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { if (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist < (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf { v1 = (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist @@ -211732,10 +205232,10 @@ func _fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { iEod = v1 (*TFts5SegIter)(unsafe.Pointer(pIter)).FbDel = uint8(0) (*TFts5SegIter)(unsafe.Pointer(pIter)).FnPos = int32(1) - if iOff < iEod && int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0 { + if iOff < iEod && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0 { (*TFts5SegIter)(unsafe.Pointer(pIter)).FbDel = uint8(1) iOff++ - if iOff < iEod && int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0 { + if iOff < iEod && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0 { (*TFts5SegIter)(unsafe.Pointer(pIter)).FnPos = int32(1) iOff++ } else { @@ -211745,14 +205245,13 @@ func _fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { } else { v2 = iOff iOff++ - *(*int32)(unsafe.Pointer(bp)) = int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(v2)))) + *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(v2)))) if *(*int32)(unsafe.Pointer(bp))&int32(0x80) != 0 { iOff-- iOff += _sqlite3Fts5GetVarint32(tls, (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp) } - (*TFts5SegIter)(unsafe.Pointer(pIter)).FbDel = uint8(*(*int32)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0x0001)) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FbDel = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0x0001)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FnPos = *(*int32)(unsafe.Pointer(bp)) >> int32(1) - _ = libc.Int32FromInt32(0) } (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(iOff) } @@ -211764,7 +205263,6 @@ func _fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { _, _ = a, iOff a = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp /* Buffer to read data from */ iOff = (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset - _ = libc.Int32FromInt32(0) for iOff >= int64((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) { _fts5SegIterNextPage(tls, p, pIter) if (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0) { @@ -211776,7 +205274,7 @@ func _fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { iOff = int64(4) a = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp } - iOff += int64(_sqlite3Fts5GetVarint(tls, a+uintptr(iOff), pIter+80)) + iOff += libc.Int64FromUint8(_sqlite3Fts5GetVarint(tls, a+uintptr(iOff), pIter+80)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff } @@ -211813,8 +205311,7 @@ func _fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) return } (*TFts5SegIter)(unsafe.Pointer(pIter)).Fterm.Fn = nKeep - _sqlite3Fts5BufferAppendBlob(tls, p+40, pIter+68, uint32(*(*int32)(unsafe.Pointer(bp))), a+uintptr(iOff)) - _ = libc.Int32FromInt32(0) + _sqlite3Fts5BufferAppendBlob(tls, p+40, pIter+68, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))), a+uintptr(iOff)) iOff += int64(*(*int32)(unsafe.Pointer(bp))) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = int32(iOff) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno = (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno @@ -211853,7 +205350,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = int32(uint32(nTomb)*uint32(4) + uint32(12)) + nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nTomb)*uint32(4) + uint32(12)) pNew = _sqlite3Fts5MallocZero(tls, p+40, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -211880,7 +205377,6 @@ func _fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { ** fts5TrimSegments() for details. In this case leave the iterator empty. ** The caller will see the (pIter->pLeaf==0) and assume the iterator is ** at EOF already. */ - _ = libc.Int32FromInt32(0) return } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -211894,9 +205390,6 @@ func _fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 { (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(4) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf + int32(1) _fts5SegIterLoadTerm(tls, p, pIter, 0) _fts5SegIterLoadNPos(tls, p, pIter) @@ -211938,14 +205431,13 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { if n > (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist { n = (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist } - _ = libc.Int32FromInt32(0) for int32(1) != 0 { *(*Tu64)(unsafe.Pointer(bp)) = uint64(0) if eDetail == int32(FTS5_DETAIL_NONE) { /* todo */ - if i < n && int32(*(*Tu8)(unsafe.Pointer(a + uintptr(i)))) == 0 { + if i < n && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a + uintptr(i)))) == 0 { i++ - if i < n && int32(*(*Tu8)(unsafe.Pointer(a + uintptr(i)))) == 0 { + if i < n && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a + uintptr(i)))) == 0 { i++ } } @@ -211956,13 +205448,13 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { if i >= n { break } - i += int32(_sqlite3Fts5GetVarint(tls, a+uintptr(i), bp)) + i += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, a+uintptr(i), bp)) p1 = pIter + 80 *(*Ti64)(unsafe.Pointer(p1)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p1))) + *(*Tu64)(unsafe.Pointer(bp))) /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(uint32(nNew)*uint32(4))) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint32FromInt32(nNew)*uint32(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -211988,8 +205480,6 @@ func _fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { var a, pNew uintptr var iRowidOff int32 _, _, _ = a, iRowidOff, pNew - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0) for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno > (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno { @@ -212000,13 +205490,12 @@ func _fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { ** thing on the page - i.e. the first rowid is on the following page. ** In this case leave pIter->pLeaf==0, this iterator is at EOF. */ if (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno == (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno { - _ = libc.Int32FromInt32(0) if (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset < (*TFts5Data)(unsafe.Pointer(pNew)).FszLeaf { (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pNew (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64((*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset) } } else { - iRowidOff = int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pNew)).Fp)) + iRowidOff = libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pNew)).Fp)) if iRowidOff != 0 { if iRowidOff >= (*TFts5Data)(unsafe.Pointer(pNew)).FszLeaf { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) @@ -212018,7 +205507,7 @@ func _fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { } if (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 { a = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr((*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset) - *(*Ti64)(unsafe.Pointer(pIter + 20)) += int64(_sqlite3Fts5GetVarint(tls, a, pIter+80)) + *(*Ti64)(unsafe.Pointer(pIter + 20)) += libc.Int64FromUint8(_sqlite3Fts5GetVarint(tls, a, pIter+80)) break } else { _fts5DataRelease(tls, pNew) @@ -212059,8 +205548,6 @@ func _fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused var iOff int32 var _ /* iDelta at bp+0 */ Tu64 _, _, _ = a, iOff, p1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) _ = pbUnused if (*TFts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset > 0 { a = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp @@ -212098,10 +205585,6 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui var _ /* pList at bp+12 */ uintptr var _ /* zTerm at bp+16 */ uintptr _ = iOff - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) iOff = int32((*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset) /* Next entry is on the next page */ for (*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0 && iOff >= (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf { @@ -212113,7 +205596,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui iOff = int32(4) } if iOff < (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist { - iOff += int32(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp)) + iOff += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(iOff) *(*Ti64)(unsafe.Pointer(pIter + 80)) += *(*Ti64)(unsafe.Pointer(bp)) } else { @@ -212139,7 +205622,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf = *(*int32)(unsafe.Pointer(bp + 24)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 24)) _sqlite3Fts5BufferSet(tls, p+40, pIter+68, *(*int32)(unsafe.Pointer(bp + 20)), *(*uintptr)(unsafe.Pointer(bp + 16))) - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(_sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 12)), pIter+80)) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = libc.Int64FromUint8(_sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 12)), pIter+80)) } if pbNewTerm != 0 { *(*int32)(unsafe.Pointer(pbNewTerm)) = int32(1) @@ -212184,26 +205667,21 @@ func _fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr pLeaf = (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf bNewTerm = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Search for the end of the position list within the current page. */ a = (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp n = (*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = int32((*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset + int64((*TFts5SegIter)(unsafe.Pointer(pIter)).FnPos)) if *(*int32)(unsafe.Pointer(bp)) < n { /* The next entry is on the current page. */ - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist { bNewTerm = int32(1) if *(*int32)(unsafe.Pointer(bp)) != _fts5LeafFirstTermOff(tls, pLeaf) { *(*int32)(unsafe.Pointer(bp)) += _sqlite3Fts5GetVarint32(tls, a+uintptr(*(*int32)(unsafe.Pointer(bp))), bp+4) } } else { - *(*int32)(unsafe.Pointer(bp)) += int32(_sqlite3Fts5GetVarint(tls, a+uintptr(*(*int32)(unsafe.Pointer(bp))), bp+8)) + *(*int32)(unsafe.Pointer(bp)) += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, a+uintptr(*(*int32)(unsafe.Pointer(bp))), bp+8)) p1 = pIter + 80 *(*Ti64)(unsafe.Pointer(p1)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p1))) + *(*Tu64)(unsafe.Pointer(bp + 8))) - _ = libc.Int32FromInt32(0) } (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(*(*int32)(unsafe.Pointer(bp))) } else { @@ -212212,7 +205690,6 @@ func _fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr *(*uintptr)(unsafe.Pointer(bp + 20)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 24)) = 0 *(*int32)(unsafe.Pointer(bp + 28)) = 0 - _ = libc.Int32FromInt32(0) if 0 == (*TFts5SegIter)(unsafe.Pointer(pIter)).Fflags&int32(FTS5_SEGITER_ONETERM) { _sqlite3Fts5HashScanNext(tls, (*TFts5Index)(unsafe.Pointer(p)).FpHash) _sqlite3Fts5HashScanEntry(tls, (*TFts5Index)(unsafe.Pointer(p)).FpHash, bp+20, bp+24, bp+16, bp+28) @@ -212226,7 +205703,7 @@ func _fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf = *(*int32)(unsafe.Pointer(bp + 28)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 28)) + int32(1) _sqlite3Fts5BufferSet(tls, p+40, pIter+68, *(*int32)(unsafe.Pointer(bp + 24)), *(*uintptr)(unsafe.Pointer(bp + 20))) - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(_sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), pIter+80)) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = libc.Int64FromUint8(_sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), pIter+80)) *(*int32)(unsafe.Pointer(pbNewTerm)) = int32(1) } } else { @@ -212238,11 +205715,10 @@ func _fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr if pLeaf == uintptr(0) { break } - _ = libc.Int32FromInt32(0) - v2 = int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) + v2 = libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 && *(*int32)(unsafe.Pointer(bp)) < (*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf { - *(*int32)(unsafe.Pointer(bp)) += int32(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(*(*int32)(unsafe.Pointer(bp))), pIter+80)) + *(*int32)(unsafe.Pointer(bp)) += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(*(*int32)(unsafe.Pointer(bp))), pIter+80)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(*(*int32)(unsafe.Pointer(bp))) if (*TFts5Data)(unsafe.Pointer(pLeaf)).Fnn > (*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf { (*TFts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf + _sqlite3Fts5GetVarint32(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf), pIter+48) @@ -212255,7 +205731,6 @@ func _fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr bNewTerm = int32(1) } } - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) > (*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) return @@ -212277,18 +205752,16 @@ func _fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr } } } else { - _ = libc.Int32FromInt32(0) v4 = pIter + 20 v3 = *(*Ti64)(unsafe.Pointer(v4)) *(*Ti64)(unsafe.Pointer(v4))++ - *(*int32)(unsafe.Pointer(bp + 32)) = int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(v3)))) + *(*int32)(unsafe.Pointer(bp + 32)) = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(v3)))) if *(*int32)(unsafe.Pointer(bp + 32))&int32(0x80) != 0 { (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset-- *(*Ti64)(unsafe.Pointer(pIter + 20)) += int64(_sqlite3Fts5GetVarint32(tls, (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr((*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset), bp+32)) } - (*TFts5SegIter)(unsafe.Pointer(pIter)).FbDel = uint8(*(*int32)(unsafe.Pointer(bp + 32)) & libc.Int32FromInt32(0x0001)) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FbDel = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp + 32)) & libc.Int32FromInt32(0x0001)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FnPos = *(*int32)(unsafe.Pointer(bp + 32)) >> int32(1) - _ = libc.Int32FromInt32(0) } } } @@ -212323,7 +205796,7 @@ func _fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { for { v1 = iPoslist iPoslist++ - if !(int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(v1))))&int32(0x80) != 0 && iPoslist < iEnd) { + if !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(v1))))&int32(0x80) != 0 && iPoslist < iEnd) { break } } @@ -212343,7 +205816,7 @@ func _fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { iAbs = int64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)+libc.Int32FromInt32(FTS5_DATA_DLI_B)) + int64(libc.Int32FromInt32(0))<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)) + int64(libc.Int32FromInt32(0))<<libc.Int32FromInt32(FTS5_DATA_PAGE_B) + int64(pgno) pNew = _fts5LeafRead(tls, p, iAbs) if pNew != 0 { - iRowid = int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pNew)).Fp)) + iRowid = libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pNew)).Fp)) bTermless = libc.BoolInt32((*TFts5Data)(unsafe.Pointer(pNew)).FszLeaf >= (*TFts5Data)(unsafe.Pointer(pNew)).Fnn) if iRowid != 0 { tmp = pNew @@ -212376,12 +205849,12 @@ func _fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pLast (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = pgnoLast - iOff = int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLast)).Fp)) + iOff = libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLast)).Fp)) if iOff > (*TFts5Data)(unsafe.Pointer(pLast)).FszLeaf { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) return } - iOff += int32(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pLast)).Fp+uintptr(iOff), pIter+80)) + iOff += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pLast)).Fp+uintptr(iOff), pIter+80)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(iOff) if (*TFts5Data)(unsafe.Pointer(pLast)).FszLeaf >= (*TFts5Data)(unsafe.Pointer(pLast)).Fnn { (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*TFts5Data)(unsafe.Pointer(pLast)).Fnn + int32(1) @@ -212407,8 +205880,6 @@ func _fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { iSeg = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid bRev = (*TFts5SegIter)(unsafe.Pointer(pIter)).Fflags & int32(FTS5_SEGITER_REVERSE) pLeaf = (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf /* Current leaf data */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Check if the current doclist ends on this page. If it does, return ** early without loading the doclist-index (as it belongs to a different ** term. */ @@ -212448,14 +205919,13 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin var _ /* nNew at bp+8 */ Tu32 _, _, _, _, _, _, _, _, _, _ = a, bEndOfPage, i, iPgidx, n, nCmp, nMatch, v1, v2, v4 a = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp - n = uint32((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn) + n = libc.Uint32FromInt32((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn) nMatch = uint32(0) *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(0) *(*Tu32)(unsafe.Pointer(bp + 8)) = uint32(0) /* Current offset in pgidx */ bEndOfPage = 0 - _ = libc.Int32FromInt32(0) - iPgidx = uint32((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) - iPgidx += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+12)) + iPgidx = libc.Uint32FromInt32((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) + iPgidx += libc.Uint32FromInt32(_sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+12)) *(*Tu32)(unsafe.Pointer(bp)) = *(*Tu32)(unsafe.Pointer(bp + 12)) if *(*Tu32)(unsafe.Pointer(bp)) > n { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) @@ -212468,17 +205938,16 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp + 8)) = uint32(*(*Tu8)(unsafe.Pointer(a + uintptr(v1)))) if *(*Tu32)(unsafe.Pointer(bp + 8))&uint32(0x80) != 0 { *(*Tu32)(unsafe.Pointer(bp))-- - *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+8)) + *(*Tu32)(unsafe.Pointer(bp)) += libc.Uint32FromInt32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+8)) } if *(*Tu32)(unsafe.Pointer(bp + 4)) < nMatch { goto search_failed } - _ = libc.Int32FromInt32(0) if *(*Tu32)(unsafe.Pointer(bp + 4)) == nMatch { - if *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(nTerm)-nMatch { + if *(*Tu32)(unsafe.Pointer(bp + 8)) < libc.Uint32FromInt32(nTerm)-nMatch { v2 = *(*Tu32)(unsafe.Pointer(bp + 8)) } else { - v2 = uint32(nTerm) - nMatch + v2 = libc.Uint32FromInt32(nTerm) - nMatch } nCmp = v2 i = uint32(0) @@ -212486,7 +205955,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin if !(i < nCmp) { break } - if int32(*(*Tu8)(unsafe.Pointer(a + uintptr(*(*Tu32)(unsafe.Pointer(bp))+i)))) != int32(*(*Tu8)(unsafe.Pointer(pTerm + uintptr(nMatch+i)))) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a + uintptr(*(*Tu32)(unsafe.Pointer(bp))+i)))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTerm + uintptr(nMatch+i)))) { break } goto _3 @@ -212495,14 +205964,14 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin i++ } nMatch += i - if uint32(nTerm) == nMatch { + if libc.Uint32FromInt32(nTerm) == nMatch { if i == *(*Tu32)(unsafe.Pointer(bp + 8)) { goto search_success } else { goto search_failed } } else { - if i < *(*Tu32)(unsafe.Pointer(bp + 8)) && int32(*(*Tu8)(unsafe.Pointer(a + uintptr(*(*Tu32)(unsafe.Pointer(bp))+i)))) > int32(*(*Tu8)(unsafe.Pointer(pTerm + uintptr(nMatch)))) { + if i < *(*Tu32)(unsafe.Pointer(bp + 8)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a + uintptr(*(*Tu32)(unsafe.Pointer(bp))+i)))) > libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTerm + uintptr(nMatch)))) { goto search_failed } } @@ -212511,7 +205980,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin bEndOfPage = int32(1) break } - iPgidx += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+4)) + iPgidx += libc.Uint32FromInt32(_sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+4)) *(*Tu32)(unsafe.Pointer(bp + 12)) += *(*Tu32)(unsafe.Pointer(bp + 4)) *(*Tu32)(unsafe.Pointer(bp)) = *(*Tu32)(unsafe.Pointer(bp + 12)) if *(*Tu32)(unsafe.Pointer(bp)) >= n { @@ -212524,7 +205993,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(*(*Tu8)(unsafe.Pointer(a + uintptr(v4)))) if *(*Tu32)(unsafe.Pointer(bp + 4))&uint32(0x80) != 0 { *(*Tu32)(unsafe.Pointer(bp))-- - *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) + *(*Tu32)(unsafe.Pointer(bp)) += libc.Uint32FromInt32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } goto search_failed @@ -212543,16 +206012,16 @@ search_failed: } a = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp if libc.BoolInt32((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf >= (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn) == 0 { - iPgidx = uint32((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) - iPgidx += uint32(_sqlite3Fts5GetVarint32(tls, (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iPgidx), bp)) - if *(*Tu32)(unsafe.Pointer(bp)) < uint32(4) || int64(*(*Tu32)(unsafe.Pointer(bp))) >= int64((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) { + iPgidx = libc.Uint32FromInt32((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) + iPgidx += libc.Uint32FromInt32(_sqlite3Fts5GetVarint32(tls, (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iPgidx), bp)) + if *(*Tu32)(unsafe.Pointer(bp)) < uint32(4) || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) >= int64((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) return } else { *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(0) *(*Tu32)(unsafe.Pointer(bp + 12)) = *(*Tu32)(unsafe.Pointer(bp)) - n = uint32((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn) - *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+8)) + n = libc.Uint32FromInt32((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn) + *(*Tu32)(unsafe.Pointer(bp)) += libc.Uint32FromInt32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+8)) break } } @@ -212562,22 +206031,22 @@ search_failed: goto search_success search_success: ; - if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { + if libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp)))+libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 8))) > libc.Int64FromUint32(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) return } - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(*(*Tu32)(unsafe.Pointer(bp)) + *(*Tu32)(unsafe.Pointer(bp + 8))) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp)) + *(*Tu32)(unsafe.Pointer(bp + 8))) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = int32((*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno = (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno - _sqlite3Fts5BufferSet(tls, p+40, pIter+68, int32(*(*Tu32)(unsafe.Pointer(bp + 4))), pTerm) + _sqlite3Fts5BufferSet(tls, p+40, pIter+68, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))), pTerm) _sqlite3Fts5BufferAppendBlob(tls, p+40, pIter+68, *(*Tu32)(unsafe.Pointer(bp + 8)), a+uintptr(*(*Tu32)(unsafe.Pointer(bp)))) if iPgidx >= n { (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + int32(1) } else { - iPgidx += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+16)) - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = int32(*(*Tu32)(unsafe.Pointer(bp + 12)) + uint32(*(*int32)(unsafe.Pointer(bp + 16)))) + iPgidx += libc.Uint32FromInt32(_sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+16)) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp + 12)) + libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 16)))) } - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = int32(iPgidx) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = libc.Int32FromUint32(iPgidx) _fts5SegIterLoadRowid(tls, p, pIter) _fts5SegIterLoadNPos(tls, p, pIter) } @@ -212589,7 +206058,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+36486, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+36515, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -212612,8 +206081,6 @@ func _fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, bGe = flags & int32(FTS5INDEX_QUERY_SCAN) bDlidx = 0 /* True if there is a doclist-index */ pIdxSelect = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, pIter, 0, uint32(96)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg = pSeg /* This block sets stack variable iPg to the leaf page number that may @@ -212666,7 +206133,6 @@ func _fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, ** 4) the FTS5INDEX_QUERY_SCAN flag was set and the iterator points ** to an entry with a term greater than or equal to (pTerm/nTerm). */ - _ = libc.Int32FromInt32(0) } // C documentation @@ -212681,7 +206147,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+36570, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+36599, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -212706,7 +206172,6 @@ func _fts5SegIterNextInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, pSel = uintptr(0) /* SELECT to find iPg */ pSel = _fts5IdxNextStmt(tls, p) if pSel != 0 { - _ = libc.Int32FromInt32(0) Xsqlite3_bind_int(tls, pSel, int32(1), (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid) Xsqlite3_bind_blob(tls, pSel, int32(2), pTerm, nTerm, libc.UintptrFromInt32(0)) if Xsqlite3_step(tls, pSel) == int32(SQLITE_ROW) { @@ -212739,7 +206204,6 @@ func _fts5SegIterNextInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, if bDlidx != 0 { _fts5SegIterLoadDlidx(tls, p, pIter) } - _ = libc.Int32FromInt32(0) } } @@ -212767,8 +206231,6 @@ func _fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = 0 *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if pTerm == uintptr(0) || flags&int32(FTS5INDEX_QUERY_SCAN) != 0 { *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) (*TFts5Index)(unsafe.Pointer(p)).Frc = _sqlite3Fts5HashScanInit(tls, (*TFts5Index)(unsafe.Pointer(p)).FpHash, pTerm, nTerm) @@ -212801,7 +206263,7 @@ func _fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, (*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FszLeaf = v1 (*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).Fnn = v1 (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = *(*uintptr)(unsafe.Pointer(bp + 12)) - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).Fp, pIter+80)) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = libc.Int64FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).Fp, pIter+80)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).Fnn if flags&int32(FTS5INDEX_QUERY_DESC) != 0 { *(*int32)(unsafe.Pointer(pIter + 4)) |= int32(FTS5_SEGITER_REVERSE) @@ -212896,14 +206358,12 @@ func _fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) (r int32) var p1, p2, pRes uintptr _, _, _, _, _, _, _, _ = i1, i2, iRes, p1, p2, pRes, res, v1 /* Right-hand Fts5SegIter */ pRes = (*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut)*4 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if iOut >= (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg/int32(2) { i1 = (iOut - (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg/int32(2)) * int32(2) i2 = i1 + int32(1) } else { - i1 = int32((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut*int32(2))*4))).FiFirst) - i2 = int32((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut*int32(2)+int32(1))*4))).FiFirst) + i1 = libc.Int32FromUint16((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut*int32(2))*4))).FiFirst) + i2 = libc.Int32FromUint16((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut*int32(2)+int32(1))*4))).FiFirst) } p1 = pIter + 72 + uintptr(i1)*96 p2 = pIter + 72 + uintptr(i2)*96 @@ -212916,8 +206376,6 @@ func _fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) (r int32) } else { res = _fts5BufferCompare(tls, p1+68, p2+68) if res == 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) (*TFts5CResult)(unsafe.Pointer(pRes)).FbTermEq = uint8(1) if (*TFts5SegIter)(unsafe.Pointer(p1)).FiRowid == (*TFts5SegIter)(unsafe.Pointer(p2)).FiRowid { return i2 @@ -212929,7 +206387,6 @@ func _fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) (r int32) } res = v1 } - _ = libc.Int32FromInt32(0) if res < 0 { iRes = i1 } else { @@ -212937,7 +206394,7 @@ func _fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) (r int32) } } } - (*TFts5CResult)(unsafe.Pointer(pRes)).FiFirst = uint16(iRes) + (*TFts5CResult)(unsafe.Pointer(pRes)).FiFirst = libc.Uint16FromInt32(iRes) return 0 } @@ -212952,7 +206409,6 @@ func _fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int var a uintptr var iOff, n int32 _, _, _ = a, iOff, n - _ = libc.Int32FromInt32(0) if iLeafPgno > (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FpgnoLast { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } else { @@ -212964,14 +206420,14 @@ func _fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int if (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0) { break } - iOff = int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp)) + iOff = libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp)) if iOff > 0 { a = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp n = (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf if iOff < int32(4) || iOff >= n { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } else { - iOff += int32(_sqlite3Fts5GetVarint(tls, a+uintptr(iOff), pIter+80)) + iOff += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, a+uintptr(iOff), pIter+80)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(iOff) _fts5SegIterLoadNPos(tls, p, pIter) } @@ -212996,27 +206452,20 @@ func _fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch Ti64) pDlidx = (*TFts5SegIter)(unsafe.Pointer(pIter)).FpDlidx iLeafPgno = (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno bMove = int32(1) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if bRev == 0 { for !(_fts5DlidxIterEof(tls, p, pDlidx) != 0) && iMatch > _fts5DlidxIterRowid(tls, pDlidx) { iLeafPgno = _fts5DlidxIterPgno(tls, pDlidx) _fts5DlidxIterNext(tls, p, pDlidx) } - _ = libc.Int32FromInt32(0) if iLeafPgno > (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno { _fts5SegIterGotoPage(tls, p, pIter, iLeafPgno) bMove = 0 } } else { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for !(_fts5DlidxIterEof(tls, p, pDlidx) != 0) && iMatch < _fts5DlidxIterRowid(tls, pDlidx) { _fts5DlidxIterPrev(tls, p, pDlidx) } iLeafPgno = _fts5DlidxIterPgno(tls, pDlidx) - _ = libc.Int32FromInt32(0) if iLeafPgno < (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno { (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = iLeafPgno + int32(1) _fts5SegIterReverseNewPage(tls, p, pIter) @@ -213078,7 +206527,6 @@ func _fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged in iEq = v2 if v2 != 0 { pSeg = pIter + 72 + uintptr(iEq)*96 - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5SegIter)(unsafe.Pointer(pSeg)).FxNext})))(tls, p, pSeg, uintptr(0)) i = (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg + iEq } @@ -213121,8 +206569,6 @@ func _fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, pp break } pRes = (*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(i)*4 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5CResult)(unsafe.Pointer(pRes)).FbTermEq != 0 { if (*TFts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*TFts5SegIter)(unsafe.Pointer(pOther)).FiRowid { return int32(1) @@ -213137,7 +206583,7 @@ func _fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, pp } } } - (*TFts5CResult)(unsafe.Pointer(pRes)).FiFirst = uint16((int32(pNew) - t__predefined_ptrdiff_t(pIter+72)) / 96) + (*TFts5CResult)(unsafe.Pointer(pRes)).FiFirst = libc.Uint16FromInt32((int32(pNew) - t__predefined_ptrdiff_t(pIter+72)) / 96) if i == int32(1) { break } @@ -213181,14 +206627,14 @@ func _fts5IndexTombstoneQuery(tls *libc.TLS, pHash uintptr, nHashTable int32, iR var aSlot, aSlot1 uintptr var iSlot, nCollide, nSlot, szKey, v1, v2, v3, v4, v5 int32 _, _, _, _, _, _, _, _, _, _, _ = aSlot, aSlot1, iSlot, nCollide, nSlot, szKey, v1, v2, v3, v4, v5 - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pHash)).Fp))) == int32(4) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pHash)).Fp))) == int32(4) { v1 = int32(4) } else { v1 = int32(8) } szKey = v1 if (*TFts5Data)(unsafe.Pointer(pHash)).Fnn > int32(16) { - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pHash)).Fp))) == int32(4) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pHash)).Fp))) == int32(4) { v3 = int32(4) } else { v3 = int32(8) @@ -213198,10 +206644,10 @@ func _fts5IndexTombstoneQuery(tls *libc.TLS, pHash uintptr, nHashTable int32, iR v2 = int32(1) } nSlot = v2 - iSlot = int32(iRowid / uint64(nHashTable) % uint64(nSlot)) + iSlot = libc.Int32FromUint64(iRowid / libc.Uint64FromInt32(nHashTable) % libc.Uint64FromInt32(nSlot)) nCollide = nSlot if iRowid == uint64(0) { - return int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pHash)).Fp + 1))) + return libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pHash)).Fp + 1))) } else { if szKey == int32(4) { aSlot = (*TFts5Data)(unsafe.Pointer(pHash)).Fp + 8 @@ -213245,13 +206691,12 @@ func _fts5MultiIterIsDeleted(tls *libc.TLS, pIter uintptr) (r int32) { var iFirst, iPg int32 var pArray, pSeg uintptr _, _, _, _ = iFirst, iPg, pArray, pSeg - iFirst = int32((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4))).FiFirst) + iFirst = libc.Int32FromUint16((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4))).FiFirst) pSeg = pIter + 72 + uintptr(iFirst)*96 pArray = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FpTombArray if (*TFts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 && pArray != 0 { /* Figure out which page the rowid might be present on. */ - iPg = int32(uint64((*TFts5SegIter)(unsafe.Pointer(pSeg)).FiRowid) % uint64((*TFts5TombstoneArray)(unsafe.Pointer(pArray)).FnTombstone)) - _ = libc.Int32FromInt32(0) + iPg = libc.Int32FromUint64(libc.Uint64FromInt64((*TFts5SegIter)(unsafe.Pointer(pSeg)).FiRowid) % libc.Uint64FromInt32((*TFts5TombstoneArray)(unsafe.Pointer(pArray)).FnTombstone)) /* If tombstone hash page iPg has not yet been loaded from the ** database, load it now. */ if *(*uintptr)(unsafe.Pointer(pArray + 8 + uintptr(iPg)*4)) == uintptr(0) { @@ -213260,7 +206705,7 @@ func _fts5MultiIterIsDeleted(tls *libc.TLS, pIter uintptr) (r int32) { return 0 } } - return _fts5IndexTombstoneQuery(tls, *(*uintptr)(unsafe.Pointer(pArray + 8 + uintptr(iPg)*4)), (*TFts5TombstoneArray)(unsafe.Pointer(pArray)).FnTombstone, uint64((*TFts5SegIter)(unsafe.Pointer(pSeg)).FiRowid)) + return _fts5IndexTombstoneQuery(tls, *(*uintptr)(unsafe.Pointer(pArray + 8 + uintptr(iPg)*4)), (*TFts5TombstoneArray)(unsafe.Pointer(pArray)).FnTombstone, libc.Uint64FromInt64((*TFts5SegIter)(unsafe.Pointer(pSeg)).FiRowid)) } return 0 } @@ -213282,12 +206727,10 @@ func _fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iF var _ /* pSeg at bp+4 */ uintptr _, _ = bUseFrom, iFirst bUseFrom = bFrom - _ = libc.Int32FromInt32(0) for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - iFirst = int32((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4))).FiFirst) + iFirst = libc.Int32FromUint16((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4))).FiFirst) *(*int32)(unsafe.Pointer(bp)) = 0 *(*uintptr)(unsafe.Pointer(bp + 4)) = pIter + 72 + uintptr(iFirst)*96 - _ = libc.Int32FromInt32(0) if bUseFrom != 0 && (*TFts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FpDlidx != 0 { _fts5SegIterNextFrom(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4)), iFrom) } else { @@ -213301,8 +206744,7 @@ func _fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iF return } } - _ = libc.Int32FromInt32(0) - if (int32((*TFts5Iter)(unsafe.Pointer(pIter)).FbSkipEmpty) == 0 || (*TFts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FnPos != 0) && 0 == _fts5MultiIterIsDeleted(tls, pIter) { + if (libc.Int32FromUint8((*TFts5Iter)(unsafe.Pointer(pIter)).FbSkipEmpty) == 0 || (*TFts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FnPos != 0) && 0 == _fts5MultiIterIsDeleted(tls, pIter) { (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs})))(tls, pIter, *(*uintptr)(unsafe.Pointer(bp + 4))) return } @@ -213317,14 +206759,12 @@ func _fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uint var _ /* bNewTerm at bp+4 */ int32 var _ /* pSeg at bp+0 */ uintptr _ = iFirst - _ = libc.Int32FromInt32(0) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*int32)(unsafe.Pointer(pbNewTerm)) = 0 for cond := true; cond; cond = (_fts5MultiIterIsEmpty(tls, p, pIter) != 0 || _fts5MultiIterIsDeleted(tls, pIter) != 0) && (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - iFirst = int32((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4))).FiFirst) + iFirst = libc.Int32FromUint16((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4))).FiFirst) *(*uintptr)(unsafe.Pointer(bp)) = pIter + 72 + uintptr(iFirst)*96 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - _ = libc.Int32FromInt32(0) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxNext})))(tls, p, *(*uintptr)(unsafe.Pointer(bp)), bp+4) if (*TFts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpLeaf == uintptr(0) || *(*int32)(unsafe.Pointer(bp + 4)) != 0 || _fts5MultiIterAdvanceRowid(tls, pIter, iFirst, bp) != 0 { _fts5MultiIterAdvanced(tls, p, pIter, iFirst, int32(1)) @@ -213366,10 +206806,8 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { func _fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { _ = pUnused - _ = libc.Int32FromInt32(0) if nChunk > 0 { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pContext)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pContext)).Fn), pChunk, uint32(nChunk)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pContext)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pContext)).Fn), pChunk, libc.Uint32FromInt32(nChunk)) *(*int32)(unsafe.Pointer(pContext + 4)) += nChunk } } @@ -213441,7 +206879,6 @@ func _fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintpt _, _ = i, pCtx pCtx = pContext _ = pUnused - _ = libc.Int32FromInt32(0) if nChunk > 0 { i = 0 for i < nChunk { @@ -213449,8 +206886,7 @@ func _fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintpt *(*int32)(unsafe.Pointer(bp)) += (*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiRead - int32(2) (*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiRead = *(*int32)(unsafe.Pointer(bp)) if _fts5IndexColsetTest(tls, (*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp))) != 0 { - *(*int32)(unsafe.Pointer((*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer((*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer((*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), uint64(*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(2)-(*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite)) - _ = libc.Int32FromInt32(0) + *(*int32)(unsafe.Pointer((*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer((*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer((*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(2)-(*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite)) (*TPoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite = *(*int32)(unsafe.Pointer(bp)) } } @@ -213467,7 +206903,6 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr _, _, _, _, _ = i, iStart, pCtx, v1, v2 pCtx = pContext _ = pUnused - _ = libc.Int32FromInt32(0) if nChunk > 0 { /* Search through to find the first varint with value 1. This is the ** start of the next columns hits. */ @@ -213476,29 +206911,27 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr if (*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState == int32(2) { v1 = i i++ - *(*int32)(unsafe.Pointer(bp)) = int32(*(*Tu8)(unsafe.Pointer(pChunk + uintptr(v1)))) + *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pChunk + uintptr(v1)))) if *(*int32)(unsafe.Pointer(bp))&int32(0x80) != 0 { i-- i += _sqlite3Fts5GetVarint32(tls, pChunk+uintptr(i), bp) } if _fts5IndexColsetTest(tls, (*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp))) != 0 { (*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = int32(1) - *(*int32)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), uint64(libc.Int32FromInt32(1))) - _ = libc.Int32FromInt32(0) + *(*int32)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), libc.Uint64FromInt32(libc.Int32FromInt32(1))) } else { (*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = 0 } } for cond := true; cond; cond = i < nChunk { - for i < nChunk && int32(*(*Tu8)(unsafe.Pointer(pChunk + uintptr(i)))) != int32(0x01) { - for int32(*(*Tu8)(unsafe.Pointer(pChunk + uintptr(i))))&int32(0x80) != 0 { + for i < nChunk && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pChunk + uintptr(i)))) != int32(0x01) { + for libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pChunk + uintptr(i))))&int32(0x80) != 0 { i++ } i++ } if (*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState != 0 { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), pChunk+uintptr(iStart), uint32(i-iStart)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), pChunk+uintptr(iStart), libc.Uint32FromInt32(i-iStart)) *(*int32)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += i - iStart } if i < nChunk { @@ -213509,15 +206942,14 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } else { v2 = i i++ - *(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*Tu8)(unsafe.Pointer(pChunk + uintptr(v2)))) + *(*int32)(unsafe.Pointer(bp + 4)) = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pChunk + uintptr(v2)))) if *(*int32)(unsafe.Pointer(bp + 4))&int32(0x80) != 0 { i-- i += _sqlite3Fts5GetVarint32(tls, pChunk+uintptr(i), bp+4) } (*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = _fts5IndexColsetTest(tls, (*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp + 4))) if (*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState != 0 { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), pChunk+uintptr(iStart), uint32(i-iStart)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), pChunk+uintptr(iStart), libc.Uint32FromInt32(i-iStart)) *(*int32)(unsafe.Pointer((*TPoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += i - iStart iStart = i } @@ -213544,7 +206976,6 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgno = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno pgnoSave = 0 /* This function does not work with detail=none databases. */ - _ = libc.Int32FromInt32(0) if (*TFts5SegIter)(unsafe.Pointer(pSeg)).Fflags&int32(FTS5_SEGITER_REVERSE) == 0 { pgnoSave = pgno + int32(1) } @@ -213572,7 +207003,6 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh } nChunk = v2 if pgno == pgnoSave { - _ = libc.Int32FromInt32(0) (*TFts5SegIter)(unsafe.Pointer(pSeg)).FpNextLeaf = pData pData = uintptr(0) } @@ -213596,16 +207026,12 @@ func _fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr var _ /* sCtx at bp+0 */ TPoslistCallbackCtx var _ /* sCtx at bp+12 */ TPoslistOffsetsCtx _ = v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+uint32((*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos+libc.Int32FromInt32(FTS5_DATA_ZERO_PADDING)) <= uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { + if libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+libc.Uint32FromInt32((*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos+libc.Int32FromInt32(FTS5_DATA_ZERO_PADDING)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { v1 = 0 } else { - v1 = _sqlite3Fts5BufferSize(tls, p+40, pBuf, uint32((*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos+int32(FTS5_DATA_ZERO_PADDING)+(*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + v1 = _sqlite3Fts5BufferSize(tls, p+40, pBuf, libc.Uint32FromInt32((*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos+int32(FTS5_DATA_ZERO_PADDING)+(*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) } if 0 == v1 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos), 0, uint32(FTS5_DATA_ZERO_PADDING)) if pColset == uintptr(0) { _fts5ChunkIterate(tls, p, pSeg, pBuf, __ccgo_fp(_fts5PoslistCallback)) @@ -213614,7 +207040,6 @@ func _fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr (*(*TPoslistCallbackCtx)(unsafe.Pointer(bp))).FpBuf = pBuf (*(*TPoslistCallbackCtx)(unsafe.Pointer(bp))).FpColset = pColset (*(*TPoslistCallbackCtx)(unsafe.Pointer(bp))).FeState = _fts5IndexColsetTest(tls, pColset, 0) - _ = libc.Int32FromInt32(0) _fts5ChunkIterate(tls, p, pSeg, bp, __ccgo_fp(_fts5PoslistFilterCallback)) } else { libc.Xmemset(tls, bp+12, 0, uint32(16)) @@ -213653,7 +207078,7 @@ func _fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos u pEnd = p + uintptr(nPos) /* One byte past end of position list */ i = 0 *(*int32)(unsafe.Pointer(bp)) = 0 - if (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol > int32(1) && _sqlite3Fts5BufferSize(tls, pRc, pIter+28, uint32(nPos)) != 0 { + if (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol > int32(1) && _sqlite3Fts5BufferSize(tls, pRc, pIter+28, libc.Uint32FromInt32(nPos)) != 0 { return } for int32(1) != 0 { @@ -213667,11 +207092,11 @@ func _fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos u } /* Advance pointer p until it points to pEnd or an 0x01 byte that is ** not part of a varint */ - for p < pEnd && int32(*(*Tu8)(unsafe.Pointer(p))) != int32(0x01) { + for p < pEnd && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p))) != int32(0x01) { for { v1 = p p++ - if !(int32(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0) { + if !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1)))&int32(0x80) != 0) { break } } @@ -213682,8 +207107,7 @@ func _fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos u (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = int32(p) - int32(aCopy) return } - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pIter+28)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pIter+28)).Fn), aCopy, uint32(int32(p)-int32(aCopy))) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pIter+28)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pIter+28)).Fn), aCopy, libc.Uint32FromInt32(int32(p)-int32(aCopy))) *(*int32)(unsafe.Pointer(pIter + 28 + 4)) += int32(p) - int32(aCopy) } if p >= pEnd { @@ -213696,7 +207120,7 @@ func _fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos u aCopy = v2 v3 = p p++ - *(*int32)(unsafe.Pointer(bp)) = int32(*(*Tu8)(unsafe.Pointer(v3))) + *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v3))) if *(*int32)(unsafe.Pointer(bp))&int32(0x80) != 0 { p-- p += uintptr(_sqlite3Fts5GetVarint32(tls, p, bp)) @@ -213711,7 +207135,6 @@ func _fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos u // ** xSetOutputs callback used by detail=none tables. // */ func _fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { - _ = libc.Int32FromInt32(0) (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiRowid (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos } @@ -213725,8 +207148,6 @@ func _fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { func _fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiRowid (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset+int64((*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= int64((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) { /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ @@ -213783,8 +207204,6 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { var a, aOut, aiCol, aiColEnd, pEnd, v1, v2 uintptr var iPrev, iPrevOut int32 _, _, _, _, _, _, _, _, _ = a, aOut, aiCol, aiColEnd, iPrev, iPrevOut, pEnd, v1, v2 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset+int64((*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos) > int64((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) { _fts5IterSetOutputs_Col(tls, pIter, pSeg) } else { @@ -213799,7 +207218,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { for a < pEnd { v1 = a a++ - iPrev += int32(*(*Tu8)(unsafe.Pointer(v1))) - int32(2) + iPrev += libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v1))) - int32(2) for *(*int32)(unsafe.Pointer(aiCol)) < iPrev { aiCol += 4 if aiCol == aiColEnd { @@ -213809,7 +207228,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { if *(*int32)(unsafe.Pointer(aiCol)) == iPrev { v2 = aOut aOut++ - *(*Tu8)(unsafe.Pointer(v2)) = uint8(iPrev - iPrevOut + libc.Int32FromInt32(2)) + *(*Tu8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(iPrev - iPrevOut + libc.Int32FromInt32(2)) iPrevOut = iPrev } } @@ -213831,8 +207250,6 @@ func _fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { _, _, _ = a, pColset, pRc pColset = (*TFts5Iter)(unsafe.Pointer(pIter)).FpColset (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiRowid - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset+int64((*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= int64((*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) { /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ @@ -213854,7 +207271,6 @@ func _fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { func _fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { var pConfig uintptr _ = pConfig - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex)).FpConfig if (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { @@ -213869,10 +207285,9 @@ func _fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_FULL { (*TFts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = __ccgo_fp(_fts5IterSetOutputs_Full) } else { - _ = libc.Int32FromInt32(0) if (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol <= int32(100) { (*TFts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = __ccgo_fp(_fts5IterSetOutputs_Col100) - _sqlite3Fts5BufferSize(tls, pRc, pIter+28, uint32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)) + _sqlite3Fts5BufferSize(tls, pRc, pIter+28, libc.Uint32FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)) } else { (*TFts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = __ccgo_fp(_fts5IterSetOutputs_Col) } @@ -213916,7 +207331,7 @@ func _fts5MultiIterFinishSetup(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TFts5Iter)(unsafe.Pointer(pIter)).FbSkipEmpty != 0 && _fts5MultiIterIsEmpty(tls, p, pIter) != 0 || _fts5MultiIterIsDeleted(tls, pIter) != 0 { _fts5MultiIterNext(tls, p, pIter, 0, 0) } else { - if int32((*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof) == 0 { + if libc.Int32FromUint8((*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof) == 0 { pSeg1 = pIter + 72 + uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4))).FiFirst)*96 (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs})))(tls, pIter, pSeg1) } @@ -213942,11 +207357,9 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _, _, _, _, _, _, _, _, _, _, _, _, _, _ = iIter, iSeg, nSeg, pEnd, pIter, pIter1, pLvl, pNew, pSeg, v1, v2, v3, v6, v8 nSeg = 0 /* Number of segment-iters in use */ iIter = 0 - _ = libc.Int32FromInt32(0) /* Allocate space for the new multi-seg-iterator. */ if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if iLevel < 0 { - _ = libc.Int32FromInt32(0) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment nSeg += libc.BoolInt32((*TFts5Index)(unsafe.Pointer(p)).FpHash != 0 && 0 == flags&int32(FTS5INDEX_QUERY_SKIPHASH)) } else { @@ -213962,7 +207375,6 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p pNew = v2 *(*uintptr)(unsafe.Pointer(ppOut)) = v2 if pNew == uintptr(0) { - _ = libc.Int32FromInt32(0) goto fts5MultiIterNew_post_check } (*TFts5Iter)(unsafe.Pointer(pNew)).FbRev = libc.BoolInt32(0 != flags&int32(FTS5INDEX_QUERY_DESC)) @@ -214027,7 +207439,6 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p iSeg-- } } - _ = libc.Int32FromInt32(0) } /* If the above was successful, each component iterator now points ** to the first entry in its segment. In this case initialize the @@ -214042,7 +207453,6 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; - _ = libc.Int32FromInt32(0) return } @@ -214061,7 +207471,7 @@ func _fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, pp (*TFts5SegIter)(unsafe.Pointer(pIter)).Fflags = int32(FTS5_SEGITER_ONETERM) if (*TFts5Data)(unsafe.Pointer(pData)).FszLeaf > 0 { (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pData - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp, pIter+80)) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = libc.Int64FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp, pIter+80)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*TFts5Data)(unsafe.Pointer(pData)).Fnn (*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst + 1*4))).FiFirst = uint16(1) if bDesc != 0 { @@ -214088,8 +207498,6 @@ func _fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, pp // ** False otherwise. // */ func _fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) return libc.BoolInt32((*TFts5Index)(unsafe.Pointer(p)).Frc != 0 || (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof != 0) } @@ -214101,7 +207509,6 @@ func _fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { // ** results are undefined. // */ func _fts5MultiIterRowid(tls *libc.TLS, pIter uintptr) (r Ti64) { - _ = libc.Int32FromInt32(0) return (*(*TFts5SegIter)(unsafe.Pointer(pIter + 72 + uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4))).FiFirst)*96))).FiRowid } @@ -214223,7 +207630,6 @@ func _fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) (r int32) { // ** Discard all data currently cached in the hash-tables. // */ func _fts5IndexDiscardData(tls *libc.TLS, p uintptr) { - _ = libc.Int32FromInt32(0) if (*TFts5Index)(unsafe.Pointer(p)).FpHash != 0 { _sqlite3Fts5HashClear(tls, (*TFts5Index)(unsafe.Pointer(p)).FpHash) (*TFts5Index)(unsafe.Pointer(p)).FnPendingData = 0 @@ -214250,7 +207656,7 @@ func _fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) if !(i < nOld) { break } - if int32(*(*Tu8)(unsafe.Pointer(pOld + uintptr(i)))) != int32(*(*Tu8)(unsafe.Pointer(pNew + uintptr(i)))) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pOld + uintptr(i)))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pNew + uintptr(i)))) { break } goto _1 @@ -214265,7 +207671,6 @@ func _fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int3 var i int32 var pDlidx uintptr _, _ = i, pDlidx - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx) { @@ -214276,7 +207681,6 @@ func _fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int3 break } if bFlush != 0 { - _ = libc.Int32FromInt32(0) _fts5DataWrite(tls, p, int64((*TFts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)+libc.Int32FromInt32(FTS5_DATA_DLI_B))+int64(libc.Int32FromInt32(1))<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B))+int64(i)<<libc.Int32FromInt32(FTS5_DATA_PAGE_B)+int64((*TFts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno), (*TFts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp, (*TFts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn) } _sqlite3Fts5BufferZero(tls, pDlidx+16) @@ -214299,11 +207703,11 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint32(28)*uint32(nLvl))) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint32(28)*libc.Uint32FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { - nByte = uint32(28) * uint32(nLvl-(*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx) + nByte = uint32(28) * libc.Uint32FromInt32(nLvl-(*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx) libc.Xmemset(tls, aDlidx+uintptr((*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx)*28, 0, nByte) (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx = aDlidx (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx = nLvl @@ -214350,7 +207754,6 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { var bFlag int32 var z, v1 uintptr _, _, _ = bFlag, z, v1 - _ = libc.Int32FromInt32(0) if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage == 0 { return } @@ -214405,7 +207808,6 @@ func _fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { ** has already been started, append an 0x00 byte to it. */ if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0 && (*(*TFts5DlidxWriter)(unsafe.Pointer((*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx))).Fbuf.Fn > 0 { pDlidx = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx - _ = libc.Int32FromInt32(0) _sqlite3Fts5BufferAppendVarint(tls, p+40, pDlidx+16, 0) } /* Increment the "number of sequential leaves without a term" counter. */ @@ -214418,7 +207820,7 @@ func _fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) (r Ti64) { var iOff int32 var _ /* iRowid at bp+0 */ Ti64 _ = iOff - iOff = int32(1) + int32(_sqlite3Fts5GetVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+1, bp)) + iOff = int32(1) + libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+1, bp)) _sqlite3Fts5GetVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(iOff), bp) return *(*Ti64)(unsafe.Pointer(bp)) } @@ -214469,7 +207871,7 @@ func _fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid Ti6 bDone = int32(1) } if (*TFts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid != 0 { - iVal = int64(uint64(iRowid) - uint64((*TFts5DlidxWriter)(unsafe.Pointer(pDlidx)).FiPrev)) + iVal = libc.Int64FromUint64(libc.Uint64FromInt64(iRowid) - libc.Uint64FromInt64((*TFts5DlidxWriter)(unsafe.Pointer(pDlidx)).FiPrev)) } else { if i == 0 { v2 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fpgno @@ -214477,7 +207879,6 @@ func _fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid Ti6 v2 = (*(*TFts5DlidxWriter)(unsafe.Pointer(pDlidx + uintptr(-libc.Int32FromInt32(1))*28))).Fpgno } iPgno = int64(v2) - _ = libc.Int32FromInt32(0) _sqlite3Fts5BufferAppendVarint(tls, p+40, pDlidx+16, libc.BoolInt64(!(bDone != 0))) _sqlite3Fts5BufferAppendVarint(tls, p+40, pDlidx+16, iPgno) iVal = iRowid @@ -214497,17 +207898,14 @@ func _fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { var pPage uintptr _, _ = iRowid, pPage pPage = pWriter + 4 - _ = libc.Int32FromInt32(0) /* Set the szLeaf header field. */ - _ = libc.Int32FromInt32(0) - _fts5PutU16(tls, (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp+2, uint16((*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn)) + _fts5PutU16(tls, (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp+2, libc.Uint16FromInt32((*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn)) if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage != 0 { /* No term was written to this page. */ - _ = libc.Int32FromInt32(0) _fts5WriteBtreeNoTerm(tls, p, pWriter) } else { /* Append the pgidx to the page buffer. Set the szLeaf header field. */ - _sqlite3Fts5BufferAppendBlob(tls, p+40, pPage+8, uint32((*TFts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn), (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fp) + _sqlite3Fts5BufferAppendBlob(tls, p+40, pPage+8, libc.Uint32FromInt32((*TFts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn), (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fp) } /* Write the page out to disk */ iRowid = int64((*TFts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)+libc.Int32FromInt32(FTS5_DATA_DLI_B)) + int64(libc.Int32FromInt32(0))<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)) + int64(libc.Int32FromInt32(0))<<libc.Int32FromInt32(FTS5_DATA_PAGE_B) + int64((*TFts5PageWriter)(unsafe.Pointer(pPage)).Fpgno) @@ -214548,9 +207946,6 @@ func _fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32 v1 = nTerm } nMin = v1 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If the current leaf page is full, flush it to disk. */ if (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn+(*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fn+nTerm+int32(2) >= (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz { if (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn > int32(4) { @@ -214559,12 +207954,12 @@ func _fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32 return } } - if !(uint32((*TFts5Buffer)(unsafe.Pointer(pPage+8)).Fn)+uint32(nTerm+libc.Int32FromInt32(FTS5_DATA_PADDING)) <= uint32((*TFts5Buffer)(unsafe.Pointer(pPage+8)).FnSpace)) { - _sqlite3Fts5BufferSize(tls, p+40, pPage+8, uint32(nTerm+int32(FTS5_DATA_PADDING)+(*TFts5Buffer)(unsafe.Pointer(pPage+8)).Fn)) + if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pPage+8)).Fn)+libc.Uint32FromInt32(nTerm+libc.Int32FromInt32(FTS5_DATA_PADDING)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pPage+8)).FnSpace)) { + _sqlite3Fts5BufferSize(tls, p+40, pPage+8, libc.Uint32FromInt32(nTerm+int32(FTS5_DATA_PADDING)+(*TFts5Buffer)(unsafe.Pointer(pPage+8)).Fn)) } } /* TODO1: Updating pgidx here. */ - *(*int32)(unsafe.Pointer(pPgidx + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fn), uint64((*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn-(*TFts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx)) + *(*int32)(unsafe.Pointer(pPgidx + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fn), libc.Uint64FromInt32((*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn-(*TFts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx)) (*TFts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx = (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage != 0 { nPrefix = 0 @@ -214599,13 +207994,12 @@ func _fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32 /* Append the number of bytes of new data, then the term data itself ** to the page. */ _sqlite3Fts5BufferAppendVarint(tls, p+40, pPage+8, int64(nTerm)-int64(nPrefix)) - _sqlite3Fts5BufferAppendBlob(tls, p+40, pPage+8, uint32(nTerm-nPrefix), pTerm+uintptr(nPrefix)) + _sqlite3Fts5BufferAppendBlob(tls, p+40, pPage+8, libc.Uint32FromInt32(nTerm-nPrefix), pTerm+uintptr(nPrefix)) /* Update the Fts5PageWriter.term field. */ _sqlite3Fts5BufferSet(tls, p+40, pPage+32, nTerm, pTerm) (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = uint8(0) (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = uint8(0) (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist = uint8(1) - _ = libc.Int32FromInt32(0) (*(*TFts5DlidxWriter)(unsafe.Pointer((*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx))).Fpgno = (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fpgno } @@ -214626,15 +208020,14 @@ func _fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid Ti6 ** rowid-pointer in the page-header. Also append a value to the dlidx ** buffer, in case a doclist-index is required. */ if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0 { - _fts5PutU16(tls, (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp, uint16((*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn)) + _fts5PutU16(tls, (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp, libc.Uint16FromInt32((*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn)) _fts5WriteDlidxAppend(tls, p, pWriter, iRowid) } /* Write the rowid. */ if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist != 0 || (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0 { _sqlite3Fts5BufferAppendVarint(tls, p+40, pPage+8, iRowid) } else { - _ = libc.Int32FromInt32(0) - _sqlite3Fts5BufferAppendVarint(tls, p+40, pPage+8, int64(uint64(int64(uint64(iRowid)))-uint64((*TFts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid))) + _sqlite3Fts5BufferAppendVarint(tls, p+40, pPage+8, libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt64(iRowid)))-libc.Uint64FromInt64((*TFts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid))) } (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid = iRowid (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist = uint8(0) @@ -214652,20 +208045,19 @@ func _fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aDat pPage = pWriter + 4 a = aData n = nData - _ = libc.Int32FromInt32(0) for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn+(*TFts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn+n >= (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz { nReq = (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz - (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn - (*TFts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn nCopy = 0 for nCopy < nReq { - nCopy += int32(_sqlite3Fts5GetVarint(tls, a+uintptr(nCopy), bp)) + nCopy += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, a+uintptr(nCopy), bp)) } - _sqlite3Fts5BufferAppendBlob(tls, p+40, pPage+8, uint32(nCopy), a) + _sqlite3Fts5BufferAppendBlob(tls, p+40, pPage+8, libc.Uint32FromInt32(nCopy), a) a += uintptr(nCopy) n -= nCopy _fts5WriteFlushLeaf(tls, p, pWriter) } if n > 0 { - _sqlite3Fts5BufferAppendBlob(tls, p+40, pPage+8, uint32(n), a) + _sqlite3Fts5BufferAppendBlob(tls, p+40, pPage+8, libc.Uint32FromInt32(n), a) } } @@ -214681,7 +208073,6 @@ func _fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) _, _ = i, pLeaf pLeaf = pWriter + 4 if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _ = libc.Int32FromInt32(0) if (*TFts5PageWriter)(unsafe.Pointer(pLeaf)).Fbuf.Fn > int32(4) { _fts5WriteFlushLeaf(tls, p, pWriter) } @@ -214721,14 +208112,12 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fpgno = int32(1) (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = uint8(1) (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = int32(1) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Grow the two buffers to pgsz + padding bytes in size. */ - _sqlite3Fts5BufferSize(tls, p+40, pWriter+4+20, uint32(nBuffer)) - _sqlite3Fts5BufferSize(tls, p+40, pWriter+4+8, uint32(nBuffer)) + _sqlite3Fts5BufferSize(tls, p+40, pWriter+4+20, libc.Uint32FromInt32(nBuffer)) + _sqlite3Fts5BufferSize(tls, p+40, pWriter+4+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+60, Xsqlite3_mprintf(tls, __ccgo_ts+36652, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+60, Xsqlite3_mprintf(tls, __ccgo_ts+36681, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -214788,23 +208177,23 @@ func _fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } else { _sqlite3Fts5BufferZero(tls, bp) - if !(uint32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+uint32((*TFts5Data)(unsafe.Pointer(pData)).Fnn) <= uint32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { - _sqlite3Fts5BufferSize(tls, p+40, bp, uint32((*TFts5Data)(unsafe.Pointer(pData)).Fnn+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) + if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32((*TFts5Data)(unsafe.Pointer(pData)).Fnn) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { + _sqlite3Fts5BufferSize(tls, p+40, bp, libc.Uint32FromInt32((*TFts5Data)(unsafe.Pointer(pData)).Fnn+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(4), bp+12) _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn)) - _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32((*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn), (*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32((*TFts5Data)(unsafe.Pointer(pData)).FszLeaf-iOff), (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr(iOff)) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, libc.Uint32FromInt32((*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn), (*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, libc.Uint32FromInt32((*TFts5Data)(unsafe.Pointer(pData)).FszLeaf-iOff), (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr(iOff)) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Set the szLeaf field */ - _fts5PutU16(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp+2, uint16((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn)) + _fts5PutU16(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp+2, libc.Uint16FromInt32((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn)) } /* Set up the new page-index array */ _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, libc.Int64FromInt32(4)) if (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno == (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno && (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist < (*TFts5Data)(unsafe.Pointer(pData)).FszLeaf && (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff <= (*TFts5Data)(unsafe.Pointer(pData)).Fnn { nDiff = (*TFts5Data)(unsafe.Pointer(pData)).FszLeaf - (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist _sqlite3Fts5BufferAppendVarint(tls, p+40, bp, int64((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn)-int64(1)-int64(nDiff)-int64(4)) - _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32((*TFts5Data)(unsafe.Pointer(pData)).Fnn-(*TFts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff), (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*TFts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff)) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, libc.Uint32FromInt32((*TFts5Data)(unsafe.Pointer(pData)).Fnn-(*TFts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff), (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*TFts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff)) } (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FpgnoFirst = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno _fts5DataDelete(tls, p, int64(iId)<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)+libc.Int32FromInt32(FTS5_DATA_DLI_B))+int64(libc.Int32FromInt32(0))<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B))+int64(libc.Int32FromInt32(0))<<libc.Int32FromInt32(FTS5_DATA_PAGE_B)+int64(libc.Int32FromInt32(1)), iLeafRowid) @@ -214857,13 +208246,10 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 eDetail = (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail flags = int32(FTS5INDEX_QUERY_NOOUTPUT) bTermWritten = 0 /* True if current term already output */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) libc.Xmemset(tls, bp+4, 0, uint32(92)) libc.Xmemset(tls, bp+96, 0, uint32(12)) if (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 { pLvlOut = pStruct + 28 + uintptr(iLvl+int32(1))*12 - _ = libc.Int32FromInt32(0) nInput = (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge pSeg = (*TFts5StructureLevel)(unsafe.Pointer(pLvlOut)).FaSeg + uintptr((*TFts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg-int32(1))*48 _fts5WriteInit(tls, p, bp+4, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid) @@ -214899,7 +208285,6 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 } } bOldest = libc.BoolInt32((*TFts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg == int32(1) && (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel == iLvl+int32(2)) - _ = libc.Int32FromInt32(0) _fts5MultiIterNew(tls, p, pStruct, flags, uintptr(0), uintptr(0), 0, iLvl, nInput, bp) for { if !(_fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp))) == 0) { @@ -214911,7 +208296,7 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 if *(*int32)(unsafe.Pointer(bp + 108)) <= 0 { v3 = 0 } else { - v3 = libc.Xmemcmp(tls, pTerm, (*(*TFts5Buffer)(unsafe.Pointer(bp + 96))).Fp, uint32(*(*int32)(unsafe.Pointer(bp + 108)))) + v3 = libc.Xmemcmp(tls, pTerm, (*(*TFts5Buffer)(unsafe.Pointer(bp + 96))).Fp, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 108)))) } } if v4 || v3 != 0 { @@ -214922,7 +208307,7 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 bTermWritten = 0 } /* Check for key annihilation. */ - if (*TFts5SegIter)(unsafe.Pointer(pSegIter)).FnPos == 0 && (bOldest != 0 || int32((*TFts5SegIter)(unsafe.Pointer(pSegIter)).FbDel) == 0) { + if (*TFts5SegIter)(unsafe.Pointer(pSegIter)).FnPos == 0 && (bOldest != 0 || libc.Int32FromUint8((*TFts5SegIter)(unsafe.Pointer(pSegIter)).FbDel) == 0) { goto _2 } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bTermWritten == 0 { @@ -214942,7 +208327,7 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 } } else { /* Append the position-list data to the output */ - nPos = (*TFts5SegIter)(unsafe.Pointer(pSegIter)).FnPos*int32(2) + int32((*TFts5SegIter)(unsafe.Pointer(pSegIter)).FbDel) + nPos = (*TFts5SegIter)(unsafe.Pointer(pSegIter)).FnPos*int32(2) + libc.Int32FromUint8((*TFts5SegIter)(unsafe.Pointer(pSegIter)).FbDel) _sqlite3Fts5BufferAppendVarint(tls, p+40, bp+4+4+8, int64(nPos)) _fts5ChunkIterate(tls, p, pSegIter, bp+4, __ccgo_fp(_fts5MergeChunkCallback)) } @@ -214954,10 +208339,8 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 /* Flush the last leaf page to disk. Set the output segment b-tree height ** and last leaf page number at the same time. */ _fts5WriteFinish(tls, p, bp+4, pSeg+8) - _ = libc.Int32FromInt32(0) if _fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp))) != 0 { /* Remove the redundant segments from the %_data table */ - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < nInput) { @@ -214973,8 +208356,8 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 } /* Remove the redundant segments from the input level */ if (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg != nInput { - nMove = int32(uint32((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg-nInput) * uint32(48)) - libc.Xmemmove(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(nInput)*48, uint32(nMove)) + nMove = libc.Int32FromUint32(libc.Uint32FromInt32((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg-nInput) * uint32(48)) + libc.Xmemmove(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(nInput)*48, libc.Uint32FromInt32(nMove)) } *(*int32)(unsafe.Pointer(pStruct + 20)) -= nInput *(*int32)(unsafe.Pointer(pLvl + 4)) -= nInput @@ -214984,7 +208367,6 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment-- } } else { - _ = libc.Int32FromInt32(0) _fts5TrimSegments(tls, p, *(*uintptr)(unsafe.Pointer(bp))) (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge = nInput } @@ -215034,7 +208416,6 @@ func _fts5IndexFindDeleteMerge(tls *libc.TLS, p uintptr, pStruct uintptr) (r int ; iSeg++ } - _ = libc.Int32FromInt32(0) if nEntry > 0 { nPercent = int32(nTomb * int64(100) / nEntry) if nPercent >= (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge && nPercent > nBest { @@ -215074,7 +208455,6 @@ func _fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin nBest = 0 /* Number of input segments on best level */ /* Set iBestLvl to the level to read input segments from. Or to -1 if ** there is no level suitable to merge segments from. */ - _ = libc.Int32FromInt32(0) iLvl = 0 for { if !(iLvl < (*TFts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FnLevel) { @@ -215135,8 +208515,8 @@ func _fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32 pStruct = *(*uintptr)(unsafe.Pointer(ppStruct)) /* Number of leaf pages left to write */ /* Update the write-counter. While doing so, set nWork. */ nWrite = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter - nWork = int32((nWrite+uint64(nLeaf))/uint64((*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit) - nWrite/uint64((*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit)) - *(*Tu64)(unsafe.Pointer(pStruct + 4)) += uint64(nLeaf) + nWork = libc.Int32FromUint64((nWrite+libc.Uint64FromInt32(nLeaf))/libc.Uint64FromInt32((*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit) - nWrite/libc.Uint64FromInt32((*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit)) + *(*Tu64)(unsafe.Pointer(pStruct + 4)) += libc.Uint64FromInt32(nLeaf) nRem = (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit * nWork * (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel _fts5IndexMerge(tls, p, ppStruct, nRem, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge) } @@ -215154,7 +208534,6 @@ func _fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { iLvl = 0 for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*(*TFts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 28 + uintptr(iLvl)*12))).FnSeg >= nCrisis { _fts5IndexMergeLevel(tls, p, bp, iLvl, uintptr(0)) - _ = libc.Int32FromInt32(0) _fts5StructurePromote(tls, p, iLvl+int32(1), *(*uintptr)(unsafe.Pointer(bp))) iLvl++ } @@ -215227,9 +208606,8 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int bp := tls.Alloc(32) defer tls.Free(32) if iPgno != int32(1) { - _ = libc.Int32FromInt32(0) if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36709, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36738, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -215264,7 +208642,6 @@ func _fts5SecureDeleteOverflow(tls *libc.TLS, p uintptr, pSeg uintptr, iPgno int _, _, _, _, _, _, _, _, _, _, _ = aIdx, aPg, bDetailNone, i1, i2, iRowid, nIdx, nPg, nShift, pLeaf, pgno bDetailNone = libc.BoolInt32((*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == libc.Int32FromInt32(FTS5_DETAIL_NONE)) pLeaf = uintptr(0) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pbLastInDoclist)) = int32(1) pgno = iPgno for { @@ -215279,7 +208656,7 @@ func _fts5SecureDeleteOverflow(tls *libc.TLS, p uintptr, pSeg uintptr, iPgno int break } aPg = (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp - *(*int32)(unsafe.Pointer(bp)) = int32(_fts5GetU16(tls, aPg)) + *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint16(_fts5GetU16(tls, aPg)) if *(*int32)(unsafe.Pointer(bp)) != 0 { *(*int32)(unsafe.Pointer(pbLastInDoclist)) = 0 } @@ -215292,7 +208669,6 @@ func _fts5SecureDeleteOverflow(tls *libc.TLS, p uintptr, pSeg uintptr, iPgno int *(*[4]Tu8)(unsafe.Pointer(bp + 4)) = [4]Tu8{ 3: uint8(0x04), } - _ = libc.Int32FromInt32(0) if bDetailNone == 0 { _fts5DataWrite(tls, p, iRowid, bp+4, int32(4)) } @@ -215326,9 +208702,9 @@ func _fts5SecureDeleteOverflow(tls *libc.TLS, p uintptr, pSeg uintptr, iPgno int if aIdx == uintptr(0) { break } - i2 = _sqlite3Fts5PutVarint(tls, aIdx, uint64(*(*int32)(unsafe.Pointer(bp + 8))-nShift)) + i2 = _sqlite3Fts5PutVarint(tls, aIdx, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8))-nShift)) if i1 < (*TFts5Data)(unsafe.Pointer(pLeaf)).Fnn { - libc.Xmemcpy(tls, aIdx+uintptr(i2), aPg+uintptr(i1), uint32((*TFts5Data)(unsafe.Pointer(pLeaf)).Fnn-i1)) + libc.Xmemcpy(tls, aIdx+uintptr(i2), aPg+uintptr(i1), libc.Uint32FromInt32((*TFts5Data)(unsafe.Pointer(pLeaf)).Fnn-i1)) i2 += (*TFts5Data)(unsafe.Pointer(pLeaf)).Fnn - i1 } nIdx = i2 @@ -215336,18 +208712,17 @@ func _fts5SecureDeleteOverflow(tls *libc.TLS, p uintptr, pSeg uintptr, iPgno int /* Modify the contents of buffer aPg[]. Set nPg to the new size ** in bytes. The new page is always smaller than the old. */ nPg = (*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf - nShift - libc.Xmemmove(tls, aPg+4, aPg+uintptr(int32(4)+nShift), uint32(nPg-int32(4))) - _fts5PutU16(tls, aPg+2, uint16(nPg)) + libc.Xmemmove(tls, aPg+4, aPg+uintptr(int32(4)+nShift), libc.Uint32FromInt32(nPg-int32(4))) + _fts5PutU16(tls, aPg+2, libc.Uint16FromInt32(nPg)) if _fts5GetU16(tls, aPg) != 0 { _fts5PutU16(tls, aPg, uint16(4)) } if nIdx > 0 { - libc.Xmemcpy(tls, aPg+uintptr(nPg), aIdx, uint32(nIdx)) + libc.Xmemcpy(tls, aPg+uintptr(nPg), aIdx, libc.Uint32FromInt32(nIdx)) nPg += nIdx } Xsqlite3_free(tls, aIdx) /* Write the new page to disk and exit the loop */ - _ = libc.Int32FromInt32(0) _fts5DataWrite(tls, p, iRowid, aPg, nPg) break } @@ -215405,7 +208780,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } - libc.Xmemcpy(tls, aIdx, aPg+uintptr(iPgIdx), uint32(nIdx)) + libc.Xmemcpy(tls, aIdx, aPg+uintptr(iPgIdx), libc.Uint32FromInt32(nIdx)) /* At this point segment iterator pSeg points to the entry ** this function should remove from the b-tree segment. ** @@ -215440,26 +208815,25 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno == (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno { iStart = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafOffset } else { - iStart = int32(_fts5GetU16(tls, aPg)) + iStart = libc.Int32FromUint16(_fts5GetU16(tls, aPg)) } - iSOP = iStart + int32(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iStart), bp)) - _ = libc.Int32FromInt32(0) + iSOP = iStart + libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iStart), bp)) if bDetailNone != 0 { for int64(iSOP) < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset { - if int32(*(*Tu8)(unsafe.Pointer(aPg + uintptr(iSOP)))) == 0x00 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aPg + uintptr(iSOP)))) == 0x00 { iSOP++ } - if int32(*(*Tu8)(unsafe.Pointer(aPg + uintptr(iSOP)))) == 0x00 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aPg + uintptr(iSOP)))) == 0x00 { iSOP++ } iStart = iSOP - iSOP = iStart + int32(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iStart), bp)) + iSOP = iStart + libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iStart), bp)) } iNextOff = iSOP - if iNextOff < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist && int32(*(*Tu8)(unsafe.Pointer(aPg + uintptr(iNextOff)))) == 0x00 { + if iNextOff < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aPg + uintptr(iNextOff)))) == 0x00 { iNextOff++ } - if iNextOff < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist && int32(*(*Tu8)(unsafe.Pointer(aPg + uintptr(iNextOff)))) == 0x00 { + if iNextOff < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aPg + uintptr(iNextOff)))) == 0x00 { iNextOff++ } } else { @@ -215467,10 +208841,9 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iSOP += _sqlite3Fts5GetVarint32(tls, aPg+uintptr(iSOP), bp+12) for int64(iSOP) < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset { iStart = iSOP + *(*int32)(unsafe.Pointer(bp + 12))/int32(2) - iSOP = iStart + int32(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iStart), bp)) + iSOP = iStart + libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iStart), bp)) iSOP += _sqlite3Fts5GetVarint32(tls, aPg+uintptr(iSOP), bp+12) } - _ = libc.Int32FromInt32(0) iNextOff = int32((*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset + int64((*TFts5SegIter)(unsafe.Pointer(pSeg)).FnPos)) } iOff = iStart @@ -215485,7 +208858,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { _fts5SecureDeleteOverflow(tls, p, (*TFts5SegIter)(unsafe.Pointer(pSeg)).FpSeg, pgno, bp+8) iNextOff = iPgIdx } - if int32((*TFts5SegIter)(unsafe.Pointer(pSeg)).FbDel) == 0 { + if libc.Int32FromUint8((*TFts5SegIter)(unsafe.Pointer(pSeg)).FbDel) == 0 { if iNextOff != iPgIdx { /* Loop through the page-footer. If iNextOff (offset of the ** entry following the one we are removing) is equal to the @@ -215510,7 +208883,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { /* If this is (a) the first rowid on a page and (b) is not followed by ** another position list on the same page, set the "first-rowid" field ** of the header to 0. */ - if int32(_fts5GetU16(tls, aPg)) == iStart && (*(*int32)(unsafe.Pointer(bp + 8)) != 0 || iNextOff == iPgIdx) { + if libc.Int32FromUint16(_fts5GetU16(tls, aPg)) == iStart && (*(*int32)(unsafe.Pointer(bp + 8)) != 0 || iNextOff == iPgIdx) { _fts5PutU16(tls, aPg, uint16(0)) } } @@ -215523,7 +208896,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { if *(*int32)(unsafe.Pointer(bp + 8)) == 0 { if iNextOff != iPgIdx { *(*Tu64)(unsafe.Pointer(bp + 24)) = uint64(0) - iNextOff += int32(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iNextOff), bp+24)) + iNextOff += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iNextOff), bp+24)) iOff += _sqlite3Fts5PutVarint(tls, aPg+uintptr(iOff), *(*Tu64)(unsafe.Pointer(bp))+*(*Tu64)(unsafe.Pointer(bp + 24))) } } else { @@ -215541,7 +208914,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { } *(*Tu32)(unsafe.Pointer(bp + 32)) = uint32(0) iIdx += _sqlite3Fts5GetVarint32(tls, aIdx+uintptr(iIdx), bp+32) - if uint32(iKeyOff1)+*(*Tu32)(unsafe.Pointer(bp + 32)) > uint32(iStart) { + if libc.Uint32FromInt32(iKeyOff1)+*(*Tu32)(unsafe.Pointer(bp + 32)) > libc.Uint32FromInt32(iStart) { break } iKeyOff1 = int32(uint32(iKeyOff1) + *(*Tu32)(unsafe.Pointer(bp + 32))) @@ -215550,7 +208923,6 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { ; iKey++ } - _ = libc.Int32FromInt32(0) /* Set iDelKeyOff to the value of the footer entry to remove from ** the page. */ v4 = iKeyOff1 @@ -215583,25 +208955,24 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } else { if iKey != int32(1) { - iOff += _sqlite3Fts5PutVarint(tls, aPg+uintptr(iOff), uint64(*(*int32)(unsafe.Pointer(bp + 36)))) + iOff += _sqlite3Fts5PutVarint(tls, aPg+uintptr(iOff), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 36)))) } - iOff += _sqlite3Fts5PutVarint(tls, aPg+uintptr(iOff), uint64(*(*int32)(unsafe.Pointer(bp + 40)))) + iOff += _sqlite3Fts5PutVarint(tls, aPg+uintptr(iOff), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 40)))) if *(*int32)(unsafe.Pointer(bp + 44)) > (*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } else { if *(*int32)(unsafe.Pointer(bp + 44)) > *(*int32)(unsafe.Pointer(bp + 36)) { - libc.Xmemcpy(tls, aPg+uintptr(iOff), (*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp+uintptr(*(*int32)(unsafe.Pointer(bp + 36))), uint32(*(*int32)(unsafe.Pointer(bp + 44))-*(*int32)(unsafe.Pointer(bp + 36)))) + libc.Xmemcpy(tls, aPg+uintptr(iOff), (*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp+uintptr(*(*int32)(unsafe.Pointer(bp + 36))), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 44))-*(*int32)(unsafe.Pointer(bp + 36)))) iOff += *(*int32)(unsafe.Pointer(bp + 44)) - *(*int32)(unsafe.Pointer(bp + 36)) } } - libc.Xmemmove(tls, aPg+uintptr(iOff), aPg+uintptr(iNextOff), uint32(*(*int32)(unsafe.Pointer(bp + 48)))) + libc.Xmemmove(tls, aPg+uintptr(iOff), aPg+uintptr(iNextOff), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 48)))) iOff += *(*int32)(unsafe.Pointer(bp + 48)) iNextOff += *(*int32)(unsafe.Pointer(bp + 48)) } } } else { if iStart == int32(4) { - _ = libc.Int32FromInt32(0) /* The entry being removed may be the only position list in ** its doclist. */ iPgno = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno - int32(1) @@ -215638,8 +209009,8 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iTermIdx += nByte } nTermIdx = iTermIdx - libc.Xmemmove(tls, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+uintptr(iTermOff), (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+uintptr((*TFts5Data)(unsafe.Pointer(pTerm)).FszLeaf), uint32(nTermIdx)) - _fts5PutU16(tls, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+2, uint16(iTermOff)) + libc.Xmemmove(tls, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+uintptr(iTermOff), (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+uintptr((*TFts5Data)(unsafe.Pointer(pTerm)).FszLeaf), libc.Uint32FromInt32(nTermIdx)) + _fts5PutU16(tls, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+2, libc.Uint16FromInt32(iTermOff)) _fts5DataWrite(tls, p, iId, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp, iTermOff+nTermIdx) if nTermIdx == 0 { _fts5SecureDeleteIdxEntry(tls, p, iSegid, (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno) @@ -215665,10 +209036,10 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { nShift = iNextOff - iOff /* Distance to move them */ iPrevKeyOut = 0 iKeyIn = 0 - libc.Xmemmove(tls, aPg+uintptr(iOff), aPg+uintptr(iNextOff), uint32(nMove)) + libc.Xmemmove(tls, aPg+uintptr(iOff), aPg+uintptr(iNextOff), libc.Uint32FromInt32(nMove)) iPgIdx -= nShift nPg = iPgIdx - _fts5PutU16(tls, aPg+2, uint16(iPgIdx)) + _fts5PutU16(tls, aPg+2, libc.Uint16FromInt32(iPgIdx)) iIdx = 0 for { if !(iIdx < nIdx) { @@ -215684,7 +209055,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { v8 = 0 } iKeyOut = iKeyIn - v8 - nPg += _sqlite3Fts5PutVarint(tls, aPg+uintptr(nPg), uint64(iKeyOut-iPrevKeyOut)) + nPg += _sqlite3Fts5PutVarint(tls, aPg+uintptr(nPg), libc.Uint64FromInt32(iKeyOut-iPrevKeyOut)) iPrevKeyOut = iKeyOut } goto _7 @@ -215693,7 +209064,6 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { if iPgIdx == nPg && nIdx > 0 && (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno != int32(1) { _fts5SecureDeleteIdxEntry(tls, p, iSegid, (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno) } - _ = libc.Int32FromInt32(0) _fts5DataWrite(tls, p, int64(iSegid)<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)+libc.Int32FromInt32(FTS5_DATA_DLI_B))+int64(libc.Int32FromInt32(0))<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B))+int64(libc.Int32FromInt32(0))<<libc.Int32FromInt32(FTS5_DATA_PAGE_B)+int64((*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno), aPg, nPg) } Xsqlite3_free(tls, aIdx) @@ -215774,8 +209144,6 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { pPgidx = bp + 8 + 4 + 20 /* fts5WriteInit() should have initialized the buffers to (most likely) ** the maximum space required. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Begin scanning through hash table entries. This loop runs once for each ** term/doclist currently stored within the hash table. */ if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -215789,12 +209157,10 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { if (*TFts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK { break } - _ = libc.Int32FromInt32(0) } if !(bSecureDelete != 0) && pgsz >= (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fn+*(*int32)(unsafe.Pointer(bp + 112))+int32(1) { /* The entire doclist will fit on the current leaf. */ - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 108)), uint32(*(*int32)(unsafe.Pointer(bp + 112)))) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 108)), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 112)))) *(*int32)(unsafe.Pointer(pBuf + 4)) += *(*int32)(unsafe.Pointer(bp + 112)) } else { bTermWritten = libc.BoolInt32(!(bSecureDelete != 0)) @@ -215806,17 +209172,17 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { ** doclist. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && iOff < *(*int32)(unsafe.Pointer(bp + 112)) { *(*Tu64)(unsafe.Pointer(bp + 120)) = uint64(0) - iOff += int32(_sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 108))+uintptr(iOff), bp+120)) + iOff += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 108))+uintptr(iOff), bp+120)) iRowid = Ti64(uint64(iRowid) + *(*Tu64)(unsafe.Pointer(bp + 120))) /* If in secure delete mode, and if this entry in the poslist is ** in fact a delete, then edit the existing segments directly ** using fts5FlushSecureDelete(). */ if bSecureDelete != 0 { if eDetail == int32(FTS5_DETAIL_NONE) { - if iOff < *(*int32)(unsafe.Pointer(bp + 112)) && int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == 0x00 { + if iOff < *(*int32)(unsafe.Pointer(bp + 112)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == 0x00 { _fts5FlushSecureDelete(tls, p, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 100)), *(*int32)(unsafe.Pointer(bp + 104)), iRowid) iOff++ - if iOff < *(*int32)(unsafe.Pointer(bp + 112)) && int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == 0x00 { + if iOff < *(*int32)(unsafe.Pointer(bp + 112)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == 0x00 { iOff++ *(*int32)(unsafe.Pointer(bp + 112)) = 0 } else { @@ -215824,9 +209190,9 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { } } } else { - if int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff))))&int32(0x01) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff))))&int32(0x01) != 0 { _fts5FlushSecureDelete(tls, p, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 100)), *(*int32)(unsafe.Pointer(bp + 104)), iRowid) - if (*TFts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK || int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == int32(0x01) { + if (*TFts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == int32(0x01) { iOff++ continue } @@ -215836,30 +209202,28 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bTermWritten == 0 { _fts5WriteAppendTerm(tls, p, bp+8, *(*int32)(unsafe.Pointer(bp + 104)), *(*uintptr)(unsafe.Pointer(bp + 100))) bTermWritten = int32(1) - _ = libc.Int32FromInt32(0) } if (*(*TFts5SegWriter)(unsafe.Pointer(bp + 8))).FbFirstRowidInPage != 0 { - _fts5PutU16(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, uint16((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) /* first rowid on page */ - *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iRowid)) + _fts5PutU16(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, libc.Uint16FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) /* first rowid on page */ + *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), libc.Uint64FromInt64(iRowid)) (*(*TFts5SegWriter)(unsafe.Pointer(bp + 8))).FbFirstRowidInPage = uint8(0) _fts5WriteDlidxAppend(tls, p, bp+8, iRowid) } else { - iRowidDelta = uint64(iRowid) - uint64(iPrev) + iRowidDelta = libc.Uint64FromInt64(iRowid) - libc.Uint64FromInt64(iPrev) *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), iRowidDelta) } if (*TFts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK { break } - _ = libc.Int32FromInt32(0) iPrev = iRowid if eDetail == int32(FTS5_DETAIL_NONE) { - if iOff < *(*int32)(unsafe.Pointer(bp + 112)) && int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == 0 { + if iOff < *(*int32)(unsafe.Pointer(bp + 112)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == 0 { v2 = pBuf + 4 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ *(*Tu8)(unsafe.Pointer((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(v1))) = uint8(0) iOff++ - if iOff < *(*int32)(unsafe.Pointer(bp + 112)) && int32(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == 0 { + if iOff < *(*int32)(unsafe.Pointer(bp + 112)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)) + uintptr(iOff)))) == 0 { v4 = pBuf + 4 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ @@ -215884,8 +209248,7 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { if (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fn+nCopy <= pgsz { /* The entire poslist will fit on the current leaf. So copy ** it in one go. */ - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 108))+uintptr(iOff), uint32(nCopy)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 108))+uintptr(iOff), libc.Uint32FromInt32(nCopy)) *(*int32)(unsafe.Pointer(pBuf + 4)) += nCopy } else { /* The entire poslist will not fit on this leaf. So it needs @@ -215901,9 +209264,7 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { } else { n = _fts5PoslistPrefix(tls, pPoslist+uintptr(iPos), nSpace) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), pPoslist+uintptr(iPos), uint32(n)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), pPoslist+uintptr(iPos), libc.Uint32FromInt32(n)) *(*int32)(unsafe.Pointer(pBuf + 4)) += n iPos += n if (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fn >= pgsz { @@ -215920,13 +209281,11 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { } /* TODO2: Doclist terminator written here. */ /* pBuf->p[pBuf->n++] = '\0'; */ - _ = libc.Int32FromInt32(0) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { _sqlite3Fts5HashScanNext(tls, pHash) } } _fts5WriteFinish(tls, p, bp+8, bp+4) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp + 4)) > 0 { /* Update the Fts5Structure. It is written back to the database by the ** fts5StructureRelease() call below. */ @@ -215945,7 +209304,7 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { if (*TFts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnOriginCntr > uint64(0) { (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin1 = (*TFts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnOriginCntr (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin2 = (*TFts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnOriginCntr - (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnEntry = uint64((*TFts5Index)(unsafe.Pointer(p)).FnPendingRow) + (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnEntry = libc.Uint64FromInt32((*TFts5Index)(unsafe.Pointer(p)).FnPendingRow) (*TFts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnOriginCntr++ } (*TFts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnSegment++ @@ -215972,7 +209331,6 @@ func _fts5IndexFlush(tls *libc.TLS, p uintptr) { return } if (*TFts5Index)(unsafe.Pointer(p)).FnPendingData != 0 || (*TFts5Index)(unsafe.Pointer(p)).FnContentlessDelete != 0 { - _ = libc.Int32FromInt32(0) _fts5FlushOneHash(tls, p) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { _sqlite3Fts5HashClear(tls, (*TFts5Index)(unsafe.Pointer(p)).FpHash) @@ -216023,16 +209381,15 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint _fts5StructureRef(tls, pStruct) return pStruct } - _ = libc.Int32FromInt32(0) goto _1 _1: ; i++ } - nByte += int64(uint32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1)) * uint32(12)) + nByte += libc.Int64FromUint32(libc.Uint32FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1)) * uint32(12)) pNew = _sqlite3Fts5MallocZero(tls, p+40, nByte) if pNew != 0 { - nByte = int64(uint32(nSeg) * uint32(48)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt32(nSeg) * uint32(48)) if (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+int32(1) < int32(FTS5_MAX_LEVEL) { v2 = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel + int32(1) } else { @@ -216091,17 +209448,13 @@ func _sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) (r int32) { var _ /* pNew at bp+0 */ uintptr _, _ = iLvl, pStruct *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - _ = libc.Int32FromInt32(0) _fts5IndexFlush(tls, p) - _ = libc.Int32FromInt32(0) pStruct = _fts5StructureRead(tls, p) - _ = libc.Int32FromInt32(0) _fts5StructureInvalidate(tls, p) if pStruct != 0 { *(*uintptr)(unsafe.Pointer(bp)) = _fts5IndexOptimizeStruct(tls, p, pStruct) } _fts5StructureRelease(tls, pStruct) - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { iLvl = 0 for { @@ -216161,7 +209514,7 @@ func _sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) (r int32) { func _fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta Tu64, pUnused uintptr, pBuf uintptr) { _ = pUnused - _sqlite3Fts5BufferAppendVarint(tls, p+40, pBuf, int64(iDelta)) + _sqlite3Fts5BufferAppendVarint(tls, p+40, pBuf, libc.Int64FromUint64(iDelta)) } func _fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta Tu64, pMulti uintptr, pBuf uintptr) { @@ -216170,21 +209523,17 @@ func _fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta Tu64, pMulti uintptr, p _, _, _, _ = nByte, nData, v1, v2 nData = (*TFts5Iter)(unsafe.Pointer(pMulti)).Fbase.FnData nByte = nData + int32(9) + int32(9) + int32(FTS5_DATA_ZERO_PADDING) - _ = libc.Int32FromInt32(0) if v2 = (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK; v2 { - if uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+uint32(nByte) <= uint32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { + if libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)+libc.Uint32FromInt32(nByte) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) { v1 = 0 } else { - v1 = _sqlite3Fts5BufferSize(tls, p+40, pBuf, uint32(nByte+(*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + v1 = _sqlite3Fts5BufferSize(tls, p+40, pBuf, libc.Uint32FromInt32(nByte+(*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) } } if v2 && 0 == v1 { *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), iDelta) - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(nData*libc.Int32FromInt32(2))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), (*TFts5Iter)(unsafe.Pointer(pMulti)).Fbase.FpData, uint32(nData)) + *(*int32)(unsafe.Pointer(pBuf + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), libc.Uint64FromInt32(nData*libc.Int32FromInt32(2))) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), (*TFts5Iter)(unsafe.Pointer(pMulti)).Fbase.FpData, libc.Uint32FromInt32(nData)) *(*int32)(unsafe.Pointer(pBuf + 4)) += nData libc.Xmemset(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), 0, uint32(FTS5_DATA_ZERO_PADDING)) } @@ -216198,18 +209547,17 @@ func _fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { var _ /* nPos at bp+8 */ int32 _ = p p = (*TFts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist + uintptr((*TFts5DoclistIter)(unsafe.Pointer(pIter)).FnSize) + uintptr((*TFts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist) - _ = libc.Int32FromInt32(0) if p >= (*TFts5DoclistIter)(unsafe.Pointer(pIter)).FaEof { (*TFts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = uintptr(0) } else { p += uintptr(_sqlite3Fts5GetVarint(tls, p, bp)) *(*Ti64)(unsafe.Pointer(pIter + 4)) += *(*Ti64)(unsafe.Pointer(bp)) /* Read position list size */ - if int32(*(*Tu8)(unsafe.Pointer(p)))&int32(0x80) != 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p)))&int32(0x80) != 0 { (*TFts5DoclistIter)(unsafe.Pointer(pIter)).FnSize = _sqlite3Fts5GetVarint32(tls, p, bp+8) (*TFts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = *(*int32)(unsafe.Pointer(bp + 8)) >> int32(1) } else { - (*TFts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = int32(*(*Tu8)(unsafe.Pointer(p))) >> int32(1) + (*TFts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(p))) >> int32(1) (*TFts5DoclistIter)(unsafe.Pointer(pIter)).FnSize = int32(1) } (*TFts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = p @@ -216252,7 +209600,7 @@ func _fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) if i >= (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn { *(*int32)(unsafe.Pointer(piOff)) = -int32(1) } else { - *(*int32)(unsafe.Pointer(piOff)) = i + int32(_sqlite3Fts5GetVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(i), bp)) + *(*int32)(unsafe.Pointer(piOff)) = i + libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(i), bp)) p1 = piRowid *(*Ti64)(unsafe.Pointer(p1)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p1))) + *(*Tu64)(unsafe.Pointer(bp))) } @@ -216283,8 +209631,7 @@ func _fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf p2 = aBuf _ = nBuf libc.Xmemset(tls, bp+24, 0, uint32(12)) - _ = libc.Int32FromInt32(0) - _sqlite3Fts5BufferSize(tls, p+40, bp+24, uint32((*TFts5Buffer)(unsafe.Pointer(p1)).Fn+(*TFts5Buffer)(unsafe.Pointer(p2)).Fn)) + _sqlite3Fts5BufferSize(tls, p+40, bp+24, libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(p1)).Fn+(*TFts5Buffer)(unsafe.Pointer(p2)).Fn)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -216292,15 +209639,11 @@ func _fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf _fts5NextRowid(tls, p2, bp+4, bp+16) for *(*int32)(unsafe.Pointer(bp)) >= 0 || *(*int32)(unsafe.Pointer(bp + 4)) >= 0 { if *(*int32)(unsafe.Pointer(bp)) >= 0 && (*(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*Ti64)(unsafe.Pointer(bp + 8)) < *(*Ti64)(unsafe.Pointer(bp + 16))) { - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(bp + 24 + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp+24)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+24)).Fn), uint64(*(*Ti64)(unsafe.Pointer(bp + 8))-iOut)) - _ = libc.Int32FromInt32(0) + *(*int32)(unsafe.Pointer(bp + 24 + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp+24)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+24)).Fn), libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp + 8))-iOut)) iOut = *(*Ti64)(unsafe.Pointer(bp + 8)) _fts5NextRowid(tls, p1, bp, bp+8) } else { - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(bp + 24 + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp+24)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+24)).Fn), uint64(*(*Ti64)(unsafe.Pointer(bp + 16))-iOut)) - _ = libc.Int32FromInt32(0) + *(*int32)(unsafe.Pointer(bp + 24 + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp+24)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+24)).Fn), libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp + 16))-iOut)) iOut = *(*Ti64)(unsafe.Pointer(bp + 16)) if *(*int32)(unsafe.Pointer(bp)) >= 0 && *(*Ti64)(unsafe.Pointer(bp + 8)) == *(*Ti64)(unsafe.Pointer(bp + 16)) { _fts5NextRowid(tls, p1, bp, bp+8) @@ -216384,8 +209727,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu /* Initialize a doclist-iterator for each input buffer. Arrange them in ** a linked-list starting at pHead in ascending order of rowid. Avoid ** linking any iterators already at EOF into the linked list at all. */ - _ = libc.Int32FromInt32(0) - libc.Xmemset(tls, bp, 0, uint32(44)*uint32(nBuf+libc.Int32FromInt32(1))) + libc.Xmemset(tls, bp, 0, uint32(44)*libc.Uint32FromInt32(nBuf+libc.Int32FromInt32(1))) *(*uintptr)(unsafe.Pointer(bp + 704)) = bp + uintptr(nBuf)*44 _fts5DoclistIterInit(tls, p1, *(*uintptr)(unsafe.Pointer(bp + 704))) i = 0 @@ -216417,13 +209759,11 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu ** (the value PoslistNext64() uses for EOF) as a position and appending ** it to the output. This can happen at most once for each input ** position-list, hence (nBuf+1) 10 byte paddings. */ - if _sqlite3Fts5BufferSize(tls, p+40, bp+708, uint32(nOut)) != 0 { + if _sqlite3Fts5BufferSize(tls, p+40, bp+708, libc.Uint32FromInt32(nOut)) != 0 { return } for *(*uintptr)(unsafe.Pointer(bp + 704)) != 0 { - _ = libc.Int32FromInt32(0) - *(*int32)(unsafe.Pointer(bp + 708 + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), uint64((*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).Fiter.FiRowid)-uint64(iLastRowid)) - _ = libc.Int32FromInt32(0) + *(*int32)(unsafe.Pointer(bp + 708 + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), libc.Uint64FromInt64((*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).Fiter.FiRowid)-libc.Uint64FromInt64(iLastRowid)) iLastRowid = (*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).Fiter.FiRowid if (*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).FpNext != 0 && iLastRowid == (*TPrefixMerger)(unsafe.Pointer((*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).FpNext)).Fiter.FiRowid { /* Merge data from two or more poslists */ @@ -216452,7 +209792,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu /* See the earlier comment in this function for an explanation of why ** corrupt input position lists might cause the output to consume ** at most nMerge*10 bytes of unexpected space. */ - if _sqlite3Fts5BufferSize(tls, p+40, bp+720, uint32(nTmp+nMerge*int32(10))) != 0 { + if _sqlite3Fts5BufferSize(tls, p+40, bp+720, libc.Uint32FromInt32(nTmp+nMerge*int32(10))) != 0 { break } _sqlite3Fts5BufferZero(tls, bp+720) @@ -216475,22 +209815,17 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu } nTail = (*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).Fiter.FnPoslist - (*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).FiOff /* WRITEPOSLISTSIZE */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*(*TFts5Buffer)(unsafe.Pointer(bp + 720))).Fn+nTail > nTmp-int32(FTS5_DATA_ZERO_PADDING) { if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } break } - *(*int32)(unsafe.Pointer(bp + 708 + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), uint64(((*(*TFts5Buffer)(unsafe.Pointer(bp + 720))).Fn+nTail)*libc.Int32FromInt32(2))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), (*(*TFts5Buffer)(unsafe.Pointer(bp + 720))).Fp, uint32((*(*TFts5Buffer)(unsafe.Pointer(bp + 720))).Fn)) + *(*int32)(unsafe.Pointer(bp + 708 + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), libc.Uint64FromInt32(((*(*TFts5Buffer)(unsafe.Pointer(bp + 720))).Fn+nTail)*libc.Int32FromInt32(2))) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), (*(*TFts5Buffer)(unsafe.Pointer(bp + 720))).Fp, libc.Uint32FromInt32((*(*TFts5Buffer)(unsafe.Pointer(bp + 720))).Fn)) *(*int32)(unsafe.Pointer(bp + 708 + 4)) += (*(*TFts5Buffer)(unsafe.Pointer(bp + 720))).Fn if nTail > 0 { - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), (*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).FaPos+uintptr((*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).FiOff), uint32(nTail)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), (*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).FaPos+uintptr((*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 704)))).FiOff), libc.Uint32FromInt32(nTail)) *(*int32)(unsafe.Pointer(bp + 708 + 4)) += nTail } *(*uintptr)(unsafe.Pointer(bp + 704)) = pSave @@ -216513,8 +209848,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu /* Copy poslist from pHead to output */ pThis1 = *(*uintptr)(unsafe.Pointer(bp + 704)) pI = pThis1 - _ = libc.Int32FromInt32(0) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), (*TFts5DoclistIter)(unsafe.Pointer(pI)).FaPoslist, uint32((*TFts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist+(*TFts5DoclistIter)(unsafe.Pointer(pI)).FnSize)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp+708)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+708)).Fn), (*TFts5DoclistIter)(unsafe.Pointer(pI)).FaPoslist, libc.Uint32FromInt32((*TFts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist+(*TFts5DoclistIter)(unsafe.Pointer(pI)).FnSize)) *(*int32)(unsafe.Pointer(bp + 708 + 4)) += (*TFts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist + (*TFts5DoclistIter)(unsafe.Pointer(pI)).FnSize _fts5DoclistIterNext(tls, pI) *(*uintptr)(unsafe.Pointer(bp + 704)) = (*TPrefixMerger)(unsafe.Pointer(pThis1)).FpNext @@ -216549,9 +209883,8 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo xMerge = __ccgo_fp(_fts5MergePrefixLists) xAppend = __ccgo_fp(_fts5AppendPoslist) } - aBuf = _fts5IdxMalloc(tls, p, int64(uint32(12)*uint32(nBuf))) + aBuf = _fts5IdxMalloc(tls, p, libc.Int64FromUint32(uint32(12)*libc.Uint32FromInt32(nBuf))) pStruct = _fts5StructureRead(tls, p) - _ = libc.Int32FromInt32(0) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { flags = libc.Int32FromInt32(FTS5INDEX_QUERY_SCAN) | libc.Int32FromInt32(FTS5INDEX_QUERY_SKIPEMPTY) | libc.Int32FromInt32(FTS5INDEX_QUERY_NOOUTPUT) iLastRowid = 0 @@ -216576,7 +209909,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo pSeg = *(*uintptr)(unsafe.Pointer(bp)) + 72 + uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFirst + 1*4))).FiFirst)*96 (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxSetOutputs})))(tls, *(*uintptr)(unsafe.Pointer(bp)), pSeg) if (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FnData != 0 { - (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, uint64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-uint64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp)), bp+4) + (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, libc.Uint64FromInt64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-libc.Uint64FromInt64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp)), bp+4) iLastRowid = (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid } goto _1 @@ -216586,7 +209919,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo } _fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } - *(*Tu8)(unsafe.Pointer(pToken)) = uint8(int32('0') + iIdx) + *(*Tu8)(unsafe.Pointer(pToken)) = libc.Uint8FromInt32(int32('0') + iIdx) _fts5MultiIterNew(tls, p, pStruct, flags, pColset, pToken, nToken, -int32(1), 0, bp) _fts5IterSetOutputCb(tls, p+40, *(*uintptr)(unsafe.Pointer(bp))) for { @@ -216597,9 +209930,8 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo nTerm = (*TFts5SegIter)(unsafe.Pointer(pSeg1)).Fterm.Fn pTerm = (*TFts5SegIter)(unsafe.Pointer(pSeg1)).Fterm.Fp (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxSetOutputs})))(tls, *(*uintptr)(unsafe.Pointer(bp)), pSeg1) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp + 16)) != 0 { - if nTerm < nToken || libc.Xmemcmp(tls, pToken, pTerm, uint32(nToken)) != 0 { + if nTerm < nToken || libc.Xmemcmp(tls, pToken, pTerm, libc.Uint32FromInt32(nToken)) != 0 { break } } @@ -216613,7 +209945,6 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo break } i1 = i * nMerge - _ = libc.Int32FromInt32(0) iStore = i1 for { if !(iStore < i1+nMerge) { @@ -216650,14 +209981,13 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo } iLastRowid = 0 } - (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, uint64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-uint64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp)), bp+4) + (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, libc.Uint64FromInt64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-libc.Uint64FromInt64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp)), bp+4) iLastRowid = (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid goto _2 _2: ; _fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp)), bp+16) } - _ = libc.Int32FromInt32(0) i = 0 for { if !(i < nBuf) { @@ -216683,14 +210013,14 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo i += nMerge } _fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp))) - pData = _fts5IdxMalloc(tls, p, int64(uint32(12)+uint32((*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fn)+uint32(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint32(uint32(12)+libc.Uint32FromInt32((*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fn)+uint32(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*12 v8 = (*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fn (*TFts5Data)(unsafe.Pointer(pData)).FszLeaf = v8 (*TFts5Data)(unsafe.Pointer(pData)).Fnn = v8 if (*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fn != 0 { - libc.Xmemcpy(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fp, uint32((*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fn)) + libc.Xmemcpy(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fp, libc.Uint32FromInt32((*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fn)) } _fts5MultiIterNew2(tls, p, pData, bDesc, ppIter) } @@ -216707,7 +210037,6 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo // ** to the document with rowid iRowid. // */ func _sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid Ti64) (r int32) { - _ = libc.Int32FromInt32(0) /* Allocate the hash table if it has not already been allocated */ if (*TFts5Index)(unsafe.Pointer(p)).FpHash == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = _sqlite3Fts5HashNew(tls, (*TFts5Index)(unsafe.Pointer(p)).FpConfig, p+12, p+16) @@ -216730,7 +210059,6 @@ func _sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid // ** Commit data to disk. // */ func _sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) _fts5IndexFlush(tls, p) _sqlite3Fts5IndexCloseReader(tls, p) return _fts5IndexReturn(tls, p) @@ -216796,18 +210124,17 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36770, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36799, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+25887, __ccgo_ts+36778, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+25916, __ccgo_ts+36807, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11918, __ccgo_ts+36813, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11918, __ccgo_ts+36842, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) } } } - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) != 0 { _sqlite3Fts5IndexClose(tls, p) *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) @@ -216825,7 +210152,6 @@ func _sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) (r int32) { _ = rc rc = SQLITE_OK if p != 0 { - _ = libc.Int32FromInt32(0) _fts5StructureInvalidate(tls, p) Xsqlite3_finalize(tls, (*TFts5Index)(unsafe.Pointer(p)).FpWriter) Xsqlite3_finalize(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleter) @@ -216863,7 +210189,7 @@ func _sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nC } /* Input contains fewer than nChar chars */ v2 = n n++ - if int32(uint8(*(*int8)(unsafe.Pointer(p + uintptr(v2))))) >= int32(0xc0) { + if libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(p + uintptr(v2))))) >= int32(0xc0) { if n >= nByte { return 0 } @@ -216899,7 +210225,7 @@ func _fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) (r int32) { for i < nIn { v1 = i i++ - if int32(uint8(*(*int8)(unsafe.Pointer(pIn + uintptr(v1))))) >= int32(0xc0) { + if libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(v1))))) >= int32(0xc0) { for i < nIn && int32(*(*int8)(unsafe.Pointer(pIn + uintptr(i))))&int32(0xc0) == int32(0x80) { i++ } @@ -216927,8 +210253,6 @@ func _sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pT _, _, _, _, _ = i, nByte, nChar, pConfig, rc /* Used to iterate through indexes */ rc = SQLITE_OK /* Return code */ pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Add the entry to the main terms index. */ rc = _sqlite3Fts5HashWrite(tls, (*TFts5Index)(unsafe.Pointer(p)).FpHash, (*TFts5Index)(unsafe.Pointer(p)).FiWriteRowid, iCol, iPos, int8('0'), pToken, nToken) i = 0 @@ -216958,7 +210282,7 @@ func _sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pT // ** token pToken/nToken. // */ func _fts5IsTokendataPrefix(tls *libc.TLS, pBuf uintptr, pToken uintptr, nToken int32) (r int32) { - return libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn >= nToken && 0 == libc.Xmemcmp(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, pToken, uint32(nToken)) && ((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn == nToken || int32(*(*Tu8)(unsafe.Pointer((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(nToken)))) == 0x00)) + return libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn >= nToken && 0 == libc.Xmemcmp(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, pToken, libc.Uint32FromInt32(nToken)) && ((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn == nToken || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(nToken)))) == 0x00)) } // C documentation @@ -217024,13 +210348,13 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = int32(uint32(nAlloc)*uint32(4) + uint32(32)) + nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nAlloc)*uint32(4) + uint32(32)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { if pIn == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint32(nByte)) + libc.Xmemset(tls, pNew, 0, libc.Uint32FromInt32(nByte)) } pRet = pNew (*TFts5TokenDataIter)(unsafe.Pointer(pNew)).FnIterAlloc = nAlloc @@ -217045,7 +210369,6 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer(pRet + 28 + uintptr(v2)*4)) = pAppend } - _ = libc.Int32FromInt32(0) return pRet } @@ -217092,7 +210415,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int v1 = int32(64) } nNew = v1 - nByte = int32(uint32(nNew) * uint32(20)) + nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nNew) * uint32(20)) aNew = Xsqlite3_realloc(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap, nByte) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -217136,7 +210459,7 @@ func _fts5IterSetOutputsTokendata(tls *libc.TLS, pIter uintptr) { break } p = *(*uintptr)(unsafe.Pointer(pT + 28 + uintptr(ii)*4)) - if int32((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FbEof) == 0 { + if libc.Int32FromUint8((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FbEof) == 0 { if nHit == 0 || (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid < iRowid { iRowid = (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid nHit = int32(1) @@ -217169,7 +210492,7 @@ func _fts5IterSetOutputsTokendata(tls *libc.TLS, pIter uintptr) { *(*Ti64)(unsafe.Pointer(bp)) = 0 /* Allocate array of iterators if they are not already allocated. */ if (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaPoslistReader == uintptr(0) { - (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaPoslistReader = _sqlite3Fts5MallocZero(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex+40, int64(uint32((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter)*(libc.Uint32FromInt64(24)+libc.Uint32FromInt64(4)))) + (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaPoslistReader = _sqlite3Fts5MallocZero(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex+40, libc.Int64FromUint32(libc.Uint32FromInt32((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter)*(libc.Uint32FromInt64(24)+libc.Uint32FromInt64(4)))) if (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaPoslistReader == uintptr(0) { return } @@ -217195,10 +210518,10 @@ func _fts5IterSetOutputsTokendata(tls *libc.TLS, pIter uintptr) { ii++ } /* Ensure the output buffer is large enough */ - if uint32((*TFts5Buffer)(unsafe.Pointer(pIter+28)).Fn)+uint32(nByte+nHit*libc.Int32FromInt32(10)) <= uint32((*TFts5Buffer)(unsafe.Pointer(pIter+28)).FnSpace) { + if libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pIter+28)).Fn)+libc.Uint32FromInt32(nByte+nHit*libc.Int32FromInt32(10)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(pIter+28)).FnSpace) { v4 = 0 } else { - v4 = _sqlite3Fts5BufferSize(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex+40, pIter+28, uint32(nByte+nHit*int32(10)+(*TFts5Buffer)(unsafe.Pointer(pIter+28)).Fn)) + v4 = _sqlite3Fts5BufferSize(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex+40, pIter+28, libc.Uint32FromInt32(nByte+nHit*int32(10)+(*TFts5Buffer)(unsafe.Pointer(pIter+28)).Fn)) } if v4 != 0 { return @@ -217206,7 +210529,7 @@ func _fts5IterSetOutputsTokendata(tls *libc.TLS, pIter uintptr) { /* Ensure the token-mapping is large enough */ if eDetail == FTS5_DETAIL_FULL && (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap+nByte { nNew = ((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc + nByte) * int32(2) - aNew = Xsqlite3_realloc(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap, int32(uint32(nNew)*uint32(20))) + aNew = Xsqlite3_realloc(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap, libc.Int32FromUint32(libc.Uint32FromInt32(nNew)*uint32(20))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex)).Frc = int32(SQLITE_NOMEM) return @@ -217225,7 +210548,7 @@ func _fts5IterSetOutputsTokendata(tls *libc.TLS, pIter uintptr) { break } pReader = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaPoslistReader + uintptr(ii)*24 - if int32((*TFts5PoslistReader)(unsafe.Pointer(pReader)).FbEof) == 0 { + if libc.Int32FromUint8((*TFts5PoslistReader)(unsafe.Pointer(pReader)).FbEof) == 0 { if (*TFts5PoslistReader)(unsafe.Pointer(pReader)).FiPos < iMinPos { iMinPos = (*TFts5PoslistReader)(unsafe.Pointer(pReader)).FiPos iMin = ii @@ -217277,9 +210600,9 @@ func _fts5TokendataIterNext(tls *libc.TLS, pIter uintptr, bFrom int32, iFrom Ti6 break } p = *(*uintptr)(unsafe.Pointer(pT + 28 + uintptr(ii)*4)) - if int32((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FbEof) == 0 && ((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid == (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid || bFrom != 0 && (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid < iFrom) { + if libc.Int32FromUint8((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FbEof) == 0 && ((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid == (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid || bFrom != 0 && (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid < iFrom) { _fts5MultiIterNext(tls, pIndex, p, bFrom, iFrom) - for bFrom != 0 && int32((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FbEof) == 0 && (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid < iFrom && (*TFts5Index)(unsafe.Pointer(pIndex)).Frc == SQLITE_OK { + for bFrom != 0 && libc.Int32FromUint8((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FbEof) == 0 && (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid < iFrom && (*TFts5Index)(unsafe.Pointer(pIndex)).Frc == SQLITE_OK { _fts5MultiIterNext(tls, pIndex, p, 0, 0) } } @@ -217339,7 +210662,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+40, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(1), __ccgo_ts+36857) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(1), __ccgo_ts+36886) } else { _sqlite3Fts5BufferSet(tls, p+40, bp, nToken, pToken) } @@ -217503,13 +210826,12 @@ func _sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*TFts5Buffer)(unsafe.Pointer(bp + 4)) = TFts5Buffer{} /* If the QUERY_SCAN flag is set, all other flags must be clear. */ - _ = libc.Int32FromInt32(0) - if _sqlite3Fts5BufferSize(tls, p+40, bp+4, uint32(nToken+int32(1))) == 0 { + if _sqlite3Fts5BufferSize(tls, p+40, bp+4, libc.Uint32FromInt32(nToken+int32(1))) == 0 { iIdx = 0 /* Index to search */ iPrefixIdx = 0 /* +1 prefix index */ bTokendata = (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata if nToken > 0 { - libc.Xmemcpy(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fp+1, pToken, uint32(nToken)) + libc.Xmemcpy(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fp+1, pToken, libc.Uint32FromInt32(nToken)) } if flags&(libc.Int32FromInt32(FTS5INDEX_QUERY_NOTOKENDATA)|libc.Int32FromInt32(FTS5INDEX_QUERY_SCAN)) != 0 { bTokendata = 0 @@ -217551,7 +210873,7 @@ func _sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int if iIdx <= (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix { /* Straight index lookup */ pStruct = _fts5StructureRead(tls, p) - *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fp)) = uint8(libc.Int32FromUint8('0') + iIdx) + *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fp)) = libc.Uint8FromInt32(libc.Int32FromUint8('0') + iIdx) if pStruct != 0 { _fts5MultiIterNew(tls, p, pStruct, flags|int32(FTS5INDEX_QUERY_SKIPEMPTY), pColset, (*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fp, nToken+int32(1), -int32(1), 0, bp) _fts5StructureRelease(tls, pStruct) @@ -217561,9 +210883,7 @@ func _sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int bDesc = libc.BoolInt32(flags&int32(FTS5INDEX_QUERY_DESC) != 0) _fts5SetupPrefixIter(tls, p, bDesc, iPrefixIdx, (*(*TFts5Buffer)(unsafe.Pointer(bp + 4))).Fp, nToken+int32(1), pColset, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - _ = libc.Int32FromInt32(0) } else { - _ = libc.Int32FromInt32(0) _fts5IterSetOutputCb(tls, p+40, *(*uintptr)(unsafe.Pointer(bp))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { pSeg = *(*uintptr)(unsafe.Pointer(bp)) + 72 + uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFirst + 1*4))).FiFirst)*96 @@ -217597,7 +210917,6 @@ func _sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) (r int32) { var pIter uintptr _ = pIter pIter = pIndexIter - _ = libc.Int32FromInt32(0) if (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter != 0 { _fts5TokendataIterNext(tls, pIter, 0, 0) } else { @@ -217616,11 +210935,10 @@ func _sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) (r int32) { _, _, _ = p, pIter, pSeg pIter = pIndexIter p = (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex - _ = libc.Int32FromInt32(0) _fts5MultiIterNext(tls, p, pIter, 0, 0) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { pSeg = pIter + 72 + uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4))).FiFirst)*96 - if (*TFts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 && int32(*(*Tu8)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp))) != int32('0') { + if (*TFts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp))) != int32('0') { _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf) (*TFts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf = uintptr(0) (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = uint8(1) @@ -217660,7 +210978,6 @@ func _sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) (r uint var _ /* n at bp+0 */ int32 _, _ = z, v1 z = _fts5MultiIterTerm(tls, pIndexIter, bp) - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(pn)) = *(*int32)(unsafe.Pointer(bp)) - int32(1) if z != 0 { v1 = z + 1 @@ -217752,15 +211069,13 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok pIter = pIndexIter pT = (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter p = (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) ii = 0 for { if !(ii < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter) { break } pTerm = *(*uintptr)(unsafe.Pointer(pT + 28 + uintptr(ii)*4)) + 72 + 68 - if nToken == (*TFts5Buffer)(unsafe.Pointer(pTerm)).Fn-int32(1) && libc.Xmemcmp(tls, pToken, (*TFts5Buffer)(unsafe.Pointer(pTerm)).Fp+uintptr(1), uint32(nToken)) == 0 { + if nToken == (*TFts5Buffer)(unsafe.Pointer(pTerm)).Fn-int32(1) && libc.Xmemcmp(tls, pToken, (*TFts5Buffer)(unsafe.Pointer(pTerm)).Fp+uintptr(1), libc.Uint32FromInt32(nToken)) == 0 { break } goto _1 @@ -217805,17 +211120,17 @@ func _sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSiz _, _, _, _ = i, iCol, nCol, pData nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FnCol *(*Ti64)(unsafe.Pointer(pnRow)) = 0 - libc.Xmemset(tls, anSize, 0, uint32(8)*uint32(nCol)) + libc.Xmemset(tls, anSize, 0, uint32(8)*libc.Uint32FromInt32(nCol)) pData = _fts5DataRead(tls, p, int64(FTS5_AVERAGES_ROWID)) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TFts5Data)(unsafe.Pointer(pData)).Fnn != 0 { i = 0 - i += int32(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr(i), pnRow)) + i += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr(i), pnRow)) iCol = 0 for { if !(i < (*TFts5Data)(unsafe.Pointer(pData)).Fnn && iCol < nCol) { break } - i += int32(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr(i), anSize+uintptr(iCol)*8)) + i += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr(i), anSize+uintptr(iCol)*8)) goto _1 _1: ; @@ -217833,7 +211148,6 @@ func _sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSiz // ** supplied as the second argument. // */ func _sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) (r int32) { - _ = libc.Int32FromInt32(0) _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), pData, nData) return _fts5IndexReturn(tls, p) } @@ -217867,9 +211181,8 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) _, _ = pConfig, rc /* Return code */ pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - _ = libc.Int32FromInt32(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36312, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+4) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36341, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+4) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -217899,7 +211212,7 @@ func _sqlite3Fts5IndexGetOrigin(tls *libc.TLS, p uintptr, piOrigin uintptr) (r i _ = pStruct pStruct = _fts5StructureRead(tls, p) if pStruct != 0 { - *(*Ti64)(unsafe.Pointer(piOrigin)) = int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnOriginCntr) + *(*Ti64)(unsafe.Pointer(piOrigin)) = libc.Int64FromUint64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnOriginCntr) _fts5StructureRelease(tls, pStruct) } return _fts5IndexReturn(tls, p) @@ -217922,14 +211235,14 @@ func _fts5IndexTombstoneAddToPage(tls *libc.TLS, pPg uintptr, bForce int32, nPg var aSlot, aSlot1 uintptr var iSlot, nCollide, nElem, nSlot, szKey, v1, v2, v3, v4, v5 int32 _, _, _, _, _, _, _, _, _, _, _, _ = aSlot, aSlot1, iSlot, nCollide, nElem, nSlot, szKey, v1, v2, v3, v4, v5 - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pPg)).Fp))) == int32(4) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pPg)).Fp))) == int32(4) { v1 = int32(4) } else { v1 = int32(8) } szKey = v1 if (*TFts5Data)(unsafe.Pointer(pPg)).Fnn > int32(16) { - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pPg)).Fp))) == int32(4) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pPg)).Fp))) == int32(4) { v3 = int32(4) } else { v3 = int32(8) @@ -217939,8 +211252,8 @@ func _fts5IndexTombstoneAddToPage(tls *libc.TLS, pPg uintptr, bForce int32, nPg v2 = int32(1) } nSlot = v2 - nElem = int32(_fts5GetU32(tls, (*TFts5Data)(unsafe.Pointer(pPg)).Fp+4)) - iSlot = int32(iRowid / uint64(nPg) % uint64(nSlot)) + nElem = libc.Int32FromUint32(_fts5GetU32(tls, (*TFts5Data)(unsafe.Pointer(pPg)).Fp+4)) + iSlot = libc.Int32FromUint64(iRowid / libc.Uint64FromInt32(nPg) % libc.Uint64FromInt32(nSlot)) nCollide = nSlot if szKey == int32(4) && iRowid > uint64(0xFFFFFFFF) { return int32(2) @@ -217952,7 +211265,7 @@ func _fts5IndexTombstoneAddToPage(tls *libc.TLS, pPg uintptr, bForce int32, nPg if bForce == 0 && nElem >= nSlot/int32(2) { return int32(1) } - _fts5PutU32(tls, (*TFts5Data)(unsafe.Pointer(pPg)).Fp+4, uint32(nElem+int32(1))) + _fts5PutU32(tls, (*TFts5Data)(unsafe.Pointer(pPg)).Fp+4, libc.Uint32FromInt32(nElem+int32(1))) if szKey == int32(4) { aSlot = (*TFts5Data)(unsafe.Pointer(pPg)).Fp + 8 for *(*Tu32)(unsafe.Pointer(aSlot + uintptr(iSlot)*4)) != 0 { @@ -218005,7 +211318,7 @@ func _fts5IndexTombstoneRehash(tls *libc.TLS, p uintptr, pSeg uintptr, pData1 ui if !(ii < nOut) { break } - *(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apOut + uintptr(ii)*4)))).Fp)) = uint8(szKey) + *(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apOut + uintptr(ii)*4)))).Fp)) = libc.Uint8FromInt32(szKey) _fts5PutU32(tls, (*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apOut + uintptr(ii)*4)))).Fp+4, uint32(0)) goto _1 _1: @@ -218028,7 +211341,7 @@ func _fts5IndexTombstoneRehash(tls *libc.TLS, p uintptr, pSeg uintptr, pData1 ui pFree = v3 } if pData != 0 { - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pData)).Fp))) == int32(4) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pData)).Fp))) == int32(4) { v4 = int32(4) } else { v4 = int32(8) @@ -218055,7 +211368,7 @@ func _fts5IndexTombstoneRehash(tls *libc.TLS, p uintptr, pSeg uintptr, pData1 ui } /* If iVal is not 0 at this point, insert it into the new hash table */ if iVal != 0 { - pPg = *(*uintptr)(unsafe.Pointer(apOut + uintptr(iVal%uint64(nOut))*4)) + pPg = *(*uintptr)(unsafe.Pointer(apOut + uintptr(iVal%libc.Uint64FromInt32(nOut))*4)) res = _fts5IndexTombstoneAddToPage(tls, pPg, 0, nOut, iVal) if res != 0 { break @@ -218134,8 +211447,7 @@ func _fts5IndexTombstoneRebuild(tls *libc.TLS, p uintptr, pSeg uintptr, pData1 u } else { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnPgTombstone == int32(1) { /* Case 2. */ - nElem = int32(_fts5GetU32(tls, (*TFts5Data)(unsafe.Pointer(pData1)).Fp+4)) - _ = libc.Int32FromInt32(0) + nElem = libc.Int32FromUint32(_fts5GetU32(tls, (*TFts5Data)(unsafe.Pointer(pData1)).Fp+4)) nOut = int32(1) if nElem*int32(4) > MINSLOT { v2 = nElem * int32(4) @@ -218160,15 +211472,14 @@ func _fts5IndexTombstoneRebuild(tls *libc.TLS, p uintptr, pSeg uintptr, pData1 u szPage = 0 apOut = uintptr(0) /* Allocate space for the new hash table */ - _ = libc.Int32FromInt32(0) - apOut = _sqlite3Fts5MallocZero(tls, p+40, int64(uint32(4)*uint32(nOut))) + apOut = _sqlite3Fts5MallocZero(tls, p+40, libc.Int64FromUint32(uint32(4)*libc.Uint32FromInt32(nOut))) szPage = int32(8) + nSlot*szKey ii = 0 for { if !(ii < nOut) { break } - pNew = _sqlite3Fts5MallocZero(tls, p+40, int64(uint32(12)+uint32(szPage))) + pNew = _sqlite3Fts5MallocZero(tls, p+40, libc.Int64FromUint32(uint32(12)+libc.Uint32FromInt32(szPage))) if pNew != 0 { (*TFts5Data)(unsafe.Pointer(pNew)).Fnn = szPage (*TFts5Data)(unsafe.Pointer(pNew)).Fp = pNew + 1*12 @@ -218195,7 +211506,6 @@ func _fts5IndexTombstoneRebuild(tls *libc.TLS, p uintptr, pSeg uintptr, pData1 u } /* If control flows to here, it was not possible to rebuild the hash ** table. Free all buffers and then try again with more pages. */ - _ = libc.Int32FromInt32(0) _fts5IndexFreeArray(tls, apOut, nOut) nSlot = nSlotPerPage nOut = nOut*int32(2) + int32(1) @@ -218223,10 +211533,9 @@ func _fts5IndexTombstoneAdd(tls *libc.TLS, p uintptr, pSeg uintptr, iRowid Tu64) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) (*TFts5Index)(unsafe.Pointer(p)).FnContentlessDelete++ if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnPgTombstone > 0 { - iPg = int32(iRowid % uint64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnPgTombstone)) + iPg = libc.Int32FromUint64(iRowid % libc.Uint64FromInt32((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnPgTombstone)) pPg = _fts5DataRead(tls, p, int64((*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid+libc.Int32FromInt32(1)<<libc.Int32FromInt32(16))<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)+libc.Int32FromInt32(FTS5_DATA_DLI_B))+int64(libc.Int32FromInt32(0))<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B))+int64(libc.Int32FromInt32(0))<<libc.Int32FromInt32(FTS5_DATA_PAGE_B)+int64(iPg)) if pPg == uintptr(0) { - _ = libc.Int32FromInt32(0) return } if 0 == _fts5IndexTombstoneAddToPage(tls, pPg, 0, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnPgTombstone, iRowid) { @@ -218237,7 +211546,7 @@ func _fts5IndexTombstoneAdd(tls *libc.TLS, p uintptr, pSeg uintptr, iRowid Tu64) } /* Have to rebuild the hash table. First figure out the key-size (4 or 8). */ if pPg != 0 { - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pPg)).Fp))) == int32(4) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(pPg)).Fp))) == int32(4) { v2 = int32(4) } else { v2 = int32(8) @@ -218252,12 +211561,11 @@ func _fts5IndexTombstoneAdd(tls *libc.TLS, p uintptr, pSeg uintptr, iRowid Tu64) } /* Rebuild the hash table */ _fts5IndexTombstoneRebuild(tls, p, pSeg, pPg, iPg, szKey, bp, bp+4) - _ = libc.Int32FromInt32(0) /* If all has succeeded, write the new rowid into one of the new hash ** table pages, then write them all out to disk. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { ii = 0 - _fts5IndexTombstoneAddToPage(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)) + uintptr(iRowid%uint64(*(*int32)(unsafe.Pointer(bp))))*4)), int32(1), *(*int32)(unsafe.Pointer(bp)), iRowid) + _fts5IndexTombstoneAddToPage(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)) + uintptr(iRowid%libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp))))*4)), int32(1), *(*int32)(unsafe.Pointer(bp)), iRowid) ii = 0 for { if !(ii < *(*int32)(unsafe.Pointer(bp))) { @@ -218302,12 +211610,12 @@ func _sqlite3Fts5IndexContentlessDelete(tls *libc.TLS, p uintptr, iOrigin Ti64, break } pSeg = (*(*TFts5StructureLevel)(unsafe.Pointer(pStruct + 28 + uintptr(iLvl)*12))).FaSeg + uintptr(iSeg)*48 - if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin1 <= uint64(iOrigin) && (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin2 >= uint64(iOrigin) { + if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin1 <= libc.Uint64FromInt64(iOrigin) && (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin2 >= libc.Uint64FromInt64(iOrigin) { if bFound == 0 { (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnEntryTombstone++ bFound = int32(1) } - _fts5IndexTombstoneAdd(tls, p, pSeg, uint64(iRowid)) + _fts5IndexTombstoneAdd(tls, p, pSeg, libc.Uint64FromInt64(iRowid)) } goto _2 _2: @@ -218339,18 +211647,18 @@ func _sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid Ti64, iCol int32, iPos in var i int32 var ret Tu64 _, _ = i, ret - ret = uint64(iRowid) - ret += ret<<libc.Int32FromInt32(3) + uint64(iCol) - ret += ret<<libc.Int32FromInt32(3) + uint64(iPos) + ret = libc.Uint64FromInt64(iRowid) + ret += ret<<libc.Int32FromInt32(3) + libc.Uint64FromInt32(iCol) + ret += ret<<libc.Int32FromInt32(3) + libc.Uint64FromInt32(iPos) if iIdx >= 0 { - ret += ret<<libc.Int32FromInt32(3) + uint64(libc.Int32FromUint8('0')+iIdx) + ret += ret<<libc.Int32FromInt32(3) + libc.Uint64FromInt32(libc.Int32FromUint8('0')+iIdx) } i = 0 for { if !(i < nTerm) { break } - ret += ret<<libc.Int32FromInt32(3) + uint64(*(*int8)(unsafe.Pointer(pTerm + uintptr(i)))) + ret += ret<<libc.Int32FromInt32(3) + libc.Uint64FromInt8(*(*int8)(unsafe.Pointer(pTerm + uintptr(i)))) goto _1 _1: ; @@ -218385,7 +211693,7 @@ func _fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirs if !((*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf >= (*TFts5Data)(unsafe.Pointer(pLeaf)).Fnn) { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } - if i >= iNoRowid && 0 != int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) { + if i >= iNoRowid && 0 != libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } } @@ -218434,7 +211742,7 @@ func _fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = *(*int32)(unsafe.Pointer(bp + 32)) - _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(*(*int32)(unsafe.Pointer(bp + 36))), (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff)) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 36))), (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff)) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { res = _fts5BufferCompare(tls, bp, bp+12) @@ -218468,7 +211776,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+36859, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+36888, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -218499,7 +211807,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } } else { /* Comparison of term and split-key */ iOff = _fts5LeafFirstTermOff(tls, pLeaf) - iRowidOff = int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) + iRowidOff = libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) if iRowidOff >= iOff || iOff >= (*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } else { @@ -218517,7 +211825,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } else { v3 = nIdxTerm } - v1 = libc.Xmemcmp(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), zIdxTerm, uint32(v3)) + v1 = libc.Xmemcmp(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), zIdxTerm, libc.Uint32FromInt32(v3)) } res = v1 if res == 0 { @@ -218559,7 +211867,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { iKey = int64(iSegid)<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)+libc.Int32FromInt32(FTS5_DATA_DLI_B)) + int64(libc.Int32FromInt32(0))<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)) + int64(libc.Int32FromInt32(0))<<libc.Int32FromInt32(FTS5_DATA_PAGE_B) + int64(iPg) pLeaf = _fts5DataRead(tls, p, iKey) if pLeaf != 0 { - if int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) != 0 { + if libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) != 0 { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } _fts5DataRelease(tls, pLeaf) @@ -218575,8 +211883,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { iKey = int64(iSegid)<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)+libc.Int32FromInt32(FTS5_DATA_DLI_B)) + int64(libc.Int32FromInt32(0))<<(libc.Int32FromInt32(FTS5_DATA_PAGE_B)+libc.Int32FromInt32(FTS5_DATA_HEIGHT_B)) + int64(libc.Int32FromInt32(0))<<libc.Int32FromInt32(FTS5_DATA_PAGE_B) + int64(iPrevLeaf) pLeaf = _fts5DataRead(tls, p, iKey) if pLeaf != 0 { - iRowidOff1 = int32(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) - _ = libc.Int32FromInt32(0) + iRowidOff1 = libc.Int32FromUint16(_fts5GetU16(tls, (*TFts5Data)(unsafe.Pointer(pLeaf)).Fp)) if iRowidOff1 >= (*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } else { @@ -218642,7 +211949,6 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC /* Load the FTS index structure */ pStruct = _fts5StructureRead(tls, p) if pStruct == uintptr(0) { - _ = libc.Int32FromInt32(0) return _fts5IndexReturn(tls, p) } /* Check that the internal nodes of each segment match the leaves */ @@ -218701,7 +212007,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12))+72+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FaFirst + 1*4))).FiFirst)*96, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(4), __ccgo_ts+36945) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(4), __ccgo_ts+36974) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+32, bp+24) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 24)) >> libc.Int32FromInt32(32)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 24)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -218745,7 +212051,6 @@ func _sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) (r int32) { } func _sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) if _fts5IndexDataVersion(tls, p) != (*TFts5Index)(unsafe.Pointer(p)).FiStructVersion { _fts5StructureInvalidate(tls, p) } @@ -219128,7 +212433,6 @@ func _fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc pTab = _sqlite3Fts5MallocZero(tls, bp, int64(36)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5ConfigParse(tls, pGlobal, db, argc, azConfig, bp+4, pzErr) - _ = libc.Int32FromInt32(0) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig = *(*uintptr)(unsafe.Pointer(bp + 4)) @@ -219148,7 +212452,6 @@ func _fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc } /* Load the initial configuration */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - _ = libc.Int32FromInt32(0) (*TFts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FpzErrmsg = pzErr *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexLoadConfig(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) _sqlite3Fts5IndexRollback(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) @@ -219201,12 +212504,10 @@ func _fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { } func _fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) (r int32) { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FePattern == int32(FTS5_PATTERN_GLOB) && int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_GLOB) { + if (*TFts5Config)(unsafe.Pointer(pConfig)).FePattern == int32(FTS5_PATTERN_GLOB) && libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_GLOB) { return int32(1) } - if (*TFts5Config)(unsafe.Pointer(pConfig)).FePattern == int32(FTS5_PATTERN_LIKE) && (int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_LIKE) || int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_GLOB)) { + if (*TFts5Config)(unsafe.Pointer(pConfig)).FePattern == int32(FTS5_PATTERN_LIKE) && (libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_LIKE) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_GLOB)) { return int32(1) } return 0 @@ -219293,13 +212594,8 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) bSeenLt = 0 bSeenMatch = 0 bSeenRank = 0 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+36950, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+36979, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -219315,13 +212611,12 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) } p = (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12 iCol = (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_MATCH) || int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) && iCol >= nCol { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_MATCH) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) && iCol >= nCol { /* A MATCH operator or equivalent */ - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0 || iCol < 0 { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0 || iCol < 0 { /* As there exists an unusable MATCH constraint this is an ** unusable plan. Set a prohibitively high cost. */ (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = float64(1e+50) - _ = libc.Int32FromInt32(0) *(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr))) = 0 return SQLITE_OK } else { @@ -219341,7 +212636,6 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) *(*int8)(unsafe.Pointer(idxStr + uintptr(v3))) = int8('M') Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5202, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) - _ = libc.Int32FromInt32(0) } } iCons++ @@ -219352,10 +212646,9 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) } else { if (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 { if iCol >= 0 && iCol < nCol && _fts5UsePatternMatch(tls, pConfig, p) != 0 { - _ = libc.Int32FromInt32(0) v5 = iIdxStr iIdxStr++ - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_LIKE) { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_LIKE) { v6 = int32('L') } else { v6 = int32('G') @@ -219366,9 +212659,8 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) iCons++ v7 = iCons (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8))).FargvIndex = v7 - _ = libc.Int32FromInt32(0) } else { - if bSeenEq == 0 && int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) && iCol < 0 { + if bSeenEq == 0 && libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) && iCol < 0 { v8 = iIdxStr iIdxStr++ *(*int8)(unsafe.Pointer(idxStr + uintptr(v8))) = int8('=') @@ -219393,7 +212685,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) } p1 = (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12 if (*Tsqlite3_index_constraint)(unsafe.Pointer(p1)).FiColumn < 0 && (*Tsqlite3_index_constraint)(unsafe.Pointer(p1)).Fusable != 0 { - op = int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p1)).Fop) + op = libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p1)).Fop) if op == int32(SQLITE_INDEX_CONSTRAINT_LT) || op == int32(SQLITE_INDEX_CONSTRAINT_LE) { if bSeenLt != 0 { goto _10 @@ -219523,11 +212815,11 @@ func _fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) { pCsr = uintptr(0) /* Return code */ rc = _fts5NewTransaction(tls, pTab) if rc == SQLITE_OK { - nByte = int64(uint32(116) + uint32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint32(4)) - pCsr = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(116) + libc.Uint32FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint32(4)) + pCsr = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pCsr != 0 { pGlobal = (*TFts5FullTable)(unsafe.Pointer(pTab)).FpGlobal - libc.Xmemset(tls, pCsr, 0, uint32(nByte)) + libc.Xmemset(tls, pCsr, 0, libc.Uint32FromInt64(nByte)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize = pCsr + 1*116 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpNext = (*TFts5Global)(unsafe.Pointer(pGlobal)).FpCsr (*TFts5Global)(unsafe.Pointer(pGlobal)).FpCsr = pCsr @@ -219609,7 +212901,7 @@ func _fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { Xsqlite3_free(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs) } _sqlite3Fts5IndexCloseReader(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) - libc.Xmemset(tls, pCsr+20, 0, uint32(116)-uint32(int32(pCsr+20)-int32(pCsr))) + libc.Xmemset(tls, pCsr+20, 0, uint32(116)-libc.Uint32FromInt32(int32(pCsr+20)-int32(pCsr))) } // C documentation @@ -219731,7 +213023,6 @@ func _fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) (r int32) { var pTab uintptr _, _, _, _ = bDesc, iRowid, pTab, rc rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&int32(FTS5CSR_REQUIRE_RESEEK) != 0 { pTab = (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab bDesc = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FbDesc @@ -219768,8 +213059,6 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { var _ /* bSkip at bp+0 */ int32 _, _, _, _ = pConfig, pCsr, rc, v1 pCsr = pCursor - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* If this cursor uses FTS5_PLAN_MATCH and this is a tokendata=1 table, ** clear any token mappings accumulated at the fts5_index.c level. In ** other cases, specifically FTS5_PLAN_SOURCE and FTS5_PLAN_SORTED_MATCH, @@ -219850,12 +213139,12 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = int64(uint32(24) + uint32(4)*uint32(nPhrase-libc.Int32FromInt32(1))) - pSorter = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = libc.Int64FromUint32(uint32(24) + uint32(4)*libc.Uint32FromInt32(nPhrase-libc.Int32FromInt32(1))) + pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pSorter, 0, uint32(nByte)) + libc.Xmemset(tls, pSorter, 0, libc.Uint32FromInt64(nByte)) (*TFts5Sorter)(unsafe.Pointer(pSorter)).FnIdx = nPhrase /* TODO: It would be better to have some system for reusing statement ** handles here, rather than preparing a new one for each query. But that @@ -219875,14 +213164,13 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1662 } if bDesc != 0 { - v3 = __ccgo_ts + 36989 + v3 = __ccgo_ts + 37018 } else { - v3 = __ccgo_ts + 36994 + v3 = __ccgo_ts + 37023 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+36998, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37027, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr rc = _fts5SorterNext(tls, pCsr) (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = uintptr(0) @@ -219937,16 +213225,15 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr ; n++ } - _ = libc.Int32FromInt32(0) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37053, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37082, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5545, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37059, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37088, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -219996,16 +213283,15 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37087, libc.VaList(bp+16, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37116, libc.VaList(bp+16, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+4, uintptr(0)) Xsqlite3_free(tls, zSql) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) - nByte = int64(uint32(4) * uint32((*TFts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg)) + nByte = libc.Int64FromUint32(uint32(4) * libc.Uint32FromInt32((*TFts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg = _sqlite3Fts5MallocZero(tls, bp, nByte) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { i = 0 @@ -220023,7 +213309,6 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpRankArgStmt = *(*uintptr)(unsafe.Pointer(bp + 4)) } else { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) - _ = libc.Int32FromInt32(0) } } } @@ -220031,8 +213316,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - _ = libc.Int32FromInt32(0) - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37097, libc.VaList(bp+16, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37126, libc.VaList(bp+16, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -220066,7 +213350,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 56)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37118, libc.VaList(bp+16, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37147, libc.VaList(bp+16, z)) } } } else { @@ -220074,7 +213358,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35050 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35079 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -220125,21 +213409,13 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint iIdxStr = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+36950, 0) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+36979, 0) return int32(SQLITE_ERROR) } if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan != 0 { _fts5FreeCursorComponents(tls, pCsr) - libc.Xmemset(tls, pCsr+20, 0, uint32(116)-uint32(int32(pCsr+20)-int32(pCsr))) - } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + libc.Xmemset(tls, pCsr+20, 0, uint32(116)-libc.Uint32FromInt32(int32(pCsr+20)-int32(pCsr))) + } (*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = pTab + 8 /* Decode the arguments passed through to this function. */ i = 0 @@ -220204,7 +213480,6 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint case int32('<'): pRowidLe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4)) default: - _ = libc.Int32FromInt32(0) pRowidGe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4)) break } @@ -220254,10 +213529,6 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint ** return results to the user for this query. The current cursor ** (pCursor) is used to execute the query issued by function ** fts5CursorFirstSorted() above. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5Cursor)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FbDesc != 0 { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = (*TFts5Cursor)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiFirstRowid (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = (*TFts5Cursor)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiLastRowid @@ -220270,7 +213541,6 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint rc = _fts5CursorFirst(tls, pTab, pCsr, bDesc) } else { if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr != 0 { - _ = libc.Int32FromInt32(0) rc = _fts5CursorParseRank(tls, pConfig, pCsr, pRank) if rc == SQLITE_OK { if bOrderByRank != 0 { @@ -220283,7 +213553,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+37151, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+37180, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -220297,7 +213567,6 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint rc = _sqlite3Fts5StorageStmt(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, _fts5StmtType(tls, pCsr), pCsr+44, pTab+8) if rc == SQLITE_OK { if pRowidEq != uintptr(0) { - _ = libc.Int32FromInt32(0) Xsqlite3_bind_value(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, int32(1), pRowidEq) } else { Xsqlite3_bind_int64(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, int32(1), (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid) @@ -220341,7 +213610,6 @@ func _fts5EofMethod(tls *libc.TLS, pCursor uintptr) (r int32) { // ** Return the rowid that the cursor currently points to. // */ func _fts5CursorRowid(tls *libc.TLS, pCsr uintptr) (r Ti64) { - _ = libc.Int32FromInt32(0) if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 { return (*TFts5Sorter)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid } else { @@ -220364,7 +213632,6 @@ func _fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) _, _ = ePlan, pCsr pCsr = pCursor ePlan = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan - _ = libc.Int32FromInt32(0) switch ePlan { case int32(FTS5_PLAN_SPECIAL): *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = 0 @@ -220407,12 +213674,9 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { v1 = uintptr(0) } rc = _sqlite3Fts5StorageStmt(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, eStmt, pCsr+44, v1) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) } if rc == SQLITE_OK && (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&int32(FTS5CSR_REQUIRE_CONTENT) != 0 { pTab1 = (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab - _ = libc.Int32FromInt32(0) Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) Xsqlite3_bind_int64(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, int32(1), _fts5CursorRowid(tls, pCsr)) (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer(pTab1)).FpConfig)).FbLock++ @@ -220439,7 +213703,6 @@ func _fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { var ap Tva_list _ = ap /* ... printf arguments */ ap = va - _ = libc.Int32FromInt32(0) (*TFts5FullTable)(unsafe.Pointer(p)).Fp.Fbase.FzErrMsg = Xsqlite3_vmprintf(tls, zFormat, ap) _ = ap } @@ -220472,18 +213735,18 @@ func _fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) rc = SQLITE_OK *(*int32)(unsafe.Pointer(bp)) = 0 bLoadConfig = 0 - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37187, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37216, zCmd) { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37198, 0) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37227, 0) rc = int32(SQLITE_ERROR) } else { rc = _sqlite3Fts5StorageDeleteAll(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } bLoadConfig = int32(1) } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37278, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37307, zCmd) { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_NONE) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37286, 0) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37315, 0) rc = int32(SQLITE_ERROR) } else { rc = _sqlite3Fts5StorageRebuild(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage) @@ -220493,15 +213756,15 @@ func _fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+17448, zCmd) { rc = _sqlite3Fts5StorageOptimize(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37342, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37371, zCmd) { nMerge = Xsqlite3_value_int(tls, pVal) rc = _sqlite3Fts5StorageMerge(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, nMerge) } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37348, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37377, zCmd) { iArg = Xsqlite3_value_int(tls, pVal) rc = _sqlite3Fts5StorageIntegrity(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iArg) } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37364, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37393, zCmd) { rc = _sqlite3Fts5FlushToDisk(tls, pTab) } else { rc = _sqlite3Fts5FlushToDisk(tls, pTab) @@ -220586,11 +213849,6 @@ func _fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK /* Return code */ bUpdateOrDelete = 0 /* A transaction must be open when this is called. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0 { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexLoadConfig(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { @@ -220606,10 +213864,11 @@ func _fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(int32(2)+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*4))) if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+17968, z) { if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37370, 0) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37399, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { *(*int32)(unsafe.Pointer(bp)) = _fts5SpecialDelete(tls, pTab, apVal) + bUpdateOrDelete = int32(1) } } else { *(*int32)(unsafe.Pointer(bp)) = _fts5SpecialInsert(tls, pTab, z, *(*uintptr)(unsafe.Pointer(apVal + uintptr(int32(2)+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol+int32(1))*4))) @@ -220630,8 +213889,6 @@ func _fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { eConflict = Xsqlite3_vtab_on_conflict(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb) } - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Filter out attempts to run UPDATE or DELETE on contentless tables. ** This is not suported. Except - they are both supported if the CREATE ** VIRTUAL TABLE statement contained "contentless_delete=1". */ @@ -220639,9 +213896,9 @@ func _fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, if nArg > int32(1) { v1 = __ccgo_ts + 21001 } else { - v1 = __ccgo_ts + 37429 + v1 = __ccgo_ts + 37458 } - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37441, libc.VaList(bp+16, v1, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37470, libc.VaList(bp+16, v1, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if nArg == int32(1) { @@ -220692,7 +213949,7 @@ func _fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && bUpdateOrDelete != 0 && (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete != 0 && (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion == int32(FTS5_CURRENT_VERSION) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageConfigValue(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, __ccgo_ts+35978, uintptr(0), int32(FTS5_CURRENT_VERSION_SECUREDELETE)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageConfigValue(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, __ccgo_ts+36007, uintptr(0), int32(FTS5_CURRENT_VERSION_SECUREDELETE)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = int32(FTS5_CURRENT_VERSION_SECUREDELETE) } @@ -220914,7 +214171,7 @@ func _fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) (r int32) { nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FnCol nIter = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter == uintptr(0) { - nByte = int64(uint32(24) * uint32(nIter)) + nByte = libc.Int64FromUint32(uint32(24) * libc.Uint32FromInt32(nIter)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter = _sqlite3Fts5MallocZero(tls, bp, nByte) } aIter = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter @@ -220943,7 +214200,7 @@ func _fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) (r int32) { if !(i < nIter) { break } - if int32((*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FbEof) == 0 && (iBest < 0 || (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FiPos < (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(iBest)*24))).FiPos) { + if libc.Int32FromUint8((*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FbEof) == 0 && (iBest < 0 || (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24))).FiPos < (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(iBest)*24))).FiPos) { iBest = i } goto _2 @@ -220962,7 +214219,7 @@ func _fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) (r int32) { v3 = int32(32) } nNewSize = v3 - aInst = Xsqlite3_realloc64(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaInst, uint64(uint32(nNewSize)*uint32(4)*uint32(3))) + aInst = Xsqlite3_realloc64(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaInst, uint64(libc.Uint32FromInt32(nNewSize)*uint32(4)*uint32(3))) if aInst != 0 { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaInst = aInst (*TFts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc = nNewSize @@ -221071,7 +214328,7 @@ func _fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr if !(i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { *(*int32)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)) = -int32(1) } goto _1 @@ -221085,7 +214342,7 @@ func _fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr if !(rc == SQLITE_OK && i1 < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i1)))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i1)))) == 0 { p = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i1)*4 *(*int32)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i1)*4)) = 0 rc = _fts5ApiColumnText(tls, pCtx, i1, bp, bp+4) @@ -221233,7 +214490,6 @@ func _fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintp pCsr = pCtx rc = _fts5CsrPoslist(tls, pCsr, iPhrase, pIter, bp) if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) if (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 { v1 = (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp))) } else { @@ -221269,7 +214525,7 @@ func _fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol *(*int32)(unsafe.Pointer(piCol)) = -int32(1) return } - if int32(*(*uint8)(unsafe.Pointer((*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == int32(0x01) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == int32(0x01) { break } *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(_sqlite3Fts5GetVarint32(tls, (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp+4)) @@ -221304,7 +214560,6 @@ func _fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter rc = _sqlite3Fts5ExprPhraseCollist(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, pIter, bp) } if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) if (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 { v2 = (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp))) } else { @@ -221317,7 +214572,6 @@ func _fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter } else { rc = _fts5CsrPoslist(tls, pCsr, iPhrase, pIter, bp+4) if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) if (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 { v3 = (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp + 4))) } else { @@ -221327,7 +214581,7 @@ func _fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter if *(*int32)(unsafe.Pointer(bp + 4)) <= 0 { *(*int32)(unsafe.Pointer(piCol)) = -int32(1) } else { - if int32(*(*uint8)(unsafe.Pointer((*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == int32(0x01) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == int32(0x01) { *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(int32(1) + _sqlite3Fts5GetVarint32(tls, (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa+1, piCol)) } else { *(*int32)(unsafe.Pointer(piCol)) = 0 @@ -221457,7 +214711,6 @@ func _fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData u } func _fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, argc int32, argv uintptr) { - _ = libc.Int32FromInt32(0) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpAux = pAux (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Auxiliary)(unsafe.Pointer(pAux)).FxFunc})))(tls, uintptr(unsafe.Pointer(&_sFts5Api)), pCsr, context, argc, argv) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpAux = uintptr(0) @@ -221488,12 +214741,11 @@ func _fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) var iCsrId Ti64 var pAux, pCsr, zErr uintptr _, _, _, _ = iCsrId, pAux, pCsr, zErr - _ = libc.Int32FromInt32(0) pAux = Xsqlite3_user_data(tls, context) iCsrId = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) pCsr = _fts5CursorFromCsrid(tls, (*TFts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal, iCsrId) if pCsr == uintptr(0) || (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 0 { - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+37478, libc.VaList(bp+8, iCsrId)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+37507, libc.VaList(bp+8, iCsrId)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } else { @@ -221585,7 +214837,7 @@ _5: break } nPoslist = _sqlite3Fts5ExprPoslist(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+20) - _sqlite3Fts5BufferAppendBlob(tls, bp, bp+4, uint32(nPoslist), *(*uintptr)(unsafe.Pointer(bp + 20))) + _sqlite3Fts5BufferAppendBlob(tls, bp, bp+4, libc.Uint32FromInt32(nPoslist), *(*uintptr)(unsafe.Pointer(bp + 20))) goto _8 _8: ; @@ -221614,7 +214866,7 @@ _2: break } *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5ExprPhraseCollist(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+32, bp+36) - _sqlite3Fts5BufferAppendBlob(tls, bp, bp+4, uint32(*(*int32)(unsafe.Pointer(bp + 36))), *(*uintptr)(unsafe.Pointer(bp + 32))) + _sqlite3Fts5BufferAppendBlob(tls, bp, bp+4, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 36))), *(*uintptr)(unsafe.Pointer(bp + 32))) goto _10 _10: ; @@ -221647,7 +214899,6 @@ func _fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) pConfig = (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig pCsr = pCursor rc = SQLITE_OK - _ = libc.Int32FromInt32(0) if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan == int32(FTS5_PLAN_SPECIAL) { if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { Xsqlite3_result_int64(tls, pCtx, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial) @@ -221685,7 +214936,7 @@ func _fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) (*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = uintptr(0) } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 && Xsqlite3_vtab_nochange(tls, pCtx) != 0 { - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+37499, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+37528, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -221812,13 +215063,13 @@ func _fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintpt pGlobal = pApi rc = Xsqlite3_overload_function(tls, (*TFts5Global)(unsafe.Pointer(pGlobal)).Fdb, zName, -int32(1)) if rc == SQLITE_OK { /* Bytes of space to allocate */ - nName = int64(libc.Xstrlen(tls, zName) + uint32(1)) + nName = libc.Int64FromUint32(libc.Xstrlen(tls, zName) + uint32(1)) nByte = int64(24) + nName - pAux = Xsqlite3_malloc64(tls, uint64(nByte)) + pAux = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pAux != 0 { - libc.Xmemset(tls, pAux, 0, uint32(nByte)) + libc.Xmemset(tls, pAux, 0, libc.Uint32FromInt64(nByte)) (*TFts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc = pAux + 1*24 - libc.Xmemcpy(tls, (*TFts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc, zName, uint32(nName)) + libc.Xmemcpy(tls, (*TFts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc, zName, libc.Uint32FromInt64(nName)) (*TFts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal = pGlobal (*TFts5Auxiliary)(unsafe.Pointer(pAux)).FpUserData = pUserData (*TFts5Auxiliary)(unsafe.Pointer(pAux)).FxFunc = xFunc @@ -221845,13 +215096,13 @@ func _fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData _, _, _, _, _ = nByte, nName, pGlobal, pNew, rc pGlobal = pApi /* Bytes of space to allocate */ rc = SQLITE_OK - nName = int64(libc.Xstrlen(tls, zName) + uint32(1)) + nName = libc.Int64FromUint32(libc.Xstrlen(tls, zName) + uint32(1)) nByte = int64(28) + nName - pNew = Xsqlite3_malloc64(tls, uint64(nByte)) + pNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pNew != 0 { - libc.Xmemset(tls, pNew, 0, uint32(nByte)) + libc.Xmemset(tls, pNew, 0, libc.Uint32FromInt64(nByte)) (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FzName = pNew + 1*28 - libc.Xmemcpy(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FzName, zName, uint32(nName)) + libc.Xmemcpy(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FzName, zName, libc.Uint32FromInt64(nName)) (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FpUserData = pUserData (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).Fx = *(*Tfts5_tokenizer)(unsafe.Pointer(pTokenizer)) (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FxDestroy = xDestroy @@ -221926,9 +215177,10 @@ func _sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nAr } pMod = _fts5LocateTokenizer(tls, pGlobal, v1) if pMod == uintptr(0) { - _ = libc.Int32FromInt32(0) rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37570, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg)))) + if pzErr != 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37599, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg)))) + } } else { if azArg != 0 { v2 = azArg + 1*4 @@ -221943,8 +215195,8 @@ func _sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nAr rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx.FxCreate})))(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, v2, v3, pConfig+64) (*TFts5Config)(unsafe.Pointer(pConfig)).FpTokApi = pMod + 8 if rc != SQLITE_OK { - if pzErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37592, 0) + if pzErr != 0 && rc != int32(SQLITE_NOMEM) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37621, 0) } } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FePattern = _sqlite3Fts5TokenizerPattern(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx.FxCreate, (*TFts5Config)(unsafe.Pointer(pConfig)).FpTok) @@ -221999,8 +215251,7 @@ func _fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { _, _ = pGlobal, ppApi pGlobal = Xsqlite3_user_data(tls, pCtx) _ = nArg - _ = libc.Int32FromInt32(0) - ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), __ccgo_ts+37623) + ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), __ccgo_ts+37652) if ppApi != 0 { *(*uintptr)(unsafe.Pointer(ppApi)) = pGlobal } @@ -222012,10 +215263,9 @@ func _fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { // ** Implementation of fts5_source_id() function. // */ func _fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) { - _ = libc.Int32FromInt32(0) _ = nArg _ = apUnused - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+37636, -int32(1), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+37665, -int32(1), uintptr(-libc.Int32FromInt32(1))) } // C documentation @@ -222044,10 +215294,10 @@ func _fts5ShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName2 = [5]uintptr{ - 0: __ccgo_ts + 37727, - 1: __ccgo_ts + 35239, - 2: __ccgo_ts + 25887, - 3: __ccgo_ts + 35806, + 0: __ccgo_ts + 37756, + 1: __ccgo_ts + 35268, + 2: __ccgo_ts + 25916, + 3: __ccgo_ts + 35835, 4: __ccgo_ts + 11918, } @@ -222065,23 +215315,24 @@ func _fts5IntegrityMethod(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zTabnam var rc, v1 int32 _, _, _ = pTab, rc, v1 pTab = pVtab - _ = libc.Int32FromInt32(0) _ = isQuick + (*TFts5Config)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = pzErr rc = _sqlite3Fts5StorageIntegrity(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, 0) - if rc&int32(0xff) == int32(SQLITE_CORRUPT) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37734, libc.VaList(bp+8, zSchema, zTabname)) - if *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - v1 = SQLITE_OK + if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) && rc != SQLITE_OK { + if rc&int32(0xff) == int32(SQLITE_CORRUPT) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37763, libc.VaList(bp+8, zSchema, zTabname)) + if *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { + v1 = SQLITE_OK + } else { + v1 = int32(SQLITE_NOMEM) + } + rc = v1 } else { - v1 = int32(SQLITE_NOMEM) - } - rc = v1 - } else { - if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37780, libc.VaList(bp+8, zSchema, zTabname, Xsqlite3_errstr(tls, rc))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37809, libc.VaList(bp+8, zSchema, zTabname, Xsqlite3_errstr(tls, rc))) } } _sqlite3Fts5IndexCloseReader(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) + (*TFts5Config)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = uintptr(0) return rc } @@ -222101,7 +215352,7 @@ func _fts5Init(tls *libc.TLS, db uintptr) (r int32) { (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxCreateFunction = __ccgo_fp(_fts5CreateAux) (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxCreateTokenizer = __ccgo_fp(_fts5CreateTokenizer) (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxFindTokenizer = __ccgo_fp(_fts5FindTokenizer) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+37843, uintptr(unsafe.Pointer(&_fts5Mod)), p, __ccgo_fp(_fts5ModuleDestroy)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+37872, uintptr(unsafe.Pointer(&_fts5Mod)), p, __ccgo_fp(_fts5ModuleDestroy)) if rc == SQLITE_OK { rc = _sqlite3Fts5IndexInit(tls, db) } @@ -222118,10 +215369,10 @@ func _fts5Init(tls *libc.TLS, db uintptr) (r int32) { rc = _sqlite3Fts5VocabInit(tls, pGlobal, db) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+37843, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_fts5Fts5Func), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+37872, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_fts5Fts5Func), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+37848, 0, libc.Int32FromInt32(SQLITE_UTF8)|libc.Int32FromInt32(SQLITE_DETERMINISTIC)|libc.Int32FromInt32(SQLITE_INNOCUOUS), p, __ccgo_fp(_fts5SourceIdFunc), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+37877, 0, libc.Int32FromInt32(SQLITE_UTF8)|libc.Int32FromInt32(SQLITE_DETERMINISTIC)|libc.Int32FromInt32(SQLITE_INNOCUOUS), p, __ccgo_fp(_fts5SourceIdFunc), uintptr(0), uintptr(0)) } } /* If SQLITE_FTS5_ENABLE_TEST_MI is defined, assume that the file @@ -222222,21 +215473,19 @@ func _fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, rc = SQLITE_OK /* If there is no %_docsize table, there should be no requests for ** statements to operate on it. */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(p + 24 + uintptr(eStmt)*4)) == uintptr(0) { azStmt = [11]uintptr{ - 0: __ccgo_ts + 37863, - 1: __ccgo_ts + 37931, - 2: __ccgo_ts + 38000, - 3: __ccgo_ts + 38033, - 4: __ccgo_ts + 38072, - 5: __ccgo_ts + 38112, - 6: __ccgo_ts + 38151, - 7: __ccgo_ts + 38194, - 8: __ccgo_ts + 38233, - 9: __ccgo_ts + 38277, - 10: __ccgo_ts + 38317, + 0: __ccgo_ts + 37892, + 1: __ccgo_ts + 37960, + 2: __ccgo_ts + 38029, + 3: __ccgo_ts + 38062, + 4: __ccgo_ts + 38101, + 5: __ccgo_ts + 38141, + 6: __ccgo_ts + 38180, + 7: __ccgo_ts + 38223, + 8: __ccgo_ts + 38262, + 9: __ccgo_ts + 38306, + 10: __ccgo_ts + 38346, } pC = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig zSql = uintptr(0) @@ -222253,7 +215502,7 @@ func _fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, fallthrough case int32(FTS5_STMT_REPLACE_CONTENT): nCol = (*TFts5Config)(unsafe.Pointer(pC)).FnCol + int32(1) - zBind = Xsqlite3_malloc64(tls, uint64(int32(1)+nCol*int32(2))) + zBind = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(int32(1)+nCol*int32(2))) if zBind != 0 { i = 0 for { @@ -222273,14 +215522,14 @@ func _fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, } case int32(FTS5_STMT_REPLACE_DOCSIZE): if (*TFts5Config)(unsafe.Pointer(pC)).FbContentlessDelete != 0 { - v2 = __ccgo_ts + 38340 + v2 = __ccgo_ts + 38369 } else { v2 = __ccgo_ts + 1662 } zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pC)).FzDb, (*TFts5Config)(unsafe.Pointer(pC)).FzName, v2)) case int32(FTS5_STMT_LOOKUP_DOCSIZE): if (*TFts5Config)(unsafe.Pointer(pC)).FbContentlessDelete != 0 { - v3 = __ccgo_ts + 38343 + v3 = __ccgo_ts + 38372 } else { v3 = __ccgo_ts + 1662 } @@ -222297,7 +215546,7 @@ func _fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, f |= int32(SQLITE_PREPARE_NO_VTAB) } (*TFts5Config)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock++ - rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pC)).Fdb, zSql, -int32(1), uint32(f), p+24+uintptr(eStmt)*4, uintptr(0)) + rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pC)).Fdb, zSql, -int32(1), libc.Uint32FromInt32(f), p+24+uintptr(eStmt)*4, uintptr(0)) (*TFts5Config)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock-- Xsqlite3_free(tls, zSql) if rc != SQLITE_OK && pzErrMsg != 0 { @@ -222338,12 +215587,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38351, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38380, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38455, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38484, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38493, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38522, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -222352,7 +215601,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38531, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38560, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -222364,14 +215613,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+25887, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+25916, zName) _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11918, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37727, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37756, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35806, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35835, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35239, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35268, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -222391,13 +215640,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30527 + v1 = __ccgo_ts + 30556 } else { v1 = __ccgo_ts + 1662 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+38573, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+38602, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+38603, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+38632, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -222419,55 +215668,55 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr var nByte Tsqlite3_int64 var p, zCols, zDefn, v1 uintptr _, _, _, _, _, _, _, _, _ = i, iOff, nByte, nDefn, p, rc, zCols, zDefn, v1 - rc = SQLITE_OK /* Bytes of space to allocate */ - nByte = int64(uint32(68) + uint32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint32(8)) /* Fts5Storage.aTotalSize[] */ - v1 = Xsqlite3_malloc64(tls, uint64(nByte)) + rc = SQLITE_OK /* Bytes of space to allocate */ + nByte = libc.Int64FromUint32(uint32(68) + libc.Uint32FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint32(8)) /* Fts5Storage.aTotalSize[] */ + v1 = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) p = v1 *(*uintptr)(unsafe.Pointer(pp)) = v1 if !(p != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, p, 0, uint32(nByte)) + libc.Xmemset(tls, p, 0, libc.Uint32FromInt64(nByte)) (*TFts5Storage)(unsafe.Pointer(p)).FaTotalSize = p + 1*68 (*TFts5Storage)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Storage)(unsafe.Pointer(p)).FpIndex = pIndex if bCreate != 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { nDefn = int32(32) + (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol*int32(10) - zDefn = Xsqlite3_malloc64(tls, uint64(int64(32)+int64((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*int64(10))) + zDefn = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(int64(32)+int64((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*int64(10))) if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+38647, 0) - iOff = int32(libc.Xstrlen(tls, zDefn)) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+38676, 0) + iOff = libc.Int32FromUint32(libc.Xstrlen(tls, zDefn)) i = 0 for { if !(i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+38670, libc.VaList(bp+8, i)) - iOff += int32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+38699, libc.VaList(bp+8, i)) + iOff += libc.Int32FromUint32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) goto _2 _2: ; i++ } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35239, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35268, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 38676 + zCols = __ccgo_ts + 38705 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 38708 + zCols = __ccgo_ts + 38737 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35806, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35835, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37727, __ccgo_ts+38756, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37756, __ccgo_ts+38785, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+35978, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36007, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -222490,7 +215739,7 @@ func _sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) (r int32) { /* Finalize all SQL statements */ i = 0 for { - if !(i < int32(libc.Uint32FromInt64(44)/libc.Uint32FromInt64(4))) { + if !(i < libc.Int32FromUint32(libc.Uint32FromInt64(44)/libc.Uint32FromInt64(4))) { break } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(p + 24 + uintptr(i)*4))) @@ -222576,9 +215825,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if !(rc == SQLITE_OK && iCol <= (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { zText = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) nText = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) @@ -222632,8 +215879,6 @@ func _fts5StorageContentlessDelete(tls *libc.TLS, p uintptr, iDel Ti64) (r int32 iOrigin = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = SQLITE_OK - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) /* Look up the origin of the document in the %_docsize table. Store ** this in stack variable iOrigin. */ rc = _fts5StorageGetStmt(tls, p, int32(FTS5_STMT_LOOKUP_DOCSIZE), bp, uintptr(0)) @@ -222764,7 +216009,6 @@ func _sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel Ti64, apVal uintpt _, _ = pConfig, rc pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - _ = libc.Int32FromInt32(0) rc = _fts5StorageLoadTotals(tls, p, int32(1)) /* Delete the index records */ if rc == SQLITE_OK { @@ -222814,9 +216058,9 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38773, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38802, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38823, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38852, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -222824,7 +216068,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+35978, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36007, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -222862,7 +216106,7 @@ func _sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) (r int32) { break } (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 16))).FszCol = 0 - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 16))).FiCol)))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 16))).FiCol)))) == 0 { zText = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 12)), (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 16))).FiCol+int32(1)) nText = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 12)), (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 16))).FiCol+int32(1)) *(*int32)(unsafe.Pointer(bp + 28)) = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), zText, nText, bp+16, __ccgo_fp(_fts5StorageInsertCallback)) @@ -223009,7 +216253,7 @@ func _sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRo break } (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 4))).FszCol = 0 - if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 4))).FiCol)))) == 0 { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 4))).FiCol)))) == 0 { zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 4))).FiCol+int32(2))*4))) nText = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 4))).FiCol+int32(2))*4))) *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), zText, nText, bp+4, __ccgo_fp(_fts5StorageInsertCallback)) @@ -223038,7 +216282,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+38852, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+38881, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -223113,7 +216357,6 @@ func _fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32 iPos = (*TFts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiCol iCol = 0 default: - _ = libc.Int32FromInt32(0) iPos = 0 iCol = 0 break @@ -223165,12 +216408,12 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint32(32)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, uint64(uint32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(8)))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint32FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } aColSize = aTotalSize + uintptr((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*8 - libc.Xmemset(tls, aTotalSize, 0, uint32(8)*uint32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)) + libc.Xmemset(tls, aTotalSize, 0, uint32(8)*libc.Uint32FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)) bUseCksum = libc.BoolInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_EXTERNAL) && iArg != 0) if bUseCksum != 0 { /* Generate the expected index checksum based on the contents of the @@ -223249,14 +216492,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35239, bp+40) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35268, bp+40) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 40)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { *(*Ti64)(unsafe.Pointer(bp + 48)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35806, bp+48) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35835, bp+48) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 48)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } @@ -223281,10 +216524,8 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 func _sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, pzErrMsg uintptr) (r int32) { var rc int32 _ = rc - _ = libc.Int32FromInt32(0) rc = _fts5StorageGetStmt(tls, p, eStmt, pp, pzErrMsg) if rc == SQLITE_OK { - _ = libc.Int32FromInt32(0) *(*uintptr)(unsafe.Pointer(p + 24 + uintptr(eStmt)*4)) = uintptr(0) } return rc @@ -223298,7 +216539,6 @@ func _sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, // ** must match that passed to the sqlite3Fts5StorageStmt() call. // */ func _sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) { - _ = libc.Int32FromInt32(0) if *(*uintptr)(unsafe.Pointer(p + 24 + uintptr(eStmt)*4)) == uintptr(0) { Xsqlite3_reset(tls, pStmt) *(*uintptr)(unsafe.Pointer(p + 24 + uintptr(eStmt)*4)) = pStmt @@ -223347,11 +216587,9 @@ func _sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid Ti64, aCol uint _, _, _, _, _ = aBlob, bCorrupt, nBlob, nCol, rc nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol /* Number of user columns in table */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Return Code */ - _ = libc.Int32FromInt32(0) rc = _fts5StorageGetStmt(tls, p, int32(FTS5_STMT_LOOKUP_DOCSIZE), bp, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { bCorrupt = int32(1) - _ = libc.Int32FromInt32(0) Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), iRowid) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { aBlob = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -223365,7 +216603,6 @@ func _sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid Ti64, aCol uint rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } } else { - _ = libc.Int32FromInt32(0) } return rc } @@ -223586,7 +216823,7 @@ func _fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars break } if int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i))))&int32(0x80) == 0 { - *(*uint8)(unsafe.Pointer(p + uintptr(int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i))))))) = uint8(bTokenChars) + *(*uint8)(unsafe.Pointer(p + uintptr(int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i))))))) = libc.Uint8FromInt32(bTokenChars) } goto _1 _1: @@ -223627,14 +216864,14 @@ func _fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, libc.Xmemcpy(tls, p, uintptr(unsafe.Pointer(&_aAsciiTokenChar)), uint32(128)) i = 0 for { - if !(rc == SQLITE_OK && i < nArg) { + if !(rc == SQLITE_OK && i < nArg-int32(1)) { break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*4)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38884) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38913) { _fts5AsciiAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38895) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38924) { _fts5AsciiAddExceptions(tls, p, zArg, 0) } else { rc = int32(SQLITE_ERROR) @@ -223645,6 +216882,9 @@ func _fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ; i += int32(2) } + if rc == SQLITE_OK && i < nArg { + rc = int32(SQLITE_ERROR) + } if rc != SQLITE_OK { _fts5AsciiDelete(tls, p) p = uintptr(0) @@ -223697,7 +216937,7 @@ func _fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused _ = iUnused for is < nText && rc == SQLITE_OK { /* Skip any leading divider characters. */ - for is < nText && (int32(*(*int8)(unsafe.Pointer(pText + uintptr(is))))&int32(0x80) == 0 && int32(*(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*int8)(unsafe.Pointer(pText + uintptr(is)))))))) == 0) { + for is < nText && (int32(*(*int8)(unsafe.Pointer(pText + uintptr(is))))&int32(0x80) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*int8)(unsafe.Pointer(pText + uintptr(is)))))))) == 0) { is++ } if is == nText { @@ -223714,7 +216954,7 @@ func _fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused if pFold != bp { Xsqlite3_free(tls, pFold) } - pFold = Xsqlite3_malloc64(tls, uint64(int64(nByte)*int64(2))) + pFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(int64(nByte)*int64(2))) if pFold == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -223777,9 +217017,9 @@ func _fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars var iCode Tu32 _, _, _, _, _, _, _, _, _, _, _ = aNew, bToken, i, iCode, n, nNew, rc, zCsr, zTerm, v1, v2 rc = SQLITE_OK - n = int32(libc.Xstrlen(tls, z)) + n = libc.Int32FromUint32(libc.Xstrlen(tls, z)) if n > 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(uint32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint32(4))) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint32FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint32(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -223790,28 +217030,26 @@ func _fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars iCode = uint32(*(*uint8)(unsafe.Pointer(v1))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zCsr != zTerm && int32(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { + for zCsr != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { v2 = zCsr zCsr++ - iCode = iCode<<libc.Int32FromInt32(6) + uint32(libc.Int32FromInt32(0x3f)&int32(*(*uint8)(unsafe.Pointer(v2)))) + iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2)))) } if iCode < uint32(0x80) || iCode&uint32(0xFFFFF800) == uint32(0xD800) || iCode&uint32(0xFFFFFFFE) == uint32(0xFFFE) { iCode = uint32(0xFFFD) } } if iCode < uint32(128) { - *(*uint8)(unsafe.Pointer(p + uintptr(iCode))) = uint8(bTokenChars) + *(*uint8)(unsafe.Pointer(p + uintptr(iCode))) = libc.Uint8FromInt32(bTokenChars) } else { - bToken = int32(*(*uint8)(unsafe.Pointer(p + 148 + uintptr(_sqlite3Fts5UnicodeCategory(tls, iCode))))) - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) - if bToken != bTokenChars && _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) == 0 { + bToken = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 148 + uintptr(_sqlite3Fts5UnicodeCategory(tls, iCode))))) + if bToken != bTokenChars && _sqlite3Fts5UnicodeIsdiacritic(tls, libc.Int32FromUint32(iCode)) == 0 { i = 0 for { if !(i < nNew) { break } - if uint32(*(*int32)(unsafe.Pointer(aNew + uintptr(i)*4))) > iCode { + if libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(aNew + uintptr(i)*4))) > iCode { break } goto _3 @@ -223819,8 +217057,8 @@ func _fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars ; i++ } - libc.Xmemmove(tls, aNew+uintptr(i+int32(1))*4, aNew+uintptr(i)*4, uint32(nNew-i)*uint32(4)) - *(*int32)(unsafe.Pointer(aNew + uintptr(i)*4)) = int32(iCode) + libc.Xmemmove(tls, aNew+uintptr(i+int32(1))*4, aNew+uintptr(i)*4, libc.Uint32FromInt32(nNew-i)*uint32(4)) + *(*int32)(unsafe.Pointer(aNew + uintptr(i)*4)) = libc.Int32FromUint32(iCode) nNew++ } } @@ -223916,21 +217154,21 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(180)) if p != 0 { - zCat = __ccgo_ts + 38906 + zCat = __ccgo_ts + 38935 libc.Xmemset(tls, p, 0, uint32(180)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(uint32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint32(1))) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint32FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint32(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } /* Search for a "categories" argument */ i = 0 for { - if !(rc == SQLITE_OK && i < nArg) { + if !(rc == SQLITE_OK && i < nArg-int32(1)) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38915) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38944) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*4)) } goto _1 @@ -223943,25 +217181,24 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } i = 0 for { - if !(rc == SQLITE_OK && i < nArg) { + if !(rc == SQLITE_OK && i < nArg-int32(1)) { break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*4)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38926) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38955) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(*(*int8)(unsafe.Pointer(zArg))) - int32('0') - _ = libc.Int32FromInt32(0) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38884) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38913) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38895) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38924) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38915) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38944) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -223974,6 +217211,9 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 ; i += int32(2) } + if i < nArg && rc == SQLITE_OK { + rc = int32(SQLITE_ERROR) + } } else { rc = int32(SQLITE_NOMEM) } @@ -223994,7 +217234,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 // ** character (not a separator). // */ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { - return int32(*(*uint8)(unsafe.Pointer(p + 148 + uintptr(_sqlite3Fts5UnicodeCategory(tls, uint32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) + return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 148 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { @@ -224025,7 +217265,7 @@ _2: if zCsr >= zTerm { goto tokenize_done } - if int32(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0x80) != 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0x80) != 0 { /* A character outside of the ascii range. Skip past it if it is ** a separator character. Or break out of the loop if it is not. */ is = int32(zCsr) - int32(pText) @@ -224034,16 +217274,16 @@ _2: iCode = uint32(*(*uint8)(unsafe.Pointer(v3))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zCsr != zTerm && int32(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { + for zCsr != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { v4 = zCsr zCsr++ - iCode = iCode<<libc.Int32FromInt32(6) + uint32(libc.Int32FromInt32(0x3f)&int32(*(*uint8)(unsafe.Pointer(v4)))) + iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4)))) } if iCode < uint32(0x80) || iCode&uint32(0xFFFFF800) == uint32(0xD800) || iCode&uint32(0xFFFFFFFE) == uint32(0xFFFE) { iCode = uint32(0xFFFD) } } - if _fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 { + if _fts5UnicodeIsAlnum(tls, p, libc.Int32FromUint32(iCode)) != 0 { goto non_ascii_tokenchar } } else { @@ -224064,13 +217304,13 @@ _6: /* Grow the output buffer so that there is sufficient space to fit the ** largest possible utf-8 character. */ if zOut > pEnd { - aFold = Xsqlite3_malloc64(tls, uint64(int64(nFold)*int64(2))) + aFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(int64(nFold)*int64(2))) if aFold == uintptr(0) { rc = int32(SQLITE_NOMEM) goto tokenize_done } zOut = aFold + uintptr(int32(zOut)-int32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold)) - libc.Xmemcpy(tls, aFold, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold, uint32(nFold)) + libc.Xmemcpy(tls, aFold, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold, libc.Uint32FromInt32(nFold)) Xsqlite3_free(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = aFold v7 = nFold * libc.Int32FromInt32(2) @@ -224078,7 +217318,7 @@ _6: (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = v7 pEnd = aFold + uintptr(nFold-int32(6)) } - if !(int32(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0x80) != 0) { + if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0x80) != 0) { goto _8 } /* An non-ascii-range character. Fold it into the output buffer if @@ -224088,59 +217328,59 @@ _6: iCode = uint32(*(*uint8)(unsafe.Pointer(v10))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zCsr != zTerm && int32(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { + for zCsr != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { v11 = zCsr zCsr++ - iCode = iCode<<libc.Int32FromInt32(6) + uint32(libc.Int32FromInt32(0x3f)&int32(*(*uint8)(unsafe.Pointer(v11)))) + iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v11)))) } if iCode < uint32(0x80) || iCode&uint32(0xFFFFF800) == uint32(0xD800) || iCode&uint32(0xFFFFFFFE) == uint32(0xFFFE) { iCode = uint32(0xFFFD) } } - if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { + if !(_fts5UnicodeIsAlnum(tls, p, libc.Int32FromUint32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, libc.Int32FromUint32(iCode)) != 0) { goto _12 } goto non_ascii_tokenchar non_ascii_tokenchar: ; - iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) + iCode = libc.Uint32FromInt32(_sqlite3Fts5UnicodeFold(tls, libc.Int32FromUint32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) if iCode != 0 { if iCode < uint32(0x00080) { v14 = zOut zOut++ - *(*int8)(unsafe.Pointer(v14)) = int8(uint8(iCode & libc.Uint32FromInt32(0xFF))) + *(*int8)(unsafe.Pointer(v14)) = libc.Int8FromUint8(uint8(iCode & libc.Uint32FromInt32(0xFF))) } else { if iCode < uint32(0x00800) { v15 = zOut zOut++ - *(*int8)(unsafe.Pointer(v15)) = int8(int32(0xC0) + int32(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) + *(*int8)(unsafe.Pointer(v15)) = int8(int32(0xC0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) v16 = zOut zOut++ - *(*int8)(unsafe.Pointer(v16)) = int8(int32(0x80) + int32(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v16)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } else { if iCode < uint32(0x10000) { v17 = zOut zOut++ - *(*int8)(unsafe.Pointer(v17)) = int8(int32(0xE0) + int32(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) + *(*int8)(unsafe.Pointer(v17)) = int8(int32(0xE0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v18 = zOut zOut++ - *(*int8)(unsafe.Pointer(v18)) = int8(int32(0x80) + int32(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v18)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v19 = zOut zOut++ - *(*int8)(unsafe.Pointer(v19)) = int8(int32(0x80) + int32(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v19)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } else { v20 = zOut zOut++ - *(*int8)(unsafe.Pointer(v20)) = int8(int32(0xF0) + int32(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(v20)) = int8(int32(0xF0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) v21 = zOut zOut++ - *(*int8)(unsafe.Pointer(v21)) = int8(int32(0x80) + int32(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v21)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) v22 = zOut zOut++ - *(*int8)(unsafe.Pointer(v22)) = int8(int32(0x80) + int32(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v22)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v23 = zOut zOut++ - *(*int8)(unsafe.Pointer(v23)) = int8(int32(0x80) + int32(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v23)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } } } @@ -224154,7 +217394,7 @@ _13: goto _9 _8: ; - if !(int32(*(*uint8)(unsafe.Pointer(a + uintptr(*(*uint8)(unsafe.Pointer(zCsr)))))) == 0) { + if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + uintptr(*(*uint8)(unsafe.Pointer(zCsr)))))) == 0) { goto _24 } /* An ascii-range separator character. End of token. */ @@ -224165,14 +217405,14 @@ _24: goto ascii_tokenchar ascii_tokenchar: ; - if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { v26 = zOut zOut++ - *(*int8)(unsafe.Pointer(v26)) = int8(int32(*(*uint8)(unsafe.Pointer(zCsr))) + int32(32)) + *(*int8)(unsafe.Pointer(v26)) = int8(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr))) + int32(32)) } else { v27 = zOut zOut++ - *(*int8)(unsafe.Pointer(v27)) = int8(*(*uint8)(unsafe.Pointer(zCsr))) + *(*int8)(unsafe.Pointer(v27)) = libc.Int8FromUint8(*(*uint8)(unsafe.Pointer(zCsr))) } zCsr++ _25: @@ -224252,7 +217492,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 38944 + zBase = __ccgo_ts + 38973 if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) } @@ -224415,7 +217655,6 @@ func _fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) (r int32) { break } bCons = libc.BoolInt32(!(_fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0)) - _ = libc.Int32FromInt32(0) mask = mask<<int32(1) + bCons goto _1 _1: @@ -224431,7 +217670,6 @@ func _fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) (r int32) { // // /* porter rule condition: (m > 1 and (*S or *T)) */ func _fts5Porter_MGt1_and_S_or_T(tls *libc.TLS, zStem uintptr, nStem int32) (r int32) { - _ = libc.Int32FromInt32(0) return libc.BoolInt32((int32(*(*int8)(unsafe.Pointer(zStem + uintptr(nStem-int32(1))))) == int32('s') || int32(*(*int8)(unsafe.Pointer(zStem + uintptr(nStem-int32(1))))) == int32('t')) && _fts5Porter_MGt1(tls, zStem, nStem) != 0) } @@ -224469,64 +217707,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38954, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38983, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38957, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38986, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38962, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38991, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38967, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38996, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38970, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38999, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38973, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39002, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38978, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39007, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38983, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39012, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38987, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39016, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38993, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39022, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38998, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39027, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -224535,49 +217773,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39002, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39031, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39006, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39035, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39009, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39038, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39013, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39042, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39017, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39046, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39021, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39050, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39025, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39054, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39029, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39058, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -224594,20 +217832,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39033, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39013, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39062, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39042, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39036, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39039, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39065, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39068, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39043, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39029, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39072, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39058, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -224623,75 +217861,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39046, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39075, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39013, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39042, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39054, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39083, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39061, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39090, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39066, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39095, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38962, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38991, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39071, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39100, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38957, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38986, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39076, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39105, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39029, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39058, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39081, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39110, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+15986, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39086, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39115, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39039, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39068, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39090, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39119, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38954, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38983, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39095, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39124, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38998, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39027, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39101, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39130, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39105, uint32(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39134, uint32(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39107, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39136, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39021, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39050, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -224700,48 +217938,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39113, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39142, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39029, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39058, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39121, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39150, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39013, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39042, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39127, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39156, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39013, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39042, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39132, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39161, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38954, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38983, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39138, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39167, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39025, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39054, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39146, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39175, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39154, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39183, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39158, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39187, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39021, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39050, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -224749,21 +217987,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39166, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39195, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38954, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38983, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39172, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39201, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39025, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39054, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39178, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39207, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39039, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39068, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -224781,48 +218019,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39185, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39214, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38970, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38999, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39190, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39219, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39195, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39224, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38970, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38999, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39201, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39230, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38970, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38999, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39154, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39183, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39207, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39236, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39213, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39242, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38954, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38983, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -224838,13 +218076,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39219, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39248, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39223, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39252, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39226, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39255, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -224852,7 +218090,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39229, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39258, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -224901,7 +218139,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT } aBuf = (*TPorterContext)(unsafe.Pointer(p)).FaBuf *(*int32)(unsafe.Pointer(bp)) = nToken - libc.Xmemcpy(tls, aBuf, pToken, uint32(*(*int32)(unsafe.Pointer(bp)))) + libc.Xmemcpy(tls, aBuf, pToken, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) /* Step 1. */ _fts5PorterStep1A(tls, aBuf, bp) if _fts5PorterStep1B(tls, aBuf, bp) != 0 { @@ -224927,7 +218165,6 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT _fts5PorterStep3(tls, aBuf, bp) _fts5PorterStep4(tls, aBuf, bp) /* Step 5a. */ - _ = libc.Int32FromInt32(0) if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))))) == int32('e') { if _fts5Porter_MGt1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-int32(1)) != 0 || _fts5Porter_MEq1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-int32(1)) != 0 && !(_fts5Porter_Ostar(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-int32(1)) != 0) { *(*int32)(unsafe.Pointer(bp))-- @@ -225010,18 +218247,18 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FiFoldParam = 0 i = 0 for { - if !(rc == SQLITE_OK && i < nArg) { + if !(rc == SQLITE_OK && i < nArg-int32(1)) { break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*4)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39233) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39262) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38926) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+38955) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -225041,6 +218278,9 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p ; i += int32(2) } + if i < nArg && rc == SQLITE_OK { + rc = int32(SQLITE_ERROR) + } if (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FiFoldParam != 0 && (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold == 0 { rc = int32(SQLITE_ERROR) } @@ -225086,10 +218326,10 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int iCode = uint32(*(*uint8)(unsafe.Pointer(v2))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zIn != zEof && int32(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { + for zIn != zEof && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { v3 = zIn zIn++ - iCode = iCode<<libc.Int32FromInt32(6) + uint32(libc.Int32FromInt32(0x3f)&int32(*(*uint8)(unsafe.Pointer(v3)))) + iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3)))) } if iCode < uint32(0x80) || iCode&uint32(0xFFFFF800) == uint32(0xD800) || iCode&uint32(0xFFFFFFFE) == uint32(0xFFFE) { iCode = uint32(0xFFFD) @@ -225099,45 +218339,45 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int return SQLITE_OK } if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { - iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) + iCode = libc.Uint32FromInt32(_sqlite3Fts5UnicodeFold(tls, libc.Int32FromUint32(iCode), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) } } if iCode < uint32(0x00080) { v4 = zOut zOut++ - *(*int8)(unsafe.Pointer(v4)) = int8(uint8(iCode & libc.Uint32FromInt32(0xFF))) + *(*int8)(unsafe.Pointer(v4)) = libc.Int8FromUint8(uint8(iCode & libc.Uint32FromInt32(0xFF))) } else { if iCode < uint32(0x00800) { v5 = zOut zOut++ - *(*int8)(unsafe.Pointer(v5)) = int8(int32(0xC0) + int32(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) + *(*int8)(unsafe.Pointer(v5)) = int8(int32(0xC0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) v6 = zOut zOut++ - *(*int8)(unsafe.Pointer(v6)) = int8(int32(0x80) + int32(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v6)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } else { if iCode < uint32(0x10000) { v7 = zOut zOut++ - *(*int8)(unsafe.Pointer(v7)) = int8(int32(0xE0) + int32(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) + *(*int8)(unsafe.Pointer(v7)) = int8(int32(0xE0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v8 = zOut zOut++ - *(*int8)(unsafe.Pointer(v8)) = int8(int32(0x80) + int32(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v8)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v9 = zOut zOut++ - *(*int8)(unsafe.Pointer(v9)) = int8(int32(0x80) + int32(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v9)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } else { v10 = zOut zOut++ - *(*int8)(unsafe.Pointer(v10)) = int8(int32(0xF0) + int32(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(v10)) = int8(int32(0xF0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) v11 = zOut zOut++ - *(*int8)(unsafe.Pointer(v11)) = int8(int32(0x80) + int32(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v11)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) v12 = zOut zOut++ - *(*int8)(unsafe.Pointer(v12)) = int8(int32(0x80) + int32(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v12)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v13 = zOut zOut++ - *(*int8)(unsafe.Pointer(v13)) = int8(int32(0x80) + int32(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v13)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } } } @@ -225153,7 +218393,6 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int ** aStart[3]: Contains the byte offset in the input text corresponding ** to the start of each of the three characters in the buffer. */ - _ = libc.Int32FromInt32(0) for int32(1) != 0 { /* Read characters from the input up until the first non-diacritic */ for cond := true; cond; cond = iCode == uint32(0) { @@ -225163,10 +218402,10 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int iCode = uint32(*(*uint8)(unsafe.Pointer(v14))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zIn != zEof && int32(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { + for zIn != zEof && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { v15 = zIn zIn++ - iCode = iCode<<libc.Int32FromInt32(6) + uint32(libc.Int32FromInt32(0x3f)&int32(*(*uint8)(unsafe.Pointer(v15)))) + iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v15)))) } if iCode < uint32(0x80) || iCode&uint32(0xFFFFF800) == uint32(0xD800) || iCode&uint32(0xFFFFFFFE) == uint32(0xFFFE) { iCode = uint32(0xFFFD) @@ -225176,7 +218415,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int break } if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { - iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) + iCode = libc.Uint32FromInt32(_sqlite3Fts5UnicodeFold(tls, libc.Int32FromUint32(iCode), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) } } /* Pass the current trigram back to fts5 */ @@ -225189,49 +218428,49 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int z1 = bp v16 = z1 z1++ - if int32(uint8(*(*int8)(unsafe.Pointer(v16)))) >= int32(0xc0) { - for int32(uint8(*(*int8)(unsafe.Pointer(z1))))&int32(0xc0) == int32(0x80) { + if libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v16)))) >= int32(0xc0) { + for libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z1))))&int32(0xc0) == int32(0x80) { z1++ } } - libc.Xmemmove(tls, bp, z1, uint32(int32(zOut)-int32(z1))) + libc.Xmemmove(tls, bp, z1, libc.Uint32FromInt32(int32(zOut)-int32(z1))) zOut -= uintptr(int32(z1) - t__predefined_ptrdiff_t(bp)) if iCode < uint32(0x00080) { v17 = zOut zOut++ - *(*int8)(unsafe.Pointer(v17)) = int8(uint8(iCode & libc.Uint32FromInt32(0xFF))) + *(*int8)(unsafe.Pointer(v17)) = libc.Int8FromUint8(uint8(iCode & libc.Uint32FromInt32(0xFF))) } else { if iCode < uint32(0x00800) { v18 = zOut zOut++ - *(*int8)(unsafe.Pointer(v18)) = int8(int32(0xC0) + int32(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) + *(*int8)(unsafe.Pointer(v18)) = int8(int32(0xC0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) v19 = zOut zOut++ - *(*int8)(unsafe.Pointer(v19)) = int8(int32(0x80) + int32(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v19)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } else { if iCode < uint32(0x10000) { v20 = zOut zOut++ - *(*int8)(unsafe.Pointer(v20)) = int8(int32(0xE0) + int32(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) + *(*int8)(unsafe.Pointer(v20)) = int8(int32(0xE0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v21 = zOut zOut++ - *(*int8)(unsafe.Pointer(v21)) = int8(int32(0x80) + int32(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v21)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v22 = zOut zOut++ - *(*int8)(unsafe.Pointer(v22)) = int8(int32(0x80) + int32(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v22)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } else { v23 = zOut zOut++ - *(*int8)(unsafe.Pointer(v23)) = int8(int32(0xF0) + int32(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(v23)) = int8(int32(0xF0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) v24 = zOut zOut++ - *(*int8)(unsafe.Pointer(v24)) = int8(int32(0x80) + int32(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v24)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) v25 = zOut zOut++ - *(*int8)(unsafe.Pointer(v25)) = int8(int32(0x80) + int32(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v25)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v26 = zOut zOut++ - *(*int8)(unsafe.Pointer(v26)) = int8(int32(0x80) + int32(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*int8)(unsafe.Pointer(v26)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } } } @@ -225296,7 +218535,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 38944, + FzName: __ccgo_ts + 38973, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -225304,7 +218543,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39248, + FzName: __ccgo_ts + 39277, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -225312,7 +218551,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39254, + FzName: __ccgo_ts + 39283, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5PorterCreate), FxDelete: __ccgo_fp(_fts5PorterDelete), @@ -225320,7 +218559,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 3: { - FzName: __ccgo_ts + 39261, + FzName: __ccgo_ts + 39290, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -225331,7 +218570,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { rc = SQLITE_OK /* To iterate through builtin functions */ i = 0 for { - if !(rc == SQLITE_OK && i < int32(libc.Uint32FromInt64(64)/libc.Uint32FromInt64(16))) { + if !(rc == SQLITE_OK && i < libc.Int32FromUint32(libc.Uint32FromInt64(64)/libc.Uint32FromInt64(16))) { break } rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer})))(tls, pApi, (*(*[4]struct { @@ -225545,16 +218784,16 @@ func _fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) (r int32) { 34: uint8('i'), 35: uint8('o'), 36: uint8('u'), - 37: uint8(libc.Int32FromUint8('u') | int32(libc.Uint8FromInt32(0x80))), - 38: uint8(libc.Int32FromUint8('a') | int32(libc.Uint8FromInt32(0x80))), + 37: libc.Uint8FromInt32(libc.Int32FromUint8('u') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), + 38: libc.Uint8FromInt32(libc.Int32FromUint8('a') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 39: uint8('g'), 40: uint8('k'), 41: uint8('o'), - 42: uint8(libc.Int32FromUint8('o') | int32(libc.Uint8FromInt32(0x80))), + 42: libc.Uint8FromInt32(libc.Int32FromUint8('o') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 43: uint8('j'), 44: uint8('g'), 45: uint8('n'), - 46: uint8(libc.Int32FromUint8('a') | int32(libc.Uint8FromInt32(0x80))), + 46: libc.Uint8FromInt32(libc.Int32FromUint8('a') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 47: uint8('a'), 48: uint8('e'), 49: uint8('i'), @@ -225566,40 +218805,40 @@ func _fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) (r int32) { 55: uint8('h'), 56: uint8('a'), 57: uint8('e'), - 58: uint8(libc.Int32FromUint8('o') | int32(libc.Uint8FromInt32(0x80))), + 58: libc.Uint8FromInt32(libc.Int32FromUint8('o') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 59: uint8('o'), - 60: uint8(libc.Int32FromUint8('o') | int32(libc.Uint8FromInt32(0x80))), + 60: libc.Uint8FromInt32(libc.Int32FromUint8('o') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 61: uint8('y'), 70: uint8('a'), 71: uint8('b'), - 72: uint8(libc.Int32FromUint8('c') | int32(libc.Uint8FromInt32(0x80))), + 72: libc.Uint8FromInt32(libc.Int32FromUint8('c') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 73: uint8('d'), 74: uint8('d'), - 75: uint8(libc.Int32FromUint8('e') | int32(libc.Uint8FromInt32(0x80))), + 75: libc.Uint8FromInt32(libc.Int32FromUint8('e') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 76: uint8('e'), - 77: uint8(libc.Int32FromUint8('e') | int32(libc.Uint8FromInt32(0x80))), + 77: libc.Uint8FromInt32(libc.Int32FromUint8('e') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 78: uint8('f'), 79: uint8('g'), 80: uint8('h'), 81: uint8('h'), 82: uint8('i'), - 83: uint8(libc.Int32FromUint8('i') | int32(libc.Uint8FromInt32(0x80))), + 83: libc.Uint8FromInt32(libc.Int32FromUint8('i') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 84: uint8('k'), 85: uint8('l'), - 86: uint8(libc.Int32FromUint8('l') | int32(libc.Uint8FromInt32(0x80))), + 86: libc.Uint8FromInt32(libc.Int32FromUint8('l') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 87: uint8('l'), 88: uint8('m'), 89: uint8('n'), - 90: uint8(libc.Int32FromUint8('o') | int32(libc.Uint8FromInt32(0x80))), + 90: libc.Uint8FromInt32(libc.Int32FromUint8('o') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 91: uint8('p'), 92: uint8('r'), - 93: uint8(libc.Int32FromUint8('r') | int32(libc.Uint8FromInt32(0x80))), + 93: libc.Uint8FromInt32(libc.Int32FromUint8('r') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 94: uint8('r'), 95: uint8('s'), - 96: uint8(libc.Int32FromUint8('s') | int32(libc.Uint8FromInt32(0x80))), + 96: libc.Uint8FromInt32(libc.Int32FromUint8('s') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 97: uint8('t'), 98: uint8('u'), - 99: uint8(libc.Int32FromUint8('u') | int32(libc.Uint8FromInt32(0x80))), + 99: libc.Uint8FromInt32(libc.Int32FromUint8('u') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 100: uint8('v'), 101: uint8('w'), 102: uint8('w'), @@ -225611,25 +218850,25 @@ func _fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) (r int32) { 108: uint8('w'), 109: uint8('y'), 110: uint8('a'), - 111: uint8(libc.Int32FromUint8('a') | int32(libc.Uint8FromInt32(0x80))), - 112: uint8(libc.Int32FromUint8('a') | int32(libc.Uint8FromInt32(0x80))), - 113: uint8(libc.Int32FromUint8('a') | int32(libc.Uint8FromInt32(0x80))), + 111: libc.Uint8FromInt32(libc.Int32FromUint8('a') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), + 112: libc.Uint8FromInt32(libc.Int32FromUint8('a') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), + 113: libc.Uint8FromInt32(libc.Int32FromUint8('a') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 114: uint8('e'), - 115: uint8(libc.Int32FromUint8('e') | int32(libc.Uint8FromInt32(0x80))), - 116: uint8(libc.Int32FromUint8('e') | int32(libc.Uint8FromInt32(0x80))), + 115: libc.Uint8FromInt32(libc.Int32FromUint8('e') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), + 116: libc.Uint8FromInt32(libc.Int32FromUint8('e') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 117: uint8('i'), 118: uint8('o'), - 119: uint8(libc.Int32FromUint8('o') | int32(libc.Uint8FromInt32(0x80))), - 120: uint8(libc.Int32FromUint8('o') | int32(libc.Uint8FromInt32(0x80))), - 121: uint8(libc.Int32FromUint8('o') | int32(libc.Uint8FromInt32(0x80))), + 119: libc.Uint8FromInt32(libc.Int32FromUint8('o') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), + 120: libc.Uint8FromInt32(libc.Int32FromUint8('o') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), + 121: libc.Uint8FromInt32(libc.Int32FromUint8('o') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 122: uint8('u'), - 123: uint8(libc.Int32FromUint8('u') | int32(libc.Uint8FromInt32(0x80))), - 124: uint8(libc.Int32FromUint8('u') | int32(libc.Uint8FromInt32(0x80))), + 123: libc.Uint8FromInt32(libc.Int32FromUint8('u') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), + 124: libc.Uint8FromInt32(libc.Int32FromUint8('u') | libc.Int32FromUint8(libc.Uint8FromInt32(0x80))), 125: uint8('y'), } - key = uint32(c)<<int32(3) | uint32(0x00000007) + key = libc.Uint32FromInt32(c)<<int32(3) | uint32(0x00000007) iRes = 0 - iHi = int32(libc.Uint32FromInt64(252)/libc.Uint32FromInt64(2) - libc.Uint32FromInt32(1)) + iHi = libc.Int32FromUint32(libc.Uint32FromInt64(252)/libc.Uint32FromInt64(2) - libc.Uint32FromInt32(1)) iLo = 0 for iHi >= iLo { iTest = (iHi + iLo) / int32(2) @@ -225640,14 +218879,13 @@ func _fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) (r int32) { iHi = iTest - int32(1) } } - _ = libc.Int32FromInt32(0) - if bComplex == 0 && int32(aChar[iRes])&int32(0x80) != 0 { + if bComplex == 0 && libc.Int32FromUint8(aChar[iRes])&int32(0x80) != 0 { return c } - if c > int32(aDia[iRes])>>int32(3)+int32(aDia[iRes])&int32(0x07) { + if c > libc.Int32FromUint16(aDia[iRes])>>int32(3)+libc.Int32FromUint16(aDia[iRes])&int32(0x07) { v1 = c } else { - v1 = int32(aChar[iRes]) & int32(0x7F) + v1 = libc.Int32FromUint8(aChar[iRes]) & int32(0x7F) } return v1 } @@ -225671,7 +218909,7 @@ func _sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) (r int32) { } else { v1 = mask1 & (libc.Uint32FromInt32(1) << (c - int32(768) - int32(32))) } - return int32(v1) + return libc.Int32FromUint32(v1) } // C documentation @@ -225690,20 +218928,18 @@ func _sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) (r var p uintptr _, _, _, _, _, _, _ = cmp, iHi, iLo, iRes, iTest, p, ret ret = c - _ = libc.Int32FromInt32(0) if c < int32(128) { if c >= int32('A') && c <= int32('Z') { ret = c + (libc.Int32FromUint8('a') - libc.Int32FromUint8('A')) } } else { if c < int32(65536) { - iHi = int32(libc.Uint32FromInt64(652)/libc.Uint32FromInt64(4) - libc.Uint32FromInt32(1)) + iHi = libc.Int32FromUint32(libc.Uint32FromInt64(652)/libc.Uint32FromInt64(4) - libc.Uint32FromInt32(1)) iLo = 0 iRes = -int32(1) - _ = libc.Int32FromInt32(0) for iHi >= iLo { iTest = (iHi + iLo) / int32(2) - cmp = c - int32(_aEntry[iTest].FiCode) + cmp = c - libc.Int32FromUint16(_aEntry[iTest].FiCode) if cmp >= 0 { iRes = iTest iLo = iTest + int32(1) @@ -225711,31 +218947,29 @@ func _sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) (r iHi = iTest - int32(1) } } - _ = libc.Int32FromInt32(0) p = uintptr(unsafe.Pointer(&_aEntry)) + uintptr(iRes)*4 - if c < int32((*struct { + if c < libc.Int32FromUint16((*struct { FiCode uint16 Fflags uint8 FnRange uint8 - })(unsafe.Pointer(p)).FiCode)+int32((*struct { + })(unsafe.Pointer(p)).FiCode)+libc.Int32FromUint8((*struct { FiCode uint16 Fflags uint8 FnRange uint8 - })(unsafe.Pointer(p)).FnRange) && 0 == int32(0x01)&int32((*struct { + })(unsafe.Pointer(p)).FnRange) && 0 == int32(0x01)&libc.Int32FromUint8((*struct { FiCode uint16 Fflags uint8 FnRange uint8 - })(unsafe.Pointer(p)).Fflags)&(int32((*struct { + })(unsafe.Pointer(p)).Fflags)&(libc.Int32FromUint16((*struct { FiCode uint16 Fflags uint8 FnRange uint8 })(unsafe.Pointer(p)).FiCode)^c) { - ret = (c + int32(_aiOff[int32((*struct { + ret = (c + libc.Int32FromUint16(_aiOff[libc.Int32FromUint8((*struct { FiCode uint16 Fflags uint8 FnRange uint8 })(unsafe.Pointer(p)).Fflags)>>int32(1)])) & int32(0x0000FFFF) - _ = libc.Int32FromInt32(0) } if eRemoveDiacritic != 0 { ret = _fts5_remove_diacritic(tls, ret, libc.BoolInt32(eRemoveDiacritic == int32(2))) @@ -230342,16 +223576,15 @@ func _sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode Tu32) (r int32) { var iKey Tu16 _, _, _, _, _, _, _ = iHi, iKey, iLo, iRes, iTest, ret, v1 iRes = -int32(1) - if iCode >= uint32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(20)) { + if iCode >= libc.Uint32FromInt32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(20)) { return 0 } - iLo = int32(_aFts5UnicodeBlock[iCode>>int32(16)]) - iHi = int32(_aFts5UnicodeBlock[uint32(1)+iCode>>libc.Int32FromInt32(16)]) + iLo = libc.Int32FromUint16(_aFts5UnicodeBlock[iCode>>int32(16)]) + iHi = libc.Int32FromUint16(_aFts5UnicodeBlock[uint32(1)+iCode>>libc.Int32FromInt32(16)]) iKey = uint16(iCode & libc.Uint32FromInt32(0xFFFF)) for iHi > iLo { iTest = (iHi + iLo) / int32(2) - _ = libc.Int32FromInt32(0) - if int32(iKey) >= int32(_aFts5UnicodeMap[iTest]) { + if libc.Int32FromUint16(iKey) >= libc.Int32FromUint16(_aFts5UnicodeMap[iTest]) { iRes = iTest iLo = iTest + int32(1) } else { @@ -230361,14 +223594,14 @@ func _sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode Tu32) (r int32) { if iRes < 0 { return 0 } - if int32(iKey) >= int32(_aFts5UnicodeMap[iRes])+int32(_aFts5UnicodeData[iRes])>>int32(5) { + if libc.Int32FromUint16(iKey) >= libc.Int32FromUint16(_aFts5UnicodeMap[iRes])+libc.Int32FromUint16(_aFts5UnicodeData[iRes])>>int32(5) { return 0 } - ret = int32(_aFts5UnicodeData[iRes]) & int32(0x1F) + ret = libc.Int32FromUint16(_aFts5UnicodeData[iRes]) & int32(0x1F) if ret != int32(30) { return ret } - if (int32(iKey)-int32(_aFts5UnicodeMap[iRes]))&int32(0x01) != 0 { + if (libc.Int32FromUint16(iKey)-libc.Int32FromUint16(_aFts5UnicodeMap[iRes]))&int32(0x01) != 0 { v1 = int32(5) } else { v1 = int32(9) @@ -230382,13 +223615,13 @@ func _sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { i = 0 iTbl = 0 for i < int32(128) { - bToken = int32(*(*Tu8)(unsafe.Pointer(aArray + uintptr(int32(_aFts5UnicodeData[iTbl])&int32(0x1F))))) - n = int32(_aFts5UnicodeData[iTbl])>>int32(5) + i + bToken = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aArray + uintptr(libc.Int32FromUint16(_aFts5UnicodeData[iTbl])&int32(0x1F))))) + n = libc.Int32FromUint16(_aFts5UnicodeData[iTbl])>>int32(5) + i for { if !(i < int32(128) && i < n) { break } - *(*Tu8)(unsafe.Pointer(aAscii + uintptr(i))) = uint8(bToken) + *(*Tu8)(unsafe.Pointer(aAscii + uintptr(i))) = libc.Uint8FromInt32(bToken) goto _1 _1: ; @@ -230456,7 +223689,7 @@ func _sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) (r int32) { /* a: p0<<14 | p2 (unmasked) */ if !(a&libc.Uint32FromInt32(0x80) != 0) { /* Values between 16384 and 2097151 */ - a &= uint32(libc.Int32FromInt32(0x7f)<<libc.Int32FromInt32(14) | libc.Int32FromInt32(0x7f)) + a &= libc.Uint32FromInt32(libc.Int32FromInt32(0x7f)<<libc.Int32FromInt32(14) | libc.Int32FromInt32(0x7f)) b &= uint32(0x7f) b = b << int32(7) *(*Tu32)(unsafe.Pointer(v)) = a | b @@ -230474,8 +223707,7 @@ func _sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) (r int32) { p -= uintptr(2) n = _sqlite3Fts5GetVarint(tls, p, bp) *(*Tu32)(unsafe.Pointer(v)) = uint32(*(*Tu64)(unsafe.Pointer(bp))) & uint32(0x7FFFFFFF) - _ = libc.Int32FromInt32(0) - return int32(n) + return libc.Int32FromUint8(n) return r } @@ -230515,8 +223747,6 @@ func _sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { return uint8(2) } /* Verify that constants are precomputed correctly */ - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) p++ a = a << int32(14) a |= uint32(*(*uint8)(unsafe.Pointer(p))) @@ -230695,7 +223925,6 @@ func _fts5PutVarint64(tls *libc.TLS, p uintptr, v Tu64) (r int32) { } p3 = bp *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & libc.Int32FromInt32(0x7f)) - _ = libc.Int32FromInt32(0) i = 0 j = n - libc.Int32FromInt32(1) for { @@ -230726,14 +223955,13 @@ func _sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v Tu64) (r int32) { } func _sqlite3Fts5GetVarintLen(tls *libc.TLS, iVal Tu32) (r int32) { - _ = libc.Int32FromInt32(0) - if iVal < uint32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(14)) { + if iVal < libc.Uint32FromInt32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(14)) { return int32(2) } - if iVal < uint32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(21)) { + if iVal < libc.Uint32FromInt32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(21)) { return int32(3) } - if iVal < uint32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(28)) { + if iVal < libc.Uint32FromInt32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(28)) { return int32(4) } return int32(5) @@ -230865,16 +224093,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39269) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39298) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39273) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39302) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39277) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39306) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39286, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39315, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -230943,15 +224171,15 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39320, - 1: __ccgo_ts + 39360, - 2: __ccgo_ts + 39395, + 0: __ccgo_ts + 39349, + 1: __ccgo_ts + 39389, + 2: __ccgo_ts + 39424, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+23865, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+23894, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39438, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39467, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -230972,15 +224200,14 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*4)) } zType = v3 - nDb = int32(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = int32(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int32FromUint32(libc.Xstrlen(tls, zDb)) + int32(1) + nTab = libc.Int32FromUint32(libc.Xstrlen(tls, zTab)) + int32(1) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = int32(uint32(36) + uint32(nDb) + uint32(nTab)) + nByte = libc.Int32FromUint32(uint32(36) + libc.Uint32FromInt32(nDb) + libc.Uint32FromInt32(nTab)) pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux @@ -230988,8 +224215,8 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*36 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, uint32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, uint32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint32FromInt32(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint32FromInt32(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -231042,23 +224269,23 @@ func _fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) (r break } p = (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12 - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0 { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0 { goto _1 } if (*Tsqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0 { /* term column */ - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) { iTermEq = i } - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_LE) { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_LE) { iTermLe = i } - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_LT) { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_LT) { iTermLe = i } - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_GE) { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_GE) { iTermGe = i } - if int32((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_GT) { + if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_GT) { iTermGe = i } } @@ -231095,7 +224322,7 @@ func _fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) (r ** specifically - "ORDER BY term" or "ORDER BY term ASC" - set the ** sqlite3_index_info.orderByConsumed flag to tell the core the results ** are already in sorted order. */ - if (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == int32(1) && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy))).FiColumn == 0 && int32((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy))).Fdesc) == 0 { + if (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == int32(1) && (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy))).FiColumn == 0 && libc.Int32FromUint8((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy))).Fdesc) == 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).ForderByConsumed = int32(1) } (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FidxNum = idxNum @@ -231122,15 +224349,14 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39471, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39500, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39502, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39531, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+4, uintptr(0)) } Xsqlite3_free(tls, zSql) - _ = libc.Int32FromInt32(0) if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK } @@ -231145,7 +224371,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39553, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39582, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -231153,7 +224379,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - nByte = int64(uint32((*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol)*uint32(8)*uint32(2) + uint32(76)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt32((*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol)*uint32(8)*uint32(2) + uint32(76)) pCsr = _sqlite3Fts5MallocZero(tls, bp, nByte) } if pCsr != 0 { @@ -231217,7 +224443,7 @@ func _fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) (r int32) { v1 = (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm } nCmp = v1 - bCmp = libc.Xmemcmp(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint32(nCmp)) + bCmp = libc.Xmemcmp(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, libc.Uint32FromInt32(nCmp)) if bCmp < 0 || bCmp == 0 && (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp + 4)) { (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = int32(1) } @@ -231236,8 +224462,6 @@ func _fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) (r int32) { pIter = (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter pp = pCsr + 64 po = pCsr + 72 - _ = libc.Int32FromInt32(0) - _ = libc.Int32FromInt32(0) for eDetail == int32(FTS5_DETAIL_NONE) || _sqlite3Fts5PoslistNext64(tls, (*TFts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*TFts5IndexIter)(unsafe.Pointer(pIter)).FnData, po, pp) != 0 { (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos = 0 (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstOff = 0 @@ -231302,7 +224526,6 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = int32(1) } else { zTerm = _sqlite3Fts5IterTerm(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp+4) - _ = libc.Int32FromInt32(0) if (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm >= 0 { if *(*int32)(unsafe.Pointer(bp + 4)) < (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm { v2 = *(*int32)(unsafe.Pointer(bp + 4)) @@ -231310,17 +224533,16 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { v2 = (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm } nCmp = v2 - bCmp = libc.Xmemcmp(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint32(nCmp)) + bCmp = libc.Xmemcmp(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, libc.Uint32FromInt32(nCmp)) if bCmp < 0 || bCmp == 0 && (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp + 4)) { (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = int32(1) return SQLITE_OK } } _sqlite3Fts5BufferSet(tls, bp, pCsr+52, *(*int32)(unsafe.Pointer(bp + 4)), zTerm) - libc.Xmemset(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt, 0, uint32(nCol)*uint32(8)) - libc.Xmemset(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc, 0, uint32(nCol)*uint32(8)) + libc.Xmemset(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt, 0, libc.Uint32FromInt32(nCol)*uint32(8)) + libc.Xmemset(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc, 0, libc.Uint32FromInt32(nCol)*uint32(8)) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol = 0 - _ = libc.Int32FromInt32(0) for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { eDetail = (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail /* Position list */ *(*Ti64)(unsafe.Pointer(bp + 8)) = 0 /* 64-bit position read from poslist */ @@ -231353,7 +224575,6 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { } else { if eDetail == int32(FTS5_DETAIL_COLUMNS) { for 0 == _sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+16, bp+8) { - _ = libc.Int32FromInt32(0) if *(*Ti64)(unsafe.Pointer(bp + 8)) >= int64(nCol) { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) break @@ -231361,12 +224582,10 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(*(*Ti64)(unsafe.Pointer(bp + 8)))*8))++ } } else { - _ = libc.Int32FromInt32(0) *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc))++ } } default: - _ = libc.Int32FromInt32(0) break } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -231377,7 +224596,7 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { zTerm = _sqlite3Fts5IterTerm(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp+4) - if *(*int32)(unsafe.Pointer(bp + 4)) != (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fn || *(*int32)(unsafe.Pointer(bp + 4)) > 0 && libc.Xmemcmp(tls, zTerm, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fp, uint32(*(*int32)(unsafe.Pointer(bp + 4)))) != 0 { + if *(*int32)(unsafe.Pointer(bp + 4)) != (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fn || *(*int32)(unsafe.Pointer(bp + 4)) > 0 && libc.Xmemcmp(tls, zTerm, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fp, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) != 0 { break } if (*TFts5IndexIter)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FbEof != 0 { @@ -231461,7 +224680,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zCopy, uint32((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1))) + libc.Xmemcpy(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zCopy, libc.Uint32FromInt32((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1))) } } } @@ -231507,7 +224726,6 @@ func _fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol i Xsqlite3_result_text(tls, pCtx, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fp, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fn, uintptr(-libc.Int32FromInt32(1))) } else { if eType == FTS5_VOCAB_COL { - _ = libc.Int32FromInt32(0) if iCol == int32(1) { if eDetail != int32(FTS5_DETAIL_NONE) { z = *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FazCol + uintptr((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*4)) @@ -231522,14 +224740,12 @@ func _fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol i } } else { if eType == int32(FTS5_VOCAB_ROW) { - _ = libc.Int32FromInt32(0) if iCol == int32(1) { iVal = *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc)) } else { iVal = *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt)) } } else { - _ = libc.Int32FromInt32(0) switch iCol { case int32(1): Xsqlite3_result_int64(tls, pCtx, (*TFts5IndexIter)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FiRowid) @@ -231547,7 +224763,6 @@ func _fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol i Xsqlite3_result_text(tls, pCtx, z1, -int32(1), libc.UintptrFromInt32(0)) } default: - _ = libc.Int32FromInt32(0) if eDetail == FTS5_DETAIL_FULL { ii1 = int32((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos & libc.Int64FromInt32(0x7FFFFFFF)) Xsqlite3_result_int(tls, pCtx, ii1) @@ -231582,7 +224797,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+39579, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+39608, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -231635,7 +224850,7 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 39589 + return __ccgo_ts + 39618 } type TAggInfo_col = struct { @@ -231915,11 +225130,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '6', '.', '0'} +var Xsqlite3_version = [7]int8{'3', '.', '4', '6', '.', '1'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=127\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfPos\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenRead\x00OpenWrite\x00BitNot\x00OpenDup\x00OpenAutoindex\x00String8\x00OpenEphemeral\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00Real\x00DropTrigger\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00<expr>\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX %d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00<polyline points=\x00%c%g,%g\x00 %g,%g'\x00 %s\x00></polyline>\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1 UNION ALL SELECT 1, 'idx', '', 0, '', 2 UNION ALL SELECT 2, 'stat', '', 0, '', 0\x00PRAGMA '%q'.table_info('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00'delete' may not be used with a contentless_delete=1 table\x00DELETE from\x00cannot %s contentless fts5 table: %s\x00no such cursor: %lld\x00cannot UPDATE a subset of columns on fts5 contentless-delete table: %s\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00ascii\x00porter\x00trigram\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=127\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfPos\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenRead\x00OpenWrite\x00BitNot\x00OpenDup\x00OpenAutoindex\x00String8\x00OpenEphemeral\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00Real\x00DropTrigger\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00<expr>\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX %d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00<polyline points=\x00%c%g,%g\x00 %g,%g'\x00 %s\x00></polyline>\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1 UNION ALL SELECT 1, 'idx', '', 0, '', 2 UNION ALL SELECT 2, 'stat', '', 0, '', 0\x00PRAGMA '%q'.table_info('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00'delete' may not be used with a contentless_delete=1 table\x00DELETE from\x00cannot %s contentless fts5 table: %s\x00no such cursor: %lld\x00cannot UPDATE a subset of columns on fts5 contentless-delete table: %s\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00ascii\x00porter\x00trigram\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -231929,3 +225144,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + |